-
Notifications
You must be signed in to change notification settings - Fork 2
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 #140 from adamrushuk/develop
v1.1.0 release
- Loading branch information
Showing
28 changed files
with
353 additions
and
227 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,5 +1,5 @@ | ||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions | ||
name: Build env | ||
name: Build environment | ||
|
||
# name of GitHub event that triggers workflow | ||
# https://help.github.com/en/actions/reference/events-that-trigger-workflows#watch-event-watch | ||
|
@@ -44,7 +44,6 @@ env: | |
EMAIL_ADDRESS: [email protected] | ||
ENABLE_TLS_INGRESS: true | ||
FORCE_TEST_FAIL: false | ||
HAS_SUBDOMAIN: true | ||
K8S_TLS_SECRET_NAME: tls-secret | ||
KEY_VAULT_NAME: kv-rush-iz6y | ||
KEY_VAULT_CERT_NAME: wildcard-thehypepipe-co-uk | ||
|
@@ -107,6 +106,12 @@ jobs: | |
- name: Login to Azure | ||
run: ./scripts/azure_login.sh | ||
|
||
# This is required when developing after the initial build, and the AKS cluster may have been stopped | ||
# Ensure AKS cluster is running, else timeouts will occur on k8s Terraform apply tasks | ||
- name: Start AKS Cluster | ||
continue-on-error: true | ||
run: ./scripts/start_aks_cluster.sh | ||
|
||
|
||
# Prereqs | ||
- name: Create Storage Account for Terraform state | ||
|
@@ -209,15 +214,23 @@ jobs: | |
run: ./scripts/push_docker_images.sh | ||
|
||
|
||
# TODO: Remove once issue has been fixed | ||
# https://github.com/terraform-providers/terraform-provider-azurerm/issues/8546 | ||
- name: Restart Function App | ||
run: az functionapp restart --name "${{ env.PREFIX }}-funcapp" --resource-group "${{ env.PREFIX }}-rg-function-app" | ||
|
||
|
||
# Pester tests | ||
- name: Run Pester tests | ||
continue-on-error: true | ||
run: pwsh -command "./scripts/Start-Test.ps1" | ||
|
||
- name: Archive test artifacts | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: test results | ||
path: test/pester-test-results.xml | ||
# TODO: only run when previous task (Pester tests) has been successful | ||
if: always() | ||
|
||
# remove NuGet proxy repo so pester report step doesnt fail | ||
|
@@ -226,6 +239,8 @@ jobs: | |
|
||
# Shows at the bottom of a run: https://github.com/adamrushuk/aks-nexus-velero/runs/1035347513?check_suite_focus=true | ||
- name: Pester report | ||
# TODO: remove continue-on-error once bug is fixed | ||
continue-on-error: true | ||
uses: zyborg/[email protected] | ||
with: | ||
test_results_path: test/pester-test-results.xml | ||
|
@@ -237,11 +252,9 @@ jobs: | |
# Notify | ||
- name: Notify slack | ||
env: | ||
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }} | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
uses: pullreminders/[email protected] | ||
with: | ||
# env var concatenation not supported atm, so hard-code messages | ||
args: '{\"channel\":\"C012ZQHT9A4\",\"text\":\"[aks-nexus-velero] Build complete\"}' | ||
run: ./scripts/send_slack_message.sh "[aks-nexus-velero] Build complete" | ||
|
||
|
||
# used for any windows-only tasks | ||
|
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 |
---|---|---|
|
@@ -37,7 +37,6 @@ env: | |
EMAIL_ADDRESS: [email protected] | ||
ENABLE_TLS_INGRESS: true | ||
FORCE_TEST_FAIL: false | ||
HAS_SUBDOMAIN: true | ||
K8S_TLS_SECRET_NAME: tls-secret | ||
KEY_VAULT_NAME: kv-rush-iz6y | ||
KEY_VAULT_CERT_NAME: wildcard-thehypepipe-co-uk | ||
|
@@ -68,6 +67,8 @@ jobs: | |
|
||
steps: | ||
# Checkout | ||
# Reference the major version of a release | ||
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#example-using-versioned-actions | ||
- uses: actions/checkout@v2 | ||
# specify different branch | ||
# NOT required as I've changed the default branch to develop | ||
|
@@ -92,23 +93,13 @@ jobs: | |
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
|
||
# # Trigger workflow via Repository Dispatch | ||
# - name: Trigger start_aks_vmss Workflow | ||
# uses: peter-evans/repository-dispatch@v1 | ||
# with: | ||
# token: ${{ secrets.REPO_ACCESS_TOKEN }} | ||
# repository: adamrushuk/aks-nexus-velero | ||
# event-type: start_vmss | ||
# client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' | ||
|
||
# Login | ||
- name: Login to Azure | ||
run: ./scripts/azure_login.sh | ||
|
||
# Ensure VMSS is started, else timeouts will occur on k8s Terraform resource destroy tasks | ||
- name: Start AKS VMSS | ||
run: ./scripts/start_aks_vmss.sh | ||
|
||
# Ensure AKS cluster is running, else timeouts will occur on k8s Terraform resource destroy tasks | ||
- name: Start AKS Cluster | ||
run: ./scripts/start_aks_cluster.sh | ||
|
||
# Prereqs | ||
- name: Lookup Storage Key | ||
|
@@ -122,28 +113,24 @@ jobs: | |
- name: Create zip file of Function App | ||
run: pwsh -command "./function_app/CreateFunctionAppZip.ps1" | ||
|
||
|
||
# Terraform | ||
- uses: hashicorp/setup-terraform@v1 | ||
with: | ||
terraform_version: ${{ env.TF_VERSION }} | ||
|
||
- name: Terraform destroy | ||
run: | | ||
terraform init | ||
terraform destroy -no-color -auto-approve | ||
working-directory: ${{ env.TF_WORKING_DIR }} | ||
|
||
|
||
# Cleanup | ||
- name: Delete Storage | ||
run: ./scripts/storage_delete.sh | ||
|
||
|
||
# Notify | ||
- name: Notify slack | ||
env: | ||
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }} | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
uses: pullreminders/[email protected] | ||
with: | ||
# env var concatenation not supported atm, so hard-code messages | ||
args: '{\"channel\":\"C012ZQHT9A4\",\"text\":\"[aks-nexus-velero] Destroy complete\"}' | ||
run: ./scripts/send_slack_message.sh "[aks-nexus-velero] Destroy complete" |
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,9 +1,9 @@ | ||
name: Start AKS VMSS | ||
name: Start AKS Cluster | ||
|
||
on: | ||
repository_dispatch: | ||
# name of GitHub event that triggers workflow | ||
types: [start_vmss] | ||
types: [start_aks_cluster] | ||
|
||
# enable manual workflow | ||
# https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#manually-running-a-workflow | ||
|
@@ -25,7 +25,7 @@ env: | |
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} | ||
|
||
jobs: | ||
start_vmss: | ||
start_aks_cluster: | ||
runs-on: ubuntu-18.04 | ||
|
||
# only run if owner triggered action | ||
|
@@ -46,25 +46,18 @@ jobs: | |
echo "AKS_RG_NAME=${{ env.PREFIX }}-rg-aks-dev-001" >> $GITHUB_ENV | ||
echo "AKS_CLUSTER_NAME=${{ env.PREFIX }}-aks-001" >> $GITHUB_ENV | ||
# Show event info | ||
- name: Show triggered event data | ||
run: pwsh -command "./scripts/Get-EventData.ps1" | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
|
||
# Login | ||
- name: Login to Azure | ||
run: ./scripts/azure_login.sh | ||
|
||
# Start | ||
- name: Start AKS VMSS | ||
run: ./scripts/start_aks_vmss.sh | ||
# Prereqs: https://docs.microsoft.com/en-us/azure/aks/start-stop-cluster | ||
- name: Start AKS Cluster | ||
run: ./scripts/start_aks_cluster.sh | ||
|
||
# Notify | ||
- name: Notify slack | ||
env: | ||
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }} | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
uses: pullreminders/[email protected] | ||
with: | ||
# env var concatenation not supported atm, so hard-code messages | ||
args: '{\"channel\":\"C012ZQHT9A4\",\"text\":\"[aks-nexus-velero] Start AKS VMSS complete\"}' | ||
run: ./scripts/send_slack_message.sh "[aks-nexus-velero] Start AKS Cluster complete" |
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,9 +1,9 @@ | ||
name: Deallocate AKS VMSS | ||
name: Stop AKS Cluster | ||
|
||
on: | ||
repository_dispatch: | ||
# name of GitHub event that triggers workflow | ||
types: [deallocate_vmss] | ||
types: [stop_aks_cluster] | ||
|
||
# enable manual workflow | ||
# https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#manually-running-a-workflow | ||
|
@@ -25,7 +25,7 @@ env: | |
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} | ||
|
||
jobs: | ||
deallocate_vmss: | ||
stop_aks_cluster: | ||
runs-on: ubuntu-18.04 | ||
|
||
# only run if owner triggered action | ||
|
@@ -45,25 +45,19 @@ jobs: | |
chmod -R +x ./scripts/ | ||
echo "AKS_RG_NAME=${{ env.PREFIX }}-rg-aks-dev-001" >> $GITHUB_ENV | ||
echo "AKS_CLUSTER_NAME=${{ env.PREFIX }}-aks-001" >> $GITHUB_ENV | ||
# Show event info | ||
- name: Show triggered event data | ||
run: pwsh -command "./scripts/Get-EventData.ps1" | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
# Login | ||
- name: Login to Azure | ||
run: ./scripts/azure_login.sh | ||
|
||
# Deallocate | ||
- name: Deallocate AKS VMSS | ||
run: ./scripts/deallocate_aks_vmss.sh | ||
# Stop | ||
# Prereqs: https://docs.microsoft.com/en-us/azure/aks/start-stop-cluster | ||
- name: Stop AKS Cluster | ||
run: ./scripts/stop_aks_cluster.sh | ||
|
||
# Notify | ||
- name: Notify slack | ||
env: | ||
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }} | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
uses: pullreminders/[email protected] | ||
with: | ||
# env var concatenation not supported atm, so hard-code messages | ||
args: '{\"channel\":\"C012ZQHT9A4\",\"text\":\"[aks-nexus-velero] Deallocate AKS VMSS complete\"}' | ||
run: ./scripts/send_slack_message.sh "[aks-nexus-velero] Stop AKS Cluster complete" |
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 |
---|---|---|
|
@@ -84,8 +84,6 @@ jobs: | |
# Notify | ||
- name: Notify slack | ||
env: | ||
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }} | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
uses: pullreminders/[email protected] | ||
with: | ||
# env var concatenation not supported atm, so hard-code messages | ||
args: '{\"channel\":\"C012ZQHT9A4\",\"text\":\"[aks-nexus-velero] Test notification\"}' | ||
run: ./scripts/send_slack_message.sh "[aks-nexus-velero] Test notification" |
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
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
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
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
Oops, something went wrong.