Skip to content

Point to longevity basic nginxaas deployment #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/azure-pipeline-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '14'
node-version: '20'

- name: Install dependencies and build
run: |
Expand All @@ -27,10 +27,11 @@ jobs:

- name: Create extension
run: |
tfx extension create --manifest-globs ./azure-pipeline/vss-extension.json
cd azure-pipeline
tfx extension create --manifest-globs ./vss-extension.json

- name: Upload VSIX file
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: VSIX file
path: ./azure-pipeline/*.vsix
30 changes: 15 additions & 15 deletions .github/workflows/github-action-test-nginxaas-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

name: Test Github action to update NGINX as a Service (NGINXaaS) for Azure configurations
on:
workflow_dispatch:
schedule:
- cron: "0 20 * * *"

env:
NGINX_DEPLOYMENT_NAME: github-action-test-dep
NGINX_DEPLOYMENT_NAME: n4a-long-eastus2-basic-ngx
NGINX_TRANSFORMED_CONFIG_DIR_PATH: /etc/nginx/
NGINX_ROOT_CONFIG_FILE: nginx.conf
TEST_RESOURCE_GROUP_NAME: github-action-test
NGINX_CERT_NAME: github-action-test-crt
TEST_RESOURCE_GROUP_NAME: n4a-long-eastus2-workload
NGINX_CERT_NAME: n4a-long-eastus2-basic-crt
NGINX_VAULT_NAME: nlbtest-customer

permissions:
Expand All @@ -22,13 +23,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "AZ CLI Login"
uses: azure/login@v2
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change it back after get approval

with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
run: |
az login --service-principal \
--username "${{ secrets.AZURE_CLIENT_ID }}" \
--password "${{ secrets.AZURE_CLIENT_SECRET }}" \
--tenant "${{ secrets.AZURE_TENANT_ID }}"

- name: "Update config - single file"
shell: bash
Expand All @@ -47,7 +48,7 @@ jobs:
- name: "Validate config update - single file"
shell: bash
run: |
curl -s -o /dev/null -D - http://${{ secrets.NGINX_DEPLOYMENT_IP }} | grep "Github-Run-Id: $GITHUB_RUN_ID"
curl -s -o /dev/null -D - http://${{ secrets.NGINX_DEPLOYMENT_FQDN }} | grep "Github-Run-Id: $GITHUB_RUN_ID"
- name: "Update config - multi file"
shell: bash
run: |
Expand All @@ -61,21 +62,20 @@ jobs:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resource-group-name: $TEST_RESOURCE_GROUP_NAME
nginx-deployment-name: $NGINX_DEPLOYMENT_NAME
nginx-deployment-location: "westcentralus"
nginx-deployment-location: "eastus2"
nginx-config-directory-path: github-action/test/configs/multi/
nginx-root-config-file: $NGINX_ROOT_CONFIG_FILE
transformed-nginx-config-directory-path: $NGINX_TRANSFORMED_CONFIG_DIR_PATH
nginx-certificates: '[{"certificateName": "$NGINX_CERT_NAME", "keyvaultSecret": "https://$NGINX_VAULT_NAME.vault.azure.net/secrets/$NGINX_CERT_NAME", "certificateVirtualPath": "/etc/nginx/ssl/$GITHUB_RUN_ID/my-cert.crt", "keyVirtualPath": "/etc/nginx/ssl/$GITHUB_RUN_ID/my-cert.key" } ]'

nginx-certificates: '[{"certificateName": "github-action-test-crt", "keyvaultSecret": "https://$NGINX_VAULT_NAME.vault.azure.net/secrets/$NGINX_CERT_NAME", "certificateVirtualPath": "/etc/nginx/ssl/$GITHUB_RUN_ID/my-cert.crt", "keyVirtualPath": "/etc/nginx/ssl/$GITHUB_RUN_ID/my-cert.key" } ]'
- name: "Validate config update"
shell: bash
run: |
curl -s -o /dev/null -D - http://${{ secrets.NGINX_DEPLOYMENT_IP }} | grep "Github-Run-Id: $GITHUB_RUN_ID"
curl -s -o /dev/null -D - http://${{ secrets.NGINX_DEPLOYMENT_FQDN }} | grep "Github-Run-Id: $GITHUB_RUN_ID"
- name: "Validate certificate update"
uses: azure/cli@v2
with:
inlineScript: |
echo "-----BEGIN CERTIFICATE-----" > /tmp/$GITHUB_RUN_ID.tmp
az keyvault certificate show --vault-name $NGINX_VAULT_NAME -n $NGINX_CERT_NAME | jq -r .cer | cat >> /tmp/$GITHUB_RUN_ID.tmp
echo "-----END CERTIFICATE-----" >> /tmp/$GITHUB_RUN_ID.tmp
curl -s -o /dev/null -D - https://${{ secrets.NGINX_DEPLOYMENT_IP }} --cacert /tmp/$GITHUB_RUN_ID.tmp | grep "Github-Run-Id: $GITHUB_RUN_ID"
curl -s -o /dev/null -D - https://${{ secrets.NGINX_DEPLOYMENT_FQDN }} --cacert /tmp/$GITHUB_RUN_ID.tmp | grep "Github-Run-Id: $GITHUB_RUN_ID"
2 changes: 1 addition & 1 deletion azure-pipeline/src/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
}
],
"execution": {
"Node10": {
"Node20_1": {
"target": "dist/index.js"
}
}
Expand Down
2 changes: 1 addition & 1 deletion azure-pipeline/vss-extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"id": "Microsoft.VisualStudio.Services"
}
],
"description": "This extension provides a streamlined solution for synchronizing NGINX configuration files with Azure deployments. Designed to support Azure DevOps pipelines, it automates the process of packaging and uploading NGINX configurations to Azure, enhancing efficiency, version control, and security. Ideal for continuous integration and deployment workflows, it simplifies the management of NGINXaaS configurations within the Azure ecosystem.",
"description": "This extension provides a streamlined solution for synchronizing NGINX configuration files with Azure deployments.",
"categories": [
"Azure Pipelines"
],
Expand Down