Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
feat: Azure DevOps PR E2E pipeline (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecile Robert-Michon committed Jan 3, 2019
1 parent 96ab041 commit bc25013
Show file tree
Hide file tree
Showing 7 changed files with 187 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
defaults: &defaults
working_directory: /go/src/github.com/Azure/aks-engine
docker:
- image: quay.io/deis/go-dev:v1.18.1
- image: quay.io/deis/go-dev:v1.18.2
environment:
GOPATH: /go

Expand Down
37 changes: 37 additions & 0 deletions .pipelines/e2e-job-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
parameters:
name: '' # defaults for any parameters that aren't specified
k8sRelease: ''
apimodel: 'examples/e2e-tests/kubernetes/release/default/definition.json'
createVNET: false

jobs:
- job: ${{ parameters.name }}
dependsOn: unit_tests
timeoutInMinutes: 90
cancelTimeoutInMinutes: 5
strategy:
maxParallel: 0
pool:
vmImage: ubuntu-16.04

container: dev1

variables:
GOBIN: '$(GOPATH)/bin' # Go binaries path
GOROOT: '/usr/local/go' # Go installation path
GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path
modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code
TIMEOUT: 20m
CLUSTER_DEFINITION: ${{ parameters.apimodel }}
ORCHESTRATOR_RELEASE: ${{ parameters.k8sRelease }}
CREATE_VNET: ${{ parameters.createVNET }}
CLEANUP_ON_EXIT: true
CLEANUP_IF_FAIL: true
RETAIN_SSH: false
ENABLE_KMS_ENCRYPTION: true
SUBSCRIPTION_ID: '$(SUBSCRIPTION_ID_E2E_KUBERNETES)'

steps:
- template: e2e-step-template.yaml
parameters:
job: ${{ parameters.name }}
27 changes: 27 additions & 0 deletions .pipelines/e2e-step-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
parameters:
job: ''

steps:
- script: |
mkdir -p '$(GOBIN)'
mkdir -p '$(GOPATH)/pkg'
mkdir -p '$(modulePath)'
shopt -s extglob
mv !(gopath) '$(modulePath)'
echo '##vso[task.prependpath]$(GOBIN)'
echo '##vso[task.prependpath]$(GOROOT)/bin'
displayName: 'Set up the Go workspace'
- script: make build-binary
displayName: compile
workingDirectory: $(modulePath)
- script: |
export CLIENT_ID=$(SERVICE_PRINCIPAL_CLIENT_ID_E2E_KUBERNETES)
export CLIENT_SECRET=$(SERVICE_PRINCIPAL_CLIENT_SECRET_E2E_KUBERNETES)
export CLIENT_OBJECTID=$(SERVICE_PRINCIPAL_OBJECT_ID_E2E_KUBERNETES)
make test-kubernetes
displayName: ginkgo k8s e2e tests
workingDirectory: $(modulePath)
- task: PublishPipelineArtifact@0
inputs:
artifactName: '${{ parameters.job }}_logs'
targetPath: '$(modulePath)/_logs'
120 changes: 120 additions & 0 deletions .pipelines/pr-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
trigger:
branches:
include:
- master
paths:
exclude:
- docs/*

pr:
branches:
include:
- master
paths:
exclude:
- docs/*

resources:
containers:
- container: dev1
image: quay.io/deis/go-dev:v1.18.2

jobs:
- job: unit_tests
timeoutInMinutes: 60
cancelTimeoutInMinutes: 5
strategy:
maxParallel: 0
pool:
vmImage: 'Ubuntu 16.04'

container: dev1

variables:
GOBIN: '$(GOPATH)/bin' # Go binaries path
GOROOT: '/usr/local/go' # Go installation path
GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path
modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code

steps:
- script: |
mkdir -p '$(GOBIN)'
mkdir -p '$(GOPATH)/pkg'
mkdir -p '$(modulePath)'
shopt -s extglob
mv !(gopath) '$(modulePath)'
echo '##vso[task.prependpath]$(GOBIN)'
echo '##vso[task.prependpath]$(GOROOT)/bin'
displayName: 'Set up the Go workspace'
- script: make bootstrap
displayName: Install dependencies
workingDirectory: $(modulePath)
- script: make test-style
displayName: Run linting rules
workingDirectory: $(modulePath)
- script: make validate-dependencies
displayName: Check if imports, Gopkg.toml, and Gopkg.lock are in sync
workingDirectory: $(modulePath)
- script: make build-cross
displayName: Build cross-architectural binaries
workingDirectory: $(modulePath)
- script: make coverage
displayName: Run unit tests and calculate coverage
workingDirectory: $(modulePath)

- template: e2e-job-template.yaml
parameters:
name: 'default_linux_e2e'
apimodel: 'examples/kubernetes.json'

- template: e2e-job-template.yaml
parameters:
name: 'k8s_1_10_release_e2e'
k8sRelease: '1.10'
apimodel: 'examples/e2e-tests/kubernetes/release/default/definition.json'
createVNET: true

- template: e2e-job-template.yaml
parameters:
name: 'k8s_1_11_release_e2e'
k8sRelease: '1.11'
apimodel: 'examples/e2e-tests/kubernetes/release/default/definition.json'
createVNET: true

- template: e2e-job-template.yaml
parameters:
name: 'k8s_1_12_release_e2e'
k8sRelease: '1.12'
apimodel: 'examples/e2e-tests/kubernetes/release/default/definition.json'
createVNET: true

- template: e2e-job-template.yaml
parameters:
name: 'k8s_1_13_release_e2e'
k8sRelease: '1.13'
apimodel: 'examples/e2e-tests/kubernetes/release/default/definition.json'
createVNET: true

- template: e2e-job-template.yaml
parameters:
name: 'k8s_windows_1_10_release_e2e'
k8sRelease: '1.10'
apimodel: 'examples/e2e-tests/kubernetes/windows/hybrid/definition.json'

- template: e2e-job-template.yaml
parameters:
name: 'k8s_windows_1_11_release_e2e'
k8sRelease: '1.11'
apimodel: 'examples/e2e-tests/kubernetes/windows/hybrid/definition.json'

- template: e2e-job-template.yaml
parameters:
name: 'k8s_windows_1_12_release_e2e'
k8sRelease: '1.12'
apimodel: 'examples/e2e-tests/kubernetes/windows/hybrid/definition.json'

- template: e2e-job-template.yaml
parameters:
name: 'k8s_windows_1_13_release_e2e'
k8sRelease: '1.13'
apimodel: 'examples/e2e-tests/kubernetes/windows/hybrid/definition.json'
File renamed without changes.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ GITTAG := $(VERSION_SHORT)
endif

REPO_PATH := github.com/Azure/aks-engine
DEV_ENV_IMAGE := quay.io/deis/go-dev:v1.18.1
DEV_ENV_IMAGE := quay.io/deis/go-dev:v1.18.2
DEV_ENV_WORK_DIR := /go/src/${REPO_PATH}
DEV_ENV_OPTS := --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_VARS}
DEV_ENV_CMD := docker run ${DEV_ENV_OPTS} ${DEV_ENV_IMAGE}
Expand Down
2 changes: 1 addition & 1 deletion makedev.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$REPO_PATH = "github.com/Azure/aks-engine"
$DEV_ENV_IMAGE = "quay.io/deis/go-dev:v1.18.1"
$DEV_ENV_IMAGE = "quay.io/deis/go-dev:v1.18.2"
$DEV_ENV_WORK_DIR = "/go/src/$REPO_PATH"

docker.exe run -it --rm -w $DEV_ENV_WORK_DIR -v `"$($PWD)`":$DEV_ENV_WORK_DIR $DEV_ENV_IMAGE bash

0 comments on commit bc25013

Please sign in to comment.