Skip to content

Commit

Permalink
fix(ci): use deployment namespace as catalog_namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
njhale committed Oct 9, 2018
1 parent dc823d1 commit f8aa7b6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.jsonnet
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
local utils = import '.gitlab-ci/utils.libsonnet';
local vars = import '.gitlab-ci/vars.libsonnet';
local baseJob = import '.gitlab-ci/base_jobs.libsonnet';
local k8s = utils.k8s;
local mergeJob = utils.ci.mergeJob;
local images = vars.images;
local docker = utils.docker;
Expand Down Expand Up @@ -200,7 +201,6 @@ local jobs = {
image: images.release,
domain: "console.apps.ui-preserve.origin-gce.dev.openshift.com",
namespace: "operator-lifecycle-manager",
catalog_namespace: "operator-lifecycle-manager",
channel: "staging",
helm_opts: ["--force"],
kubeconfig: "$OPENSHIFT_KUBECONFIG",
Expand Down
8 changes: 4 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ deploy-openshift:
deploy-preview:
before_script:
- 'echo "version: 1.0.0-${CI_COMMIT_REF_SLUG}-pre" >> deploy/chart/Chart.yaml'
- 'echo "{\"alm.image.ref\": \"quay.io/coreos/alm-ci:${CI_COMMIT_REF_SLUG}-pre\", \"catalog.image.ref\": \"quay.io/coreos/catalog-ci:${CI_COMMIT_REF_SLUG}-pre\", \"catalog_namespace\": \"operator-lifecycle-manager\",
- 'echo "{\"alm.image.ref\": \"quay.io/coreos/alm-ci:${CI_COMMIT_REF_SLUG}-pre\", \"catalog.image.ref\": \"quay.io/coreos/catalog-ci:${CI_COMMIT_REF_SLUG}-pre\", \"catalog_namespace\": \"ci-alm-${CI_COMMIT_REF_SLUG}\",
\"namespace\": \"ci-alm-${CI_COMMIT_REF_SLUG}\", \"package.image.ref\": \"quay.io/coreos/package-server-ci:${CI_COMMIT_REF_SLUG}-pre\", \"watchedNamespaces\": \"ci-alm-${CI_COMMIT_REF_SLUG}\"}" > params.json'
- cat params.json
environment:
Expand All @@ -151,7 +151,7 @@ deploy-preview:
- echo $CD_KUBECONFIG | base64 -d > kubeconfig
- export KUBECONFIG=./kubeconfig
- charttmpdir=`mktemp -d 2>/dev/null || mktemp -d -t 'charttmpdir'`;mkdir -p ${charttmpdir};helm template -n olm --set namespace=ci-alm-${CI_COMMIT_REF_SLUG} deploy/chart --set alm.image.ref=quay.io/coreos/alm-ci:${CI_COMMIT_REF_SLUG}-pre
--set catalog.image.ref=quay.io/coreos/catalog-ci:${CI_COMMIT_REF_SLUG}-pre --set catalog_namespace=operator-lifecycle-manager --set namespace=ci-alm-${CI_COMMIT_REF_SLUG} --set package.image.ref=quay.io/coreos/package-server-ci:${CI_COMMIT_REF_SLUG}-pre
--set catalog.image.ref=quay.io/coreos/catalog-ci:${CI_COMMIT_REF_SLUG}-pre --set catalog_namespace=ci-alm-${CI_COMMIT_REF_SLUG} --set namespace=ci-alm-${CI_COMMIT_REF_SLUG} --set package.image.ref=quay.io/coreos/package-server-ci:${CI_COMMIT_REF_SLUG}-pre
--set watchedNamespaces=ci-alm-${CI_COMMIT_REF_SLUG} --output-dir ${charttmpdir};chartfilenames=$(ls ${charttmpdir}/olm/templates/*.yaml);echo ${chartfilenames};for f in ${chartfilenames};do if [[ $f
== *.configmap.yaml ]];then kubectl replace --force -f ${f};else kubectl apply -f ${f};fi;done;
- kubectl create secret docker-registry coreos-pull-secret --docker-server quay.io --docker-username $DOCKER_USER --docker-password $DOCKER_PASS --docker-email [email protected] --namespace=ci-alm-${CI_COMMIT_REF_SLUG}
Expand All @@ -169,7 +169,7 @@ deploy-preview:
deploy-staging:
before_script:
- 'echo "version: 1.0.0-${CI_COMMIT_REF_SLUG}-pre" >> deploy/chart/Chart.yaml'
- 'echo "{\"alm.image.ref\": \"quay.io/coreos/olm:${CI_COMMIT_REF_SLUG}-${SHA8}\", \"catalog.image.ref\": \"quay.io/coreos/catalog:${CI_COMMIT_REF_SLUG}-${SHA8}\", \"catalog_namespace\": \"operator-lifecycle-manager\",
- 'echo "{\"alm.image.ref\": \"quay.io/coreos/olm:${CI_COMMIT_REF_SLUG}-${SHA8}\", \"catalog.image.ref\": \"quay.io/coreos/catalog:${CI_COMMIT_REF_SLUG}-${SHA8}\", \"catalog_namespace\": \"ci-alm-staging\",
\"namespace\": \"ci-alm-staging\", \"package.image.ref\": \"quay.io/coreos/package-server:${CI_COMMIT_REF_SLUG}-${SHA8}\", \"watchedNamespaces\": \"ci-alm-staging\"}" > params.json'
- cat params.json
environment:
Expand All @@ -182,7 +182,7 @@ deploy-staging:
- echo $CD_KUBECONFIG | base64 -d > kubeconfig
- export KUBECONFIG=./kubeconfig
- charttmpdir=`mktemp -d 2>/dev/null || mktemp -d -t 'charttmpdir'`;mkdir -p ${charttmpdir};helm template -n olm --set namespace=ci-alm-staging deploy/chart --set alm.image.ref=quay.io/coreos/olm:${CI_COMMIT_REF_SLUG}-${SHA8}
--set catalog.image.ref=quay.io/coreos/catalog:${CI_COMMIT_REF_SLUG}-${SHA8} --set catalog_namespace=operator-lifecycle-manager --set namespace=ci-alm-staging --set package.image.ref=quay.io/coreos/package-server:${CI_COMMIT_REF_SLUG}-${SHA8}
--set catalog.image.ref=quay.io/coreos/catalog:${CI_COMMIT_REF_SLUG}-${SHA8} --set catalog_namespace=ci-alm-staging --set namespace=ci-alm-staging --set package.image.ref=quay.io/coreos/package-server:${CI_COMMIT_REF_SLUG}-${SHA8}
--set watchedNamespaces=ci-alm-staging --output-dir ${charttmpdir};chartfilenames=$(ls ${charttmpdir}/olm/templates/*.yaml);echo ${chartfilenames};for f in ${chartfilenames};do if [[ $f == *.configmap.yaml
]];then kubectl replace --force -f ${f};else kubectl apply -f ${f};fi;done;
- kubectl create secret docker-registry coreos-pull-secret --docker-server quay.io --docker-username $DOCKER_USER --docker-password $DOCKER_PASS --docker-email [email protected] --namespace=ci-alm-staging
Expand Down
3 changes: 1 addition & 2 deletions .gitlab-ci/base_jobs.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ local appr = utils.appr;
app: "%s@%s" % [self.apprepo, self.appversion],
domain: "alm-%s.k8s.devtable.com" % "${CI_COMMIT_REF_SLUG}",
namespace: "ci-alm-%s" % "${CI_COMMIT_REF_SLUG}",
catalog_namespace: "operator-lifecycle-manager",
image: vars.images.prerelease,
channel: null,
helm_opts: [],
Expand All @@ -104,7 +103,7 @@ local appr = utils.appr;
"catalog.image.ref": _vars.image.catalog.name,
"package.image.ref": _vars.image.package.name,
watchedNamespaces: _vars.namespace,
catalog_namespace: _vars.catalog_namespace,
catalog_namespace: _vars.namespace,
namespace: _vars.namespace,
},
},
Expand Down

0 comments on commit f8aa7b6

Please sign in to comment.