From 8b9fc461ae33da37df78e94a615556b52000601d Mon Sep 17 00:00:00 2001 From: Evan Cordell Date: Wed, 9 Jan 2019 14:04:28 -0500 Subject: [PATCH] chore(ci): remove ci checks for PRs prow is doing all of this now. the only thing left for gitlab ci is the tagged releases --- .gitlab-ci.jsonnet | 55 +------------------ .gitlab-ci.yml | 98 ++-------------------------------- .gitlab-ci/base_jobs.libsonnet | 3 +- 3 files changed, 6 insertions(+), 150 deletions(-) diff --git a/.gitlab-ci.jsonnet b/.gitlab-ci.jsonnet index 50338596317..b769b5dc821 100644 --- a/.gitlab-ci.jsonnet +++ b/.gitlab-ci.jsonnet @@ -23,16 +23,6 @@ local stages = utils.set(stages_list); // List CI jobs local jobs = { - // Helpers - local onlyMaster = { - only: ['master', 'tags'], - }, - - local onlyBranch = { - only: ['branches'], - except: ['master', 'tags'], - }, - 'container-base-build': baseJob.dockerBuild { stage: stages.docker_base, script: docker.build_and_push(images.base.name, @@ -56,7 +46,8 @@ local jobs = { 'builder': images.ci.olm.name, 'olm': images.prerelease.olm.name, 'e2e': images.e2e.name, - }) + }), + only: ['master', 'tags'], }, 'container-release': baseJob.dockerBuild { @@ -81,23 +72,6 @@ local jobs = { only: ['tags'], }, - "deploy-preview": baseJob.Deploy { - local _vars = self.localvars, - localvars+:: { - helm_opts: ["--force"], - }, - stage: stages.deploy_preview, - when: "manual", - environment+: { - on_stop: "stop-preview", - }, - } + onlyBranch, - - "stop-preview": baseJob.DeployStop { - when: "manual", - stage: stages.deploy_preview, - } + onlyBranch, - "deploy-staging": baseJob.Deploy { local _vars = self.localvars, localvars+:: { @@ -116,31 +90,6 @@ local jobs = { only: ['master'], }, - # currently not needed, to re-enable remove the "." prefix - ".deploy-teamui": baseJob.Deploy { - local _vars = self.localvars, - localvars+:: { - image: images.release, - domain: "teamui.console.team.coreos.systems", - namespace: "operator-lifecycle-manager", - catalog_namespace: "operator-lifecycle-manager", - channel: "staging", - helm_opts: ["--force"], - kubeconfig: "$TEAMUI_KUBECONFIG", - params+:: { - watchedNamespaces: "", - }, - }, - stage: stages.deploy_staging, - script+: [ - "curl -X POST --data-urlencode \"payload={\\\"text\\\": \\\"New OLM Operator quay.io/coreos/olm:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHA} deployed to ${TEAMUI_HOST}/k8s/ns/operator-lifecycle-manager/deployments/alm-operator\\\"}\" ${TEAMUI_SLACK_URL}", - ], - environment+: { - name: "teamui", - }, - only: [''], - }, - "deploy-openshift": baseJob.Deploy { local _vars = self.localvars, localvars+:: { diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 85aa4fdd9ef..9905d103afb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,38 +1,6 @@ # Generated from .gitlab-ci.jsonnet # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN --- -.deploy-teamui: - before_script: - - 'echo "version: 1.0.0-${CI_COMMIT_REF_SLUG}-pre" >> deploy/chart/Chart.yaml' - - 'echo "{\"catalog.image.ref\": \"quay.io/coreos/olm:${CI_COMMIT_REF_SLUG}-${SHA8}\", \"catalog_namespace\": \"operator-lifecycle-manager\", \"namespace\": \"operator-lifecycle-manager\", \"olm.image.ref\": - \"quay.io/coreos/olm:${CI_COMMIT_REF_SLUG}-${SHA8}\", \"package.image.ref\": \"quay.io/coreos/olm:${CI_COMMIT_REF_SLUG}-${SHA8}\", \"watchedNamespaces\": \"\"}" > params.json' - - cat params.json - environment: - name: teamui - url: https://teamui.console.team.coreos.systems - image: quay.io/coreos/alm-ci-build:latest - only: - - '' - script: - - echo $TEAMUI_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=operator-lifecycle-manager deploy/chart --set catalog.image.ref=quay.io/coreos/olm:${CI_COMMIT_REF_SLUG}-${SHA8} - --set catalog_namespace=operator-lifecycle-manager --set namespace=operator-lifecycle-manager --set olm.image.ref=quay.io/coreos/olm:${CI_COMMIT_REF_SLUG}-${SHA8} --set package.image.ref=quay.io/coreos/olm:${CI_COMMIT_REF_SLUG}-${SHA8} - --set watchedNamespaces= --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 ignored@example.com --namespace=operator-lifecycle-manager - || true - - kubectl rollout status -w deployment/olm-operator --namespace=operator-lifecycle-manager - - kubectl rollout status -w deployment/catalog-operator --namespace=operator-lifecycle-manager - - kubectl rollout status -w deployment/package-server --namespace=operator-lifecycle-manager - - 'curl -X POST --data-urlencode "payload={\"text\": \"New OLM Operator quay.io/coreos/olm:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHA} deployed to ${TEAMUI_HOST}/k8s/ns/operator-lifecycle-manager/deployments/alm-operator\"}" - ${TEAMUI_SLACK_URL}' - stage: deploy_staging - tags: - - kubernetes - variables: - ALM_DOMAIN: teamui.console.team.coreos.systems - K8S_NAMESPACE: operator-lifecycle-manager container-base-build: before_script: - docker login -u $DOCKER_USER -p $DOCKER_PASS quay.io @@ -54,6 +22,9 @@ container-build: - docker login -u $DOCKER_USER -p $DOCKER_PASS quay.io - mkdir -p $PWD/bin image: docker:git + only: + - master + - tags script: - docker build -f upstream.Dockerfile . - "docker tag $(docker images --filter 'label=stage=builder' --format '{{.CreatedAt}}\t{{.ID}}' | sort -nr | head -n 1 | cut -f2) quay.io/coreos/olm-ci:${CI_COMMIT_REF_SLUG}" @@ -111,7 +82,6 @@ deploy-openshift: || true - kubectl rollout status -w deployment/olm-operator --namespace=operator-lifecycle-manager - kubectl rollout status -w deployment/catalog-operator --namespace=operator-lifecycle-manager - - kubectl rollout status -w deployment/package-server --namespace=operator-lifecycle-manager - 'curl -X POST --data-urlencode "payload={\"text\": \"New OLM Operator quay.io/coreos/olm:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHA} deployed to ${OPENSHIFT_HOST}/k8s/ns/operator-lifecycle-manager/deployments/alm-operator\"}" ${TEAMUI_SLACK_URL}' stage: deploy_staging @@ -120,41 +90,6 @@ deploy-openshift: variables: ALM_DOMAIN: console.apps.ui-preserve.origin-gce.dev.openshift.com K8S_NAMESPACE: operator-lifecycle-manager -deploy-preview: - before_script: - - 'echo "version: 1.0.0-${CI_COMMIT_REF_SLUG}-pre" >> deploy/chart/Chart.yaml' - - 'echo "{\"catalog.image.ref\": \"quay.io/coreos/olm-ci:${CI_COMMIT_REF_SLUG}-pre\", \"catalog_namespace\": \"ci-olm-${CI_COMMIT_REF_SLUG}\", \"namespace\": \"ci-olm-${CI_COMMIT_REF_SLUG}\", \"olm.image.ref\": - \"quay.io/coreos/olm-ci:${CI_COMMIT_REF_SLUG}-pre\", \"package.image.ref\": \"quay.io/coreos/olm-ci:${CI_COMMIT_REF_SLUG}-pre\", \"watchedNamespaces\": \"ci-olm-${CI_COMMIT_REF_SLUG}\"}" > params.json' - - cat params.json - environment: - name: review/ci-olm-${CI_COMMIT_REF_SLUG} - on_stop: stop-preview - url: https://olm-${CI_COMMIT_REF_SLUG}.k8s.devtable.com - except: - - master - - tags - image: quay.io/coreos/alm-ci-build:latest - only: - - branches - script: - - 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-olm-${CI_COMMIT_REF_SLUG} deploy/chart --set catalog.image.ref=quay.io/coreos/olm-ci:${CI_COMMIT_REF_SLUG}-pre - --set catalog_namespace=ci-olm-${CI_COMMIT_REF_SLUG} --set namespace=ci-olm-${CI_COMMIT_REF_SLUG} --set olm.image.ref=quay.io/coreos/olm-ci:${CI_COMMIT_REF_SLUG}-pre --set package.image.ref=quay.io/coreos/olm-ci:${CI_COMMIT_REF_SLUG}-pre - --set watchedNamespaces=ci-olm-${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 ignored@example.com --namespace=ci-olm-${CI_COMMIT_REF_SLUG} - || true - - kubectl rollout status -w deployment/olm-operator --namespace=ci-olm-${CI_COMMIT_REF_SLUG} - - kubectl rollout status -w deployment/catalog-operator --namespace=ci-olm-${CI_COMMIT_REF_SLUG} - - kubectl rollout status -w deployment/package-server --namespace=ci-olm-${CI_COMMIT_REF_SLUG} - stage: deploy_preview - tags: - - kubernetes - variables: - ALM_DOMAIN: olm-${CI_COMMIT_REF_SLUG}.k8s.devtable.com - K8S_NAMESPACE: ci-olm-${CI_COMMIT_REF_SLUG} - when: manual deploy-staging: before_script: - 'echo "version: 1.0.0-${CI_COMMIT_REF_SLUG}-pre" >> deploy/chart/Chart.yaml' @@ -178,7 +113,6 @@ deploy-staging: || true - kubectl rollout status -w deployment/olm-operator --namespace=ci-alm-staging - kubectl rollout status -w deployment/catalog-operator --namespace=ci-alm-staging - - kubectl rollout status -w deployment/package-server --namespace=ci-alm-staging stage: deploy_staging tags: - kubernetes @@ -196,32 +130,6 @@ stages: - docker_release - deploy_staging - teardown -stop-preview: - before_script: [] - environment: - action: stop - name: review/ci-olm-${CI_COMMIT_REF_SLUG} - url: https://olm-${CI_COMMIT_REF_SLUG}.k8s.devtable.com - except: - - master - - tags - image: quay.io/coreos/alm-ci-build:latest - only: - - branches - script: - - echo $CD_KUBECONFIG | base64 -d > kubeconfig - - export KUBECONFIG=./kubeconfig - - kubectl delete apiservice v1alpha1.packages.apps.redhat.com --ignore-not-found=true - - kubectl delete ns --ignore-not-found=true ci-olm-${CI_COMMIT_REF_SLUG} - - kubectl get pods -o wide -n ci-olm-${CI_COMMIT_REF_SLUG} - stage: deploy_preview - tags: - - kubernetes - variables: - ALM_DOMAIN: olm-${CI_COMMIT_REF_SLUG}.k8s.devtable.com - GIT_STRATEGY: none - K8S_NAMESPACE: ci-olm-${CI_COMMIT_REF_SLUG} - when: manual tag-release: before_script: - docker login -u $DOCKER_USER -p $DOCKER_PASS quay.io diff --git a/.gitlab-ci/base_jobs.libsonnet b/.gitlab-ci/base_jobs.libsonnet index 639746e6940..e816ad759b9 100644 --- a/.gitlab-ci/base_jobs.libsonnet +++ b/.gitlab-ci/base_jobs.libsonnet @@ -71,8 +71,7 @@ local appr = utils.appr; "$DOCKER_USER", "$DOCKER_PASS") + k8s.waitForDeployment("olm-operator", _vars.namespace) + - k8s.waitForDeployment("catalog-operator", _vars.namespace) + - k8s.waitForDeployment("package-server", _vars.namespace), + k8s.waitForDeployment("catalog-operator", _vars.namespace) } + job_tags, DeployStop: self.Deploy {