Skip to content
Merged
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
4 changes: 3 additions & 1 deletion .pipelines/e2e-step-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ steps:
echo CNI type is $CNI_TYPE
cat '${{ parameters.clusterDefinition }}' | jq --arg cnikey $CNI_TYPE --arg cniurl $CNI_URL '.properties.orchestratorProfile.kubernetesConfig[$cnikey]= $cniurl' > '${{ parameters.clusterDefinition }}'.tmp #
cat '${{ parameters.clusterDefinition }}'.tmp | jq --arg tag $(Tag) '.properties.orchestratorProfile.kubernetesConfig.azureCNIVersion = $tag' > '${{ parameters.clusterDefinition }}'
cat '${{ parameters.clusterDefinition }}' | jq --arg npmimage containernetworking/azure-npm:$(Tag) '.properties.orchestratorProfile.kubernetesConfig.addons[0].containers[0].image = $npmimage' > '${{ parameters.clusterDefinition }}'.tmp
cat '${{ parameters.clusterDefinition }}' | jq --arg npmimage $PULL_CONTAINER_REGISTRY/azure-npm:$(Tag)-test '.properties.orchestratorProfile.kubernetesConfig.addons[0].containers[0].image = $npmimage' > '${{ parameters.clusterDefinition }}'.tmp
mv '${{ parameters.clusterDefinition }}'.tmp '${{ parameters.clusterDefinition }}'
echo "Running E2E tests against a cluster built with the following API model:"
cat '${{ parameters.clusterDefinition }}'
Expand Down Expand Up @@ -101,9 +101,11 @@ steps:
mkdir -p $(Build.ArtifactStagingDirectory)/kube-${{ parameters.name }}
cp -r _output/k*/kubeconfig/kubeconfig.$REGIONS.json $(Build.ArtifactStagingDirectory)/kube-${{ parameters.name }}
cp -r _output/kubernetes-*-ssh $(Build.ArtifactStagingDirectory)/kube-${{ parameters.name }}
cp -r test/e2e/kubernetes/junit.xml $(Build.ArtifactStagingDirectory)/kube-${{ parameters.name }}
name: CopyKubeConfigsAKSEngine
displayName: Save cluster configs
workingDirectory: "$(modulePath)"
condition: always()

- task: PublishBuildArtifacts@1
inputs:
Expand Down
35 changes: 23 additions & 12 deletions .pipelines/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,15 @@ stages:

- script: |
echo "##vso[task.setvariable variable=CommitHash;isOutput=true]$(git rev-parse HEAD)"
echo "##vso[task.setvariable variable=Tag;isOutput=true]$(git describe --tags --always --dirty)"
export BRANCH=$(Build.SourceBranchName)
echo Building branch $BRANCH from $(Build.SourceBranch)
if [[ "$BRANCH" == "master" ]]; then
echo "##vso[task.setvariable variable=Tag;isOutput=true]$(git describe --tags --abbrev=0)"
echo "Set tag to $(git describe --tags --abbrev=0)"
else
echo "##vso[task.setvariable variable=Tag;isOutput=true]$(git describe --tags --always --dirty)"
echo "Set tag to $(git describe --tags --always --dirty)"
fi
workingDirectory: "$(modulePath)"
name: "EnvironmentalVariables"
displayName: "Set build environmental variables"
displayName: "Set environmental variables"
condition: always()

- script: |
Expand All @@ -84,9 +81,9 @@ stages:
export GOOS=linux
make all-binaries VERSION=$(EnvironmentalVariables.Tag)
sudo make azure-npm-image VERSION=$(EnvironmentalVariables.Tag)
echo '$(DOCKER_PASSWORD)' | docker login -u '$(DOCKER_USERNAME)' --password-stdin
docker tag containernetworking.azurecr.io/public/containernetworking/azure-npm:$(EnvironmentalVariables.Tag) containernetworking/azure-npm:$(EnvironmentalVariables.Tag)
docker push containernetworking/azure-npm:$(EnvironmentalVariables.Tag)
echo '$(DOCKER_PASSWORD)' | docker login containernetworking.azurecr.io -u '$(DOCKER_USERNAME)' --password-stdin
docker tag $PUSH_CONTAINER_REGISTRY/azure-npm:$(EnvironmentalVariables.Tag) $PUSH_CONTAINER_REGISTRY/azure-npm:$(EnvironmentalVariables.Tag)-test
docker push $PUSH_CONTAINER_REGISTRY/azure-npm:$(EnvironmentalVariables.Tag)-test
cd output
sudo find . -mindepth 2 -type f -regextype posix-extended ! -iregex '.*\.(zip|tgz)$' -delete
sudo find . -mindepth 2 -type f -print -exec mv {} . \;
Expand Down Expand Up @@ -119,6 +116,21 @@ stages:
displayName: "Generate Coverage Reports"
condition: always()

- script: |
function auto-retry()
{
export i="1"
export attempts="300"
false
while [[ $? -ne 0 ]] && [[ $i -lt $attempts ]]; do
printf "Attempt $i/$attempts - " && "$@" && break || sleep 3 && i=$[$i+1] && false
done
}
auto-retry docker pull mcr.microsoft.com/containernetworking/azure-npm:$(EnvironmentalVariables.Tag)-test
workingDirectory: "$(modulePath)"
name: "mcrreplication"
displayName: "Wait for MCR"

- task: PublishTestResults@2
inputs:
testRunner: JUnit
Expand Down Expand Up @@ -151,6 +163,7 @@ stages:
azureSubscription: $(ARTIFACT_SUBSCRIPTION)
scriptLocation: "inlineScript"
inlineScript: |
echo Creating storage container with name acn-$(EnvironmentalVariables.CommitHash) and account name $(STORAGE_ACCOUNT_NAME)
az storage container create -n acn-$(EnvironmentalVariables.CommitHash) --account-name $(STORAGE_ACCOUNT_NAME) --public-access container
az storage blob upload-batch -d acn-$(EnvironmentalVariables.CommitHash) -s ./output/ --account-name $(STORAGE_ACCOUNT_NAME)
workingDirectory: "$(modulePath)"
Expand Down Expand Up @@ -201,17 +214,15 @@ stages:
demands: agent.os -equals Linux
container:
image: containernetworking/pipeline-ci:1.0.6
variables:
Tag: $[ dependencies.unit_tests.outputs['EnvironmentalVariables.Tag'] ]
condition: always()
steps:
- checkout: none
- task: AzureCLI@1
inputs:
azureSubscription: $(ARTIFACT_SUBSCRIPTION)
scriptLocation: "inlineScript"
inlineScript: |
export CommitHash=(git rev-parse HEAD)
export CommitHash=$(git rev-parse HEAD)
echo Deleting storage container with name acn-$CommitHash and account name $(STORAGE_ACCOUNT_NAME)
az storage container delete -n acn-$CommitHash --account-name $(STORAGE_ACCOUNT_NAME)
workingDirectory: "$(modulePath)"
displayName: Cleanup remote Azure storage container
Expand Down
1 change: 1 addition & 0 deletions cns/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN apt-get update && \
apt-get install -y ca-certificates && \
tar -xvzf azure-cns.tgz && \
rm azure-cns.tgz
RUN apt-get upgrade -y

EXPOSE 10090

Expand Down
1 change: 1 addition & 0 deletions npm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN apt-get update
RUN apt-get install -y iptables
RUN apt-get install -y ipset
RUN apt-get install -y ca-certificates
RUN apt-get upgrade -y

# Install plugin.
COPY $NPM_BUILD_DIR/azure-npm /usr/bin
Expand Down