bedrock-cli/smoke-test-pipeline.yml

255 строки
9.7 KiB
YAML

trigger: none
schedules:
- cron: "0 0,1,17,18,19,20,21,22,23 * * Mon-Fri"
branches:
include: [master]
displayName: M-F 9:00AM to 5:00pm Hourly (UTC - 8:00) PST Builds
# Uncomment below if we want builds to run when the code has NOT changed
#always: true
variables:
skipComponentGovernanceDetection: "true"
stages:
- stage: integration_tests
jobs:
- job: introspection_onboard_integration_test
variables:
- group: "bedrock-cli-vg"
pool:
vmImage: "Ubuntu 16.04"
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: "specific"
project: $(BEDROCK_CLI_PROJECT_ID)
definition: $(BEDROCK_CLI_DEFINITION_ID)
buildVersionToDownload: "latestFromBranch"
branchName: "refs/heads/master"
itemPattern: "bedrock*"
artifactName: "bedrock_linux_node_12"
targetPath: "$(System.DefaultWorkingDirectory)"
- bash: |
shopt -s expand_aliases
echo "Current Dir is $(pwd)"
chmod +x bedrock-linux
alias bedrock="$(pwd)/bedrock-linux"
bedrock --version
displayName: "Verify Bedrock CLI downloaded and executable"
failOnStderr: true
- bash: |
echo "FUNC_SCRIPT: $FUNC_SCRIPT"
curl --fail $FUNC_SCRIPT > functions.sh
if [ $? -ne 0 ]; then
echo "Error finding FUNC_SCRIPT: $FUNC_SCRIPT"
exit 1
fi
chmod +x ./functions.sh
echo "TEST_SCRIPT3: $TEST_SCRIPT3"
curl --fail $TEST_SCRIPT3 > introspection-validations.sh
if [ $? -ne 0 ]; then
echo "Error finding TEST_SCRIPT3: $TEST_SCRIPT3"
exit 1
fi
chmod +x ./introspection-validations.sh
displayName: "Download integration test scripts"
env:
FUNC_SCRIPT: $(FUNC_SCRIPT)
TEST_SCRIPT: $(TEST_SCRIPT)
- bash: |
# Install the extension
export AZURE_DEVOPS_EXT_PAT=$(AZDO_PAT)
az extension add --name azure-devops
# Login to Azure
echo "az login --service-principal --username $(SP_APP_ID) --password $(SP_PASS) --tenant $(SP_TENANT)"
az login --service-principal --username "$(SP_APP_ID)" --password "$(SP_PASS)" --tenant "$(SP_TENANT)"
# Step up git identity
git config --global user.email "me@microsoft.com"
git config --global user.name "Service Account"
# Set ENV VARs
export BEDROCK_CLI_LOCATION="$(pwd)/bedrock-linux"
export ACCESS_TOKEN_SECRET=$(AZDO_PAT)
export SP_PASS=$(SP_PASS)
export SP_TENANT=$(SP_TENANT)
# Include dependent scripts
. ./functions.sh
# Run the test
bash ./introspection-validations.sh
# Get exit status
status=$?
[ $status -eq 0 ] && echo "Test Done!" || (echo "Test had issues" && exit 1)
displayName: "Run Introspection onboard Validation Tests"
timeoutInMinutes: 15
- job: rings_integration_tests
variables:
- group: "bedrock-cli-vg"
pool:
vmImage: "Ubuntu 16.04"
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: "specific"
project: $(BEDROCK_CLI_PROJECT_ID)
definition: $(BEDROCK_CLI_DEFINITION_ID)
buildVersionToDownload: "latestFromBranch"
branchName: "refs/heads/master"
itemPattern: "bedrock*"
artifactName: "bedrock_linux_node_12"
targetPath: "$(System.DefaultWorkingDirectory)"
- bash: |
shopt -s expand_aliases
echo "Current Dir is $(pwd)"
chmod +x bedrock-linux
alias bedrock="$(pwd)/bedrock-linux"
bedrock --version
displayName: "Verify BEDROCK_CLI downloaded and executable"
failOnStderr: true
- bash: |
echo "FUNC_SCRIPT: $FUNC_SCRIPT"
curl --fail $FUNC_SCRIPT > functions.sh
if [ $? -ne 0 ]; then
echo "Error finding FUNC_SCRIPT: $FUNC_SCRIPT"
exit 1
fi
chmod +x ./functions.sh
echo "TEST_SCRIPT: $TEST_SCRIPT"
curl --fail $TEST_SCRIPT > validations.sh
if [ $? -ne 0 ]; then
echo "Error finding TEST_SCRIPT: $TEST_SCRIPT"
exit 1
fi
chmod +x ./validations.sh
displayName: "Download integration test scripts"
env:
FUNC_SCRIPT: $(FUNC_SCRIPT)
TEST_SCRIPT: $(TEST_SCRIPT)
- bash: |
# Install the extension
export AZURE_DEVOPS_EXT_PAT=$(AZDO_PAT)
az extension add --name azure-devops
# Login to Azure
echo "az login --service-principal --username $(SP_APP_ID) --password $(SP_PASS) --tenant $(SP_TENANT)"
az login --service-principal --username "$(SP_APP_ID)" --password "$(SP_PASS)" --tenant "$(SP_TENANT)"
# Step up git identity
git config --global user.email "me@microsoft.com"
git config --global user.name "Service Account"
# Set ENV VARs
export BEDROCK_CLI_LOCATION="$(pwd)/bedrock-linux"
export ACCESS_TOKEN_SECRET=$(AZDO_PAT)
export SP_PASS=$(SP_PASS)
export SP_TENANT=$(SP_TENANT)
# Include dependent scripts
. ./functions.sh
mkdir helm-artifacts
cp ./tests/helm-artifacts/* helm-artifacts
# Run the test
bash ./validations.sh
# Get exit status
status=$?
[ $status -eq 0 ] && echo "Test Done!" || (echo "Test had issues" && exit 1)
displayName: "Run Validation Tests"
timeoutInMinutes: 25
- task: PublishPipelineArtifact@1
inputs:
path: $(System.DefaultWorkingDirectory)/bedrock-env/log.txt
artifact: test_logs
condition: always()
- job: infra_integration_tests
variables:
- group: "bedrock-cli-vg-infra"
pool:
vmImage: "Ubuntu 16.04"
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: "specific"
project: $(BEDROCK_CLI_PROJECT_ID)
definition: $(BEDROCK_CLI_DEFINITION_ID)
buildVersionToDownload: "latestFromBranch"
branchName: "refs/heads/master"
itemPattern: "bedrock*"
artifactName: "bedrock_linux_node_12"
targetPath: "$(System.DefaultWorkingDirectory)"
- bash: |
shopt -s expand_aliases
echo "Current Dir is $(pwd)"
chmod +x bedrock-linux
alias bedrock="$(pwd)/bedrock-linux"
bedrock --version
displayName: "Verify Bedrock CLI downloaded and executable"
failOnStderr: true
- bash: |
echo "FUNC_SCRIPT: $FUNC_SCRIPT"
curl $FUNC_SCRIPT > functions.sh
if [ $? -ne 0 ]; then
echo "Error finding FUNC_SCRIPT: $FUNC_SCRIPT"
exit 1
fi
chmod +x ./functions.sh
echo "TEST_SCRIPT2: $TEST_SCRIPT2"
curl $TEST_SCRIPT2 > infra-validations.sh
if [ $? -ne 0 ]; then
echo "Error finding TEST_SCRIPT2: $TEST_SCRIPT2"
exit 1
fi
chmod +x ./infra-validations.sh
echo "INFRA_YML: $INFRA_YML"
curl $INFRA_YML > infra-generation-pipeline.yml
if [ $? -ne 0 ]; then
echo "Error finding INFRA_YML: $INFRA_YML"
exit 1
fi
chmod +x ./infra-validations.sh
displayName: "Download integration test scripts"
env:
FUNC_SCRIPT: $(FUNC_SCRIPT)
TEST_SCRIPT2: $(TEST_SCRIPT2)
- bash: |
# Install the extension
export AZURE_DEVOPS_EXT_PAT=$(AZDO_PAT)
az extension add --name azure-devops
# Login to Azure
echo "az login --service-principal --username $(SP_APP_ID) --password $(SP_PASS) --tenant $(SP_TENANT)"
az login --service-principal --username "$(SP_APP_ID)" --password "$(SP_PASS)" --tenant "$(SP_TENANT)"
# Step up git identity
git config --global user.email "me@microsoft.com"
git config --global user.name "Service Account"
# Set ENV VARs
export BEDROCK_CLI_LOCATION="$(pwd)/bedrock-linux"
export ACCESS_TOKEN_SECRET=$(AZDO_PAT)
export SP_PASS=$(SP_PASS)
export SP_TENANT=$(SP_TENANT)
# Include dependent scripts
. ./functions.sh
# Run the infra test
bash ./infra-validations.sh
# Get exit status
status=$?
[ $status -eq 0 ] && echo "Infra Test Done!" || (echo "Infra Test had issues" && exit 1)
displayName: "Run Infra Validation Tests"
timeoutInMinutes: 15
- task: PublishPipelineArtifact@1
inputs:
path: $(System.DefaultWorkingDirectory)/bedrock-env/log.txt
artifact: infra_test_logs
condition: always()