-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
22 changed files
with
394 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
pipeline { | ||
agent any | ||
tools { | ||
go 'go-1.13.5' | ||
} | ||
|
||
environment { | ||
GOPATH="/var/lib/jenkins/go" | ||
GO_REPO_ROOT="${env.GOPATH}/src/github.com" | ||
GO_REPO="${env.GO_REPO_ROOT}/aerospike-kubernetes-operator" | ||
DOCKER_REGISTRY="" | ||
OPERATOR_NAME = "aerospike-kubernetes-operator" | ||
OPERATOR_CONTAINER_IMAGE_CANDIDATE_NAME = "${env.DOCKER_REGISTRY}aerospike/${env.OPERATOR_NAME}:candidate-${env.BRANCH_NAME}" | ||
} | ||
|
||
stages { | ||
stage('Build') { | ||
options { | ||
lock('gopath-k8s-operator') | ||
} | ||
|
||
steps { | ||
sh 'mkdir -p $GO_REPO_ROOT' | ||
sh 'ln -sf ${WORKSPACE} ${GO_REPO}' | ||
|
||
dir("${env.GO_REPO}") { | ||
sh "rsync -aK ${env.WORKSPACE}/../../aerospike-kubernetes-operator-resources/secrets/ deploy/secrets" | ||
// Changing directory again otherwise operator generates binary with the symlink name. | ||
sh "cd ${GO_REPO} && operator-sdk build ${OPERATOR_CONTAINER_IMAGE_CANDIDATE_NAME}" | ||
sh "docker push ${OPERATOR_CONTAINER_IMAGE_CANDIDATE_NAME}" | ||
} | ||
} | ||
} | ||
|
||
stage('Test') { | ||
options { | ||
lock('gke-k8s-cluster') | ||
} | ||
|
||
steps { | ||
dir("${env.GO_REPO}") { | ||
sh "./test/e2e/test.sh ${OPERATOR_CONTAINER_IMAGE_CANDIDATE_NAME}" | ||
} | ||
} | ||
} | ||
} | ||
|
||
post { | ||
always { | ||
junit testResults: '**/build/test-results/**/*.xml', keepLongStdio: true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
_output/ | ||
_output/ | ||
test-results/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,39 @@ | ||
#!/bin/bash | ||
|
||
################################################ | ||
# Should be run from reposiroty root | ||
# | ||
# Cleans up all resources created by test runs. | ||
# | ||
################################################ | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
|
||
# Delete Aeropsike clusters | ||
kubectl -n test delete aerospikecluster --all | ||
kubectl -n test1 delete aerospikecluster --all | ||
kubectl -n test2 delete aerospikecluster --all | ||
kubectl -n test3 delete aerospikecluster --all | ||
|
||
# Delete Stateful Sets | ||
kubectl -n test delete statefulset --selector 'app=aerospike-cluster' | ||
kubectl delete -f test/e2e/setup_operator_test.yaml | ||
|
||
# Delete PVCs | ||
kubectl -n test delete pvc --selector 'app=aerospike-cluster' | ||
|
||
# Delete the secrets | ||
kubectl -n test delete secret --selector 'app=aerospike-cluster' | ||
kubectl -n test delete secret --selector 'app=aerospike-cluster' || true | ||
|
||
# Delete rbac accounts and auth | ||
kubectl delete clusterrolebinding aerospike-cluster | ||
kubectl delete clusterrole aerospike-cluster | ||
kubectl -n test delete serviceaccount aerospike-cluster | ||
kubectl -n test1 delete serviceaccount aerospike-cluster | ||
kubectl -n test2 delete serviceaccount aerospike-cluster | ||
kubectl delete clusterrolebinding aerospike-cluster || true | ||
kubectl delete clusterrole aerospike-cluster || true | ||
kubectl -n test delete serviceaccount aerospike-cluster || true | ||
kubectl -n test1 delete serviceaccount aerospike-cluster || true | ||
kubectl -n test2 delete serviceaccount aerospike-cluster || true | ||
|
||
# Delete the operator deployment | ||
kubectl -n test delete -f $DIR/setup_operator_test.yaml || true | ||
|
||
# Delete namespaces | ||
kubectl delete namespace test1 | ||
kubectl delete namespace test2 | ||
kubectl delete namespace test1 || true | ||
kubectl delete namespace test2 || true | ||
kubectl delete namespace test || true |
Oops, something went wrong.