-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #230 from Azure/azure-ipam-dod
Azure IPAM Release v3.0.0
- Loading branch information
Showing
77 changed files
with
3,420 additions
and
1,603 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
# All Values Required | ||
AZURE_ENV=<AZURE CLOUD ENVIRONMENT> | ||
ENGINE_APP_ID=<ENGINE SERVICE PRINCIPAL CLIENT ID> | ||
ENGINE_APP_SECRET=<ENGINE SERVICE PRINCIPAL SECRET> | ||
UI_APP_ID=<UI SERVICE PRINCIPAL CLIENT ID> | ||
ENGINE_APP_ID=<ENGINE APP REGISTRATION CLIENT ID> | ||
ENGINE_APP_SECRET=<ENGINE APP REGISTRATION SECRET> | ||
UI_APP_ID=<UI APP REGISTRATION CLIENT ID> | ||
TENANT_ID=<AZURE AD TENANT ID> | ||
COSMOS_URL=https://<COSMOS NAME>.documents.azure.com | ||
COSMOS_KEY=<COSMOS ACCESS KEY> | ||
KEYVAULT_URL=https://<KEYVAULT NAME>.vault.azure.net | ||
|
||
# Legacy Values | ||
# COSMOS_KEY=<COSMOS ACCESS KEY> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,18 +8,116 @@ on: | |
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
contents: write | ||
pull-requests: read | ||
|
||
env: | ||
ACR_NAME: ${{ vars.IPAM_PROD_ACR }} | ||
|
||
jobs: | ||
deploy: | ||
name: Update Azure IPAM Containers | ||
version: | ||
name: Update Azure IPAM Version | ||
runs-on: ubuntu-latest | ||
outputs: | ||
ipamVersion: ${{ steps.updateVersion.outputs.ipamVersion }} | ||
steps: | ||
- run: echo "Job triggered by a ${{ github.event_name }} event to main." | ||
|
||
- name: Checkout Azure IPAM Code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/github-script@v7 | ||
id: getPullRequestData | ||
with: | ||
script: | | ||
return ( | ||
await github.rest.repos.listPullRequestsAssociatedWithCommit({ | ||
commit_sha: context.sha, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
}) | ||
).data[0]; | ||
- name: "Increment Azure IPAM Version" | ||
id: updateVersion | ||
working-directory: tools | ||
env: | ||
prBody: ${{ fromJson(steps.getPullRequestData.outputs.result).body }} | ||
shell: pwsh | ||
run: | | ||
$version = [regex]::matches($env:prBody, '(?<=\[version:).*(?=])').value | ||
$major = $env:prBody -match '(?<=\[)major(?=])' | ||
$minor = $env:prBody -match '(?<=\[)minor(?=])' | ||
$build = $env:prBody -match '(?<=\[)build(?=])' | ||
try { | ||
$version = [System.Version]$version | ||
$newVersion = "{0}.{1}.{2}" -f $version.Major, $version.Minor, $version.Build | ||
} catch { | ||
$version = $null | ||
} | ||
if ($version) { | ||
./version.ps1 -Version $newVersion | ||
} else if ($major) { | ||
./version.ps1 -BumpMajor | ||
} else if ($minor) { | ||
./version.ps1 -BumpMinor | ||
} else { | ||
./version.ps1 -BumpBuild | ||
} | ||
- name: "Create Azure IPAM ZIP Asset" | ||
id: buildZipAsset | ||
working-directory: tools | ||
shell: pwsh | ||
run: | | ||
./build.ps1 -Path ../assets/ | ||
- name: Commit Updated Azure IPAM Code | ||
id: commitCode | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
git commit -a -m "Updated Azure IPAM Version" | ||
git push | ||
release: | ||
name: Create Azure IPAM Release | ||
runs-on: ubuntu-latest | ||
needs: [ version ] | ||
steps: | ||
- name: Checkout Azure IPAM Code | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
assets | ||
- name: Publish Azure IPAM Release | ||
id: publishRelease | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
tagName: v${{ needs.version.outputs.ipamVersion }} | ||
run: | | ||
gh release create "$tagName" \ | ||
--repo="$GITHUB_REPOSITORY" \ | ||
--title="$tagName" \ | ||
--notes "Azure IPAM Release" | ||
- name: Upload Azure IPAM Release Asset | ||
id: uploadReleaseAsset | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
tagName: v${{ needs.version.outputs.ipamVersion }} | ||
assetPath: ./assets/ipam.zip | ||
run: | | ||
gh release upload "$tagName" "$assetPath" | ||
update: | ||
name: Update Azure IPAM Containers | ||
runs-on: ubuntu-latest | ||
needs: [ version, release ] | ||
steps: | ||
- name: Azure login | ||
uses: azure/login@v1 | ||
with: | ||
|
@@ -29,26 +127,21 @@ jobs: | |
enable-AzPSSession: true | ||
|
||
- name: Checkout Azure IPAM Code | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
engine | ||
ui | ||
lb | ||
- name: "Upload Azure IPAM Version" | ||
id: updateVersion | ||
shell: pwsh | ||
run: | | ||
$newVersion = "latest" | ||
Write-Output "ipamVersion=$newVersion" >> $Env:GITHUB_OUTPUT | ||
- name: Build Azure IPAM Containers | ||
env: | ||
IPAM_VERSION: ${{ steps.updateVersion.outputs.ipamVersion }} | ||
IPAM_VERSION: ${{ needs.version.outputs.ipamVersion }} | ||
run: | | ||
az acr build -r $ACR_NAME -t ipam-engine:$IPAM_VERSION -f ./engine/Dockerfile.deb ./engine | ||
az acr build -r $ACR_NAME -t ipam-func:$IPAM_VERSION -f ./engine/Dockerfile.func ./engine | ||
az acr build -r $ACR_NAME -t ipam-ui:$IPAM_VERSION -f ./ui/Dockerfile.deb ./ui | ||
az acr build -r $ACR_NAME -t ipam-lb:$IPAM_VERSION -f ./lb/Dockerfile ./lb | ||
az acr build -r $ACR_NAME -t ipam:$IPAM_VERSION -t ipam:latest -f ./Dockerfile.deb . | ||
az acr build -r $ACR_NAME -t ipamfunc:$IPAM_VERSION -t ipamfunc:latest -f ./Dockerfile.func . | ||
az acr build -r $ACR_NAME -t ipam-engine:$IPAM_VERSION -t ipam-engine:latest -f ./engine/Dockerfile.deb ./engine | ||
az acr build -r $ACR_NAME -t ipam-func:$IPAM_VERSION -t ipam-func:latest -f ./engine/Dockerfile.func ./engine | ||
az acr build -r $ACR_NAME -t ipam-ui:$IPAM_VERSION -t ipam-ui:latest -f ./ui/Dockerfile.deb ./ui | ||
az acr build -r $ACR_NAME -t ipam-lb:$IPAM_VERSION -t ipam-lb:latest -f ./lb/Dockerfile ./lb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,3 @@ | |
NOTES.md | ||
TODO.md | ||
/logs | ||
/deployV2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.