Skip to content

Commit

Permalink
Fix issue with release scripts (#1509)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthchr authored May 25, 2021
1 parent 5599924 commit 771fa82
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 232 deletions.
41 changes: 21 additions & 20 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,28 +67,28 @@ steps:
- script: |
make validate-copyright-headers
make validate-cainjection-files
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: 'Validate Source'
continueOnError: 'false'
- task: GoTool@0
displayName: Get Go 1.13.7
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
version: '1.13.7'

- task: Go@0
displayName: Get Go dependencies
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
command: 'get'
arguments: '-d'
workingDirectory: '$(System.DefaultWorkingDirectory)'

- task: Bash@3
displayName: Install kubebuilder, kustomize and test dependencies
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
continueOnError: 'false'
inputs:
targetType: 'inline'
Expand All @@ -109,7 +109,7 @@ steps:
export PATH=$PATH:$(go env GOPATH)/bin
make test-unit
displayName: Run unit tests
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
continueOnError: 'false'
env:
GO111MODULE: on
Expand All @@ -124,7 +124,7 @@ steps:
export TEST_APIM_NAME=$(TEST_APIM_NAME)
make test-integration-controllers
displayName: Run envtest tests
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
continueOnError: 'false'
env:
GO111MODULE: on
Expand All @@ -144,7 +144,7 @@ steps:
export KUBEBUILDER_ASSETS=$(go env GOPATH)/kubebuilder/bin
make test-v1-secret-naming
displayName: Run legacy v1 secret naming tests
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
continueOnError: 'false'
env:
GO111MODULE: on
Expand All @@ -163,7 +163,7 @@ steps:
kubectl cluster-info
make install
displayName: Install CRDs into kind cluster
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
continueOnError: 'false'
env:
GO111MODULE: on
Expand All @@ -175,20 +175,20 @@ steps:
export PATH=$PATH:$(go env GOPATH)/bin
make test-process-coverage
displayName: Render Coverage Reports
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
continueOnError: true
workingDirectory: '$(System.DefaultWorkingDirectory)'
- task: PublishCodeCoverageResults@1
displayName: Publish Codecoverage results
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(System.DefaultWorkingDirectory)/reports/merged-coverage.xml

- task: PublishBuildArtifacts@1
displayName: Publish test reports
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
pathtoPublish: '$(System.DefaultWorkingDirectory)/reports'
artifactName: reports
Expand All @@ -204,19 +204,19 @@ steps:

- script: docker build -t $(IMAGE_NAME) .
displayName: Docker build
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
workingDirectory: '$(System.DefaultWorkingDirectory)'

- task: Docker@2
displayName: Login to temporary pipeline ACR
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
containerRegistry: $(PIPELINE_CONTAINER_REGISTRY)
command: 'login'

- task: Docker@2
displayName: Build and Push Docker Image to temporary ACR for validation
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
containerRegistry: $(PIPELINE_CONTAINER_REGISTRY)
repository: '$(IMAGE_NAME)'
Expand Down Expand Up @@ -246,18 +246,18 @@ steps:
workingDirectory: '$(System.DefaultWorkingDirectory)'
failOnStandardError: true
displayName: Deploy to AKS - Find available AKS cluster and connect to it
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))

- script: |
kubectl create namespace cert-manager
kubectl label namespace cert-manager cert-manager.io/disable-validation=true
kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.12.0/cert-manager.yaml
displayName: Deploy to AKS - Install Cert Manager
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: HelmInstaller@1
displayName: Deploy to AKS - Install latest Helm
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
helmVersionToInstall: 'latest'
- script: |
Expand All @@ -266,11 +266,10 @@ steps:
echo $img
sed -i -e 's@azureserviceoperator:latest@azureserviceoperator:'${img}'@' charts/azure-service-operator/values.yaml
displayName: Deploy to AKS - Replace image in values.yaml
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
- task: Bash@3
displayName: Deploy to AKS - Helm Deploy
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
targetType: 'inline'
script: |
Expand Down Expand Up @@ -317,7 +316,7 @@ steps:
workingDirectory: '$(System.DefaultWorkingDirectory)'
failOnStandardError: true
displayName: Deploy to AKS - Clean up deployment and release cluster back to free pool
condition: eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true')
condition: or(eq(variables['check_changes.SOURCE_CODE_CHANGED'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))

- task: Docker@2
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
Expand All @@ -340,6 +339,7 @@ steps:
$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)
- script: |
set -e
export HELM_EXPERIMENTAL_OCI=1
cd charts/azure-service-operator
versiontag="$(CONTAINER_REGISTRY_NAME)/$(ASO_HELM_CHART_NAME):$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)"
Expand All @@ -357,6 +357,7 @@ steps:
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- script: |
set -e
echo "updating kustomize image patch file for manager resource"
echo $IMAGE_NAME
img="$IMAGE_NAME:$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION"
Expand Down
212 changes: 0 additions & 212 deletions devops/azure-pipelines.yaml

This file was deleted.

0 comments on commit 771fa82

Please sign in to comment.