Skip to content
Open
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
3 changes: 2 additions & 1 deletion cap-ci/common/destroy_k8s.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ define "common_destroy_k8s" }}
{{- /* if this is the last enabled job, but not the *only* enabled job (deploy-k8s) */ -}}
{{- if and (eq .position (sub (len .jobs_enabled) 1)) (ne .position 0) }}
{{- if and (eq .position (sub (len .jobs_enabled) 1)) (ne .job "deploy-k8s" ) }}
ensure:
{{- else }}{{/* if deploy-k8s is the only job, or this job isn't the last job */}}
on_failure:
Expand Down Expand Up @@ -28,6 +28,7 @@ on_failure:
QUIET_OUTPUT: true
DOWNLOAD_CATAPULT_DEPS: false
ENABLE_EIRINI: {{ eq .scheduler "eirini" }}
{{ tmpl.Exec "common_eks_params" | indent 10 | trimSpace }}
run:
path: "/bin/bash"
args:
Expand Down
4 changes: 4 additions & 0 deletions cap-ci/common/eks_params.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{ define "common_eks_params" }}
AWS_ACCESS_KEY_ID: ((aws-ci-chuller-access-key-id))
AWS_SECRET_ACCESS_KEY: ((aws-ci-chuller-secret-access-key))
{{ end }}
1 change: 1 addition & 0 deletions cap-ci/jobs/cf-acceptance-tests-brain.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
{{- print .allbells }}
{{- end }}
KUBECF_TEST_SUITE: brain
{{ tmpl.Exec "common_eks_params" | indent 8 | trimSpace }}
run:
path: "/bin/bash"
args:
Expand Down
1 change: 1 addition & 0 deletions cap-ci/jobs/cf-acceptance-tests.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
{{- print .allbells }}
{{- end }}
KUBECF_TEST_SUITE: cats
{{ tmpl.Exec "common_eks_params" | indent 8 | trimSpace }}
run:
path: "/bin/bash"
args:
Expand Down
1 change: 1 addition & 0 deletions cap-ci/jobs/deploy-k8s.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
BACKEND: {{ .backend }}
QUIET_OUTPUT: true
DOWNLOAD_CATAPULT_DEPS: false
{{ tmpl.Exec "common_eks_params" | indent 8 | trimSpace }}
run:
path: "/bin/bash"
args:
Expand Down
1 change: 1 addition & 0 deletions cap-ci/jobs/deploy-kubecf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
{{- if eq .avail "all" }}
{{- print .allbells }}
{{- end }}
{{ tmpl.Exec "common_eks_params" | indent 8 | trimSpace }}
run:
path: "/bin/bash"
args:
Expand Down
1 change: 1 addition & 0 deletions cap-ci/jobs/deploy-stratos.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
{{- print .allbells }}
{{- end }}
BACKEND: {{ .backend }}
{{ tmpl.Exec "common_eks_params" | indent 8 | trimSpace }}
run:
path: "/bin/bash"
args:
Expand Down
3 changes: 3 additions & 0 deletions cap-ci/jobs/destroy-kubecf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
plan:
- get: catapult
- get: {{ .backend }}-pool.kube-hosts
{{- if ne .position 0 }}
passed:
- {{ index .jobs_enabled (sub .position 1) }}-{{ .scheduler }}-{{ .backend }}-{{ .avail }}
trigger: true
{{- end }}
{{- if index .jobs "deploy-k8s" }}
- get: tfstate-pool
{{- if ne .position 0 }}
Expand All @@ -31,6 +33,7 @@
params:
QUIET_OUTPUT: true
DOWNLOAD_CATAPULT_DEPS: false
{{ tmpl.Exec "common_eks_params" | indent 8 | trimSpace }}
run:
path: "/bin/bash"
args:
Expand Down
1 change: 1 addition & 0 deletions cap-ci/jobs/smoke-tests.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
{{- print .allbells }}
{{- end }}
KUBECF_TEST_SUITE: smokes
{{ tmpl.Exec "common_eks_params" | indent 8 | trimSpace }}
run:
path: "/bin/bash"
args:
Expand Down
1 change: 1 addition & 0 deletions cap-ci/jobs/sync-integration-tests.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
{{- print .allbells }}
{{- end }}
KUBECF_TEST_SUITE: sits
{{ tmpl.Exec "common_eks_params" | indent 8 | trimSpace }}
run:
path: "/bin/bash"
args:
Expand Down
1 change: 1 addition & 0 deletions cap-ci/jobs/upgrade-kubecf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
{{- print .allbells }}
{{- end }}
BACKEND: {{ .backend }}
{{ tmpl.Exec "common_eks_params" | indent 8 | trimSpace }}
run:
path: "/bin/bash"
args:
Expand Down
4 changes: 2 additions & 2 deletions cap-ci/pipeline.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ resources:
url: http://opensource.suse.com/stratos-metrics/
{{ end }}

{{- if or (index $config.jobs "deploy-k8s") (index $config.jobs "destroy-k8s") }}
{{- if index $config.jobs "deploy-k8s" }}
- name: tfstate-pool
type: pool
source:
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
{{- range $backend, $enabled := $config.backends }}{{ if $enabled }}
{{- range $avail, $enabled := $config.availabilities }}{{ if $enabled }}
{{- range $scheduler, $enabled := $config.schedulers }}{{ if $enabled }}
{{- $context := $context | merge (dict "position" $job_index "backend" $backend "avail" $avail "scheduler" $scheduler) -}}
{{- $context := $context | merge (dict "position" $job_index "backend" $backend "avail" $avail "scheduler" $scheduler "job" $job) -}}
{{ tmpl.Exec ( print "jobs_" $job ) $context }}
{{- end }}{{ end }}
{{- end }}{{ end }}
Expand Down
2 changes: 0 additions & 2 deletions cap-ci/scripts/deploy_k8s.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{{ define "scripts_deploy_k8s" }}
{{- /* create k8s cluster */}}
export random_variable=$(hexdump -n 8 -e '2/4 "%08x"' /dev/urandom)
export AWS_ACCESS_KEY_ID='((aws-ci-chuller-access-key-id))'
export AWS_SECRET_ACCESS_KEY='((aws-ci-chuller-secret-access-key))'
if [[ ${BACKEND} == "gke" ]]; then
printf "%s" '((gke-key-json))' > $PWD/gke-key.json
export GKE_CRED_JSON=$PWD/gke-key.json
Expand Down
3 changes: 0 additions & 3 deletions cap-ci/scripts/import_eks.tmpl
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{{ define "scripts_import_eks" }}
{{- /* create buildfolder prepared for eks */}}
export BACKEND=eks
{{- /* AWS vars exported here so hijacking doesn't contain them in env */}}
export AWS_ACCESS_KEY_ID='((aws-ci-chuller-access-key-id))'
export AWS_SECRET_ACCESS_KEY='((aws-ci-chuller-secret-access-key))'
export KUBECFG=$PWD/kubeconfig_$CLUSTER_NAME
make kubeconfig
{{ end }}