Skip to content

Commit

Permalink
Remove docker keyword appropriately in market place item (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjaini authored Dec 17, 2019
1 parent 1077569 commit e71afc1
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 179 deletions.
4 changes: 2 additions & 2 deletions registry/DeploymentTemplates/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"type": "string",
"defaultValue": "20",
"metadata": {
"description": "Docker registry replicas."
"description": "Registry replicas."
}
},
"servicePrincipalClientId": {
Expand All @@ -122,7 +122,7 @@
"type": "string",
"defaultValue": "false",
"metadata": {
"description": "Docker registry validation flag."
"description": "Registry validation flag."
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion registry/DeploymentTemplates/createUiDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"type": "Microsoft.Common.TextBox",
"label": "Replicas",
"defaultValue": "20",
"toolTip": "Docker registry replica count",
"toolTip": "Registry replica count",
"constraints": {
"required": true,
"regex": "^[0-9]{1,2}$"
Expand Down
10 changes: 5 additions & 5 deletions registry/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Docker Container Registry Marketplace Item
# Container Registry Marketplace Item

## Install Gallery Item

### Prepare Package

Use `make release` to create an Azure Gallery Package (.azpkg) for the Docker Container Registry solution template. The package will be placed in the `_out` directory. Upload the package to a BLOB container in an Azure Storage Account with anonymous access enabled.
Use `make release` to create an Azure Gallery Package (.azpkg) for the Container Registry solution template. The package will be placed in the `_out` directory. Upload the package to a BLOB container in an Azure Storage Account with anonymous access enabled.

### Side-load Package

Expand All @@ -24,7 +24,7 @@ Update the certificate information in `self-signed.ps1`, and run it to create a
Scripts\self-signed.ps1
```

This certificate will be uploaded to a Key Vault instance in a subsequent step, and then consumed by the private docker registry.
This certificate will be uploaded to a Key Vault instance in a subsequent step, and then consumed by the private container registry.

### Create Backend Storage Account and Key Vault

Expand All @@ -34,7 +34,7 @@ Update the tenant information in `connect.ps1` and run it to connect to the tena
Scripts\connect.ps1
```

Set your environment information in `pre-reqs.ps1` and run it to create and populate the required backend Storage Account and Key Vault instance. Take note of the script output as it will be used later to deploy the private docker registry.
Set your environment information in `pre-reqs.ps1` and run it to create and populate the required backend Storage Account and Key Vault instance. Take note of the script output as it will be used later to deploy the private container registry.

```powershell
Scripts\pre-reqs.ps1
Expand All @@ -45,7 +45,7 @@ Scripts\pre-reqs.ps1
From the tenant portal, go to:

```
Create a resource -> Compute -> Docker Container Registry
Create a resource -> Compute -> Container Registry
```

## Logs
Expand Down
6 changes: 3 additions & 3 deletions registry/Scripts/gallery.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
-AdminUserName admin@localazurestack.onmicrosoft.com
-AdminPassword <Login Password>
-TenantId 00000000-0000-0000-0000-000000000000
-MarketplaceUri https://local.blob.core.windows.net/marketplaceblob/Microsoft.AzureStackDockerContainerRegistry.1.0.0.azpkg
-MarketplaceUri https://local.blob.core.windows.net/marketplaceblob/Microsoft.AzureStackContainerRegistry.1.0.0.azpkg
#>
Param
(
Expand Down Expand Up @@ -67,9 +67,9 @@ Login-AzureRmAccount -Credential $mycreds -EnvironmentName $EnvironmentName -Ten
#$PKG_SA_NAME=""
#$PKG_SA_CONTAINER=""
#$PKG_VERSION=""
#"https://$PKG_SA_NAME.blob.$AzureStackDomainName/$PKG_SA_CONTAINER/Microsoft.AzureStackDockerContainerRegistry.$PKG_VERSION.azpkg"
#"https://$PKG_SA_NAME.blob.$AzureStackDomainName/$PKG_SA_CONTAINER/Microsoft.AzureStackContainerRegistry.$PKG_VERSION.azpkg"

Add-AzsGalleryItem -Force -GalleryItemUri $MarketplaceUri

# Remove package
# Remove-AzsGalleryItem -Force -Name "Microsoft.AzureStackDockerContainerRegistry.$PKG_VERSION"
# Remove-AzsGalleryItem -Force -Name "Microsoft.AzureStackContainerRegistry.$PKG_VERSION"
167 changes: 0 additions & 167 deletions registry/Scripts/pre-reqs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,173 +68,6 @@ function New-ResourceGroup (
}
}

<#
.Synopsis
Create a DNS zone under given resource group
.Description
Create a DNS zone under given resource group
It will skip creation of DNS zone resource if already present.
Return storage account details.
.Parameter ResourceGroupName
DNS zone's resource group.
.Parameter Name
DNS zone name.
.Example
New-DnsZone -ResourceGroupName "resourcegroupname"
-Name "sample.com"
#>
function New-DnsZone (
[Parameter(Mandatory = $true, HelpMessage = "DNS zone's resource group.")]
[string] $ResourceGroupName,
[Parameter(Mandatory = $true, HelpMessage = "DNS zone name.")]
[string] $Name
)
{
# Create storage account

Write-Host "Check if DNS Zone ($Name) already exists"
$ErrorActionPreference = "SilentlyContinue";
$dnsZoneDetails = Get-AzureRmDnsZone -Name $Name `
-ResourceGroupName $ResourceGroupName `
-ErrorVariable dnsZoneExistError
$ErrorActionPreference = "Continue"; #Turning errors back on
if (-not $dnsZoneDetails) {
Write-Host "DNS zone does not exist. Creating a new DNS zone ($Name) under resource group ($ResourceGroupName)."
New-AzureRmDnsZone -Name $Name -ResourceGroupName $ResourceGroupName | Out-Null
$ErrorActionPreference = "SilentlyContinue";
$newDNSZoneDetails = Get-AzureRmDnsZone -Name $Name -ResourceGroupName $ResourceGroupName `
-ErrorVariable newDNSZoneCreateError
$ErrorActionPreference = "Continue"; #Turning errors back on
if (-not $newDNSZoneDetails) {
throw "Creation of new DNS zone ($Name) under resource group ($ResourceGroupName) failed. Check if specified DNS zone with same name already exists."
}
Write-Host "DNS zone ($Name) created successfully."
}
else {
Write-Host "DNS zone ($Name) already exists. Skipping creation."
}

return $storageAccountDetails
}

<#
.Synopsis
Create/update DNS record under given DNS zone.
.Description
Create/update DNS record under given DNS zone.
It will update DNS record if already present.
.Parameter ResourceGroupName
DNS zone's resource group.
.Parameter ZoneName
DNS zone name.
.Parameter Name
DNS record name.
.Parameter RecordType
Type of record.
.Parameter DnsRecordConfigValue
Record value.
.Parameter TTL
TTL value.
.Example
Set-DnsRecordSet -ResourceGroupName "resourcegroupname"
-ZoneName "sample.com"
-Name "test"
-RecordType "A"
-DnsRecordConfigValue "0.0.0.0"
#>
function Set-DnsRecordSet (
[Parameter(Mandatory = $true, HelpMessage = "DNS zone's resource group.")]
[string] $ResourceGroupName,
[Parameter(Mandatory = $true, HelpMessage = "DNS zone name.")]
[string] $ZoneName,
[Parameter(Mandatory = $true, HelpMessage = "DNS record name.")]
[string] $Name,
[Parameter(Mandatory = $true, HelpMessage = "Type of record.")]
[string] $RecordType,
[Parameter(Mandatory = $true, HelpMessage = "Record value.")]
[string] $DnsRecordConfigValue,
[Parameter(Mandatory = $false, HelpMessage = "Ttl value.")]
[int] $TTL = 3600
)
{
# Create storage account
if (($RecordType -ieq "A") -or ($RecordType -ieq "CNAME")){
Write-Host "Check if DNS record of type ($RecordType) with name ($Name) already exists."
$ErrorActionPreference = "SilentlyContinue";
$recordSet = Get-AzureRmDnsRecordSet -Name $Name `
-RecordType $RecordType `
-ZoneName $ZoneName `
-ResourceGroupName $ResourceGroupName `
-ErrorVariable recordExistError
$ErrorActionPreference = "Continue"; #Turning errors back on
if ($recordSet) {
Write-Host "DNS record already exists. Updating DNS record of type ($RecordType) with name ($Name) under DNS zone ($ZoneName)."
switch ($RecordType) {
"A" {
$recordSet.Records[0].Ipv4Address = $DnsRecordConfigValue
Set-AzureRmDnsRecordSet -RecordSet $recordSet | Out-Null
break
}
"CNAME" {
$recordSet.Records[0].Cname = $DnsRecordConfigValue
Set-AzureRmDnsRecordSet -RecordSet $recordSet | Out-Null
break
}
}
}
else {
Write-Host "DNS record does not exist. Creating DNS record of type ($RecordType) with name ($Name) under DNS zone ($ZoneName)."
switch ($RecordType) {
"A" {
New-AzureRmDnsRecordSet -Name $Name `
-RecordType $RecordType `
-ZoneName $ZoneName `
-ResourceGroupName $ResourceGroupName `
-Ttl $TTL `
-DnsRecords (New-AzureRmDnsRecordConfig -IPv4Address $DnsRecordConfigValue) | Out-Null
break
}
"CNAME" {
New-AzureRmDnsRecordSet -Name $Name `
-RecordType $RecordType `
-ZoneName $ZoneName `
-ResourceGroupName $ResourceGroupName `
-Ttl $TTL `
-DnsRecords (New-AzureRmDnsRecordConfig -Cname $DnsRecordConfigValue) | Out-Null
break
}
}
}

$ErrorActionPreference = "SilentlyContinue";
$newRecordSet = Get-AzureRmDnsRecordSet -Name $Name `
-RecordType $RecordType `
-ZoneName $ZoneName `
-ResourceGroupName $ResourceGroupName `
-ErrorVariable recordExistError
$ErrorActionPreference = "Continue"; #Turning errors back on
if (-not $newRecordSet) {
throw "Create/update of DNS zone record ($Name) under DNS zone ($ZoneName) failed."
}
Write-Host "DNS record ($Name) updated successfully."
}
else {
throw "Creation of DNS record type ($RecordType) not supported."
}
}

<#
.Synopsis
Create a storage account under given resource group
Expand Down
6 changes: 6 additions & 0 deletions registry/diagnosis/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
VERSION ?= dev

# Usage: VERSION=1.2.3 make release
.PHONY: release
release:
./scripts/release.sh ${VERSION}
8 changes: 8 additions & 0 deletions registry/diagnosis/scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

VERSION=$1

dos2unix *.sh
mkdir -p _out
tar -czf _out/registry-diagnosis-v${VERSION}.tar.gz *.sh
zip -q _out/registry-diagnosis-v${VERSION}.zip *.sh
2 changes: 1 addition & 1 deletion registry/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://gallery.azure.com/schemas/2015-10-01/manifest.json#",
"name": "AzureStackDockerContainerRegistry",
"name": "AzureStackContainerRegistry",
"publisher": "Microsoft",
"version": "1.0.1",
"displayName": "ms-resource:displayName",
Expand Down

0 comments on commit e71afc1

Please sign in to comment.