зеркало из
1
0
Форкнуть 0
- Disables the github workflow for infrastructures
- Adds an ADO pipeline
- Current code is just a dummy pipeline test
This commit is contained in:
Sushil Kumar 2022-06-23 16:09:38 -07:00 коммит произвёл GitHub
Родитель fb6c234734
Коммит 4eb6984687
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 56 добавлений и 74 удалений

74
.github/workflows/run-setup-script.yml поставляемый
Просмотреть файл

@ -1,74 +0,0 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
name: Azure ARM
on:
push:
# Runs tests for pushes to main branch.
branches:
- '*'
# Runs tests for any PRs.
pull_request:
branches:
- '*'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# Checkout code
- uses: actions/checkout@main
# Log into Azure
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Setup environment
id: vars
shell: bash
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
MD5_OUTPUT="$(echo $(date +%s) | md5sum | awk '{print $1}')"
echo "::set-output name=ENV_CODE::$(echo pr${MD5_OUTPUT:0:7})"
- name: Install Azure Infrastructure
run: |
chars='@#$%&_+='
export POSTGRES_ADMIN_LOGIN_PASS=$({ </dev/urandom LC_ALL=C grep -ao '[A-Za-z0-9]' | head -n$((RANDOM % 8 + 9)); echo ${chars:$((RANDOM % ${#chars})):1}; } | shuf | tr -d '\n')
./deploy/setup.sh ${{ steps.vars.outputs.ENV_CODE }} eastus custom-vision-model-v2 ${{ steps.vars.outputs.ENV_CODE }}-environment ${{ secrets.CI_BATCH_ACCOUNT_NAME }}
shell: bash
- name: Grant Admin role for synapse workspace to github service-principal and AAD group
run: |
# Granting role to principal-id for github workflow
az synapse role assignment create --workspace-name ${{ steps.vars.outputs.ENV_CODE }}-pipeline-syn-ws --role "Synapse Administrator" --assignee $(az account show --query 'user.name' -o tsv)
# Granting role to principal-id for AAD group
if [[ ! -z ${{ secrets.AAD_GROUP_PRINCIPAL_ID }} ]]; then
az synapse role assignment create --workspace-name ${{ steps.vars.outputs.ENV_CODE }}-pipeline-syn-ws --role "Synapse Administrator" --assignee ${{ secrets.AAD_GROUP_PRINCIPAL_ID }}
fi
shell: bash
- name: Execute pipeline
run: BATCH_ACCOUNT_NAME=${{ secrets.CI_BATCH_ACCOUNT_NAME }} SOURCE_STORAGE_ACCOUNT_NAME=${{ secrets.CI_STORAGE_ACCOUNT }} ./test/deploy-prepare-and-test-pipeline.sh ${{ steps.vars.outputs.ENV_CODE }}
shell: bash
outputs:
ENV_CODE: ${{ steps.vars.outputs.ENV_CODE }}
cleanup:
runs-on: ubuntu-latest
needs: build-and-deploy
if: always()
steps:
# Checkout code
- uses: actions/checkout@main
# Log into Azure
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Cleanup the resources
run: ./deploy/cleanup.sh "${{ needs.build-and-deploy.outputs.ENV_CODE }}" ${{ secrets.CI_BATCH_ACCOUNT_NAME }}
shell: bash

Просмотреть файл

@ -0,0 +1,56 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
name: $(Date:yyyyMMdd)$(Rev:.r)
parameters:
- name: KEYVAULT_NAME
displayName: Keyvault Name
type: string
default: cipipelineresources
variables:
- name: serviceConnectionToAzure
value: 'github-az-creds'
pr:
branches:
include:
- main
- releases/*
paths:
exclude:
- '*.md'
- docs
- deploy/README.md
trigger:
batch: true
branches:
include:
- '*'
paths:
exclude:
- '*.md'
- docs
- deploy/README.md
pool:
vmImage: ubuntu-latest
jobs:
- job: RunE2ETest
displayName: "Deploy Infrastructure and run Synapse Pipeline"
timeoutInMinutes: 300
steps:
- task: AzureCLI@1
inputs:
azureSubscription: '$(serviceConnectionToAzure)'
scriptLocation: inlineScript
inlineScript: |
set -ex
echo This is a sample test!!!
az vm list --output table
echo Test ran successfully!!!
addSpnToEnvironment: true
useGlobalConfig: true