Skip to content

Commit

Permalink
Merge pull request #474 from ecordell/push-tags
Browse files Browse the repository at this point in the history
feat(ci): push tags to quay
  • Loading branch information
openshift-merge-robot authored Sep 19, 2018
2 parents 1f2b753 + 039e957 commit 8799f39
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 3 deletions.
17 changes: 15 additions & 2 deletions .gitlab-ci.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ local jobs = {
},

'container-release': baseJob.dockerBuild {
// ! Only master/tags
// ! Only master
// push the container to the 'prod' repository
stage: stages.docker_release,
before_script+: ["mkdir -p $PWD/bin"],
Expand All @@ -72,8 +72,21 @@ local jobs = {
docker.rename(images.prerelease.catalog.name, images.release.catalog.name) +
docker.rename(images.prerelease.package.name, images.release.package.name) +
docker.rename(images.e2e.name, images.e2elatest.name),
only: ['master'],
},

} + onlyMaster,
'tag-release': baseJob.dockerBuild {
// ! Only tags
// push the container to the 'prod' repository
stage: stages.docker_release,
before_script+: ["mkdir -p $PWD/bin"],
script:
docker.rename(images.prerelease.alm.name, images.tag.alm.name) +
docker.rename(images.prerelease.catalog.name, images.tag.catalog.name) +
docker.rename(images.prerelease.package.name, images.tag.package.name) +
docker.rename(images.e2e.name, images.e2elatest.name),
only: ['tags'],
},

'wait-in-queue': baseJob.WaitInQueue {
stage: stages.wait_in_queue,
Expand Down
27 changes: 26 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ container-release:
image: docker:git
only:
- master
- tags
script:
- docker pull quay.io/coreos/alm-ci:${CI_COMMIT_REF_SLUG}-pre
- docker tag quay.io/coreos/alm-ci:${CI_COMMIT_REF_SLUG}-pre quay.io/coreos/olm:${CI_COMMIT_REF_SLUG}-${SHA8}
Expand Down Expand Up @@ -308,6 +307,32 @@ stop-preview:
GIT_STRATEGY: none
K8S_NAMESPACE: ci-alm-${CI_COMMIT_REF_SLUG}
when: manual
tag-release:
before_script:
- docker login -u $DOCKER_USER -p $DOCKER_PASS quay.io
- mkdir -p $PWD/bin
image: docker:git
only:
- tags
script:
- docker pull quay.io/coreos/alm-ci:${CI_COMMIT_REF_SLUG}-pre
- docker tag quay.io/coreos/alm-ci:${CI_COMMIT_REF_SLUG}-pre quay.io/coreos/olm:${CI_COMMIT_TAG}
- docker push quay.io/coreos/olm:${CI_COMMIT_TAG}
- docker pull quay.io/coreos/catalog-ci:${CI_COMMIT_REF_SLUG}-pre
- docker tag quay.io/coreos/catalog-ci:${CI_COMMIT_REF_SLUG}-pre quay.io/coreos/catalog:${CI_COMMIT_TAG}
- docker push quay.io/coreos/catalog:${CI_COMMIT_TAG}
- docker pull quay.io/coreos/package-server-ci:${CI_COMMIT_REF_SLUG}-pre
- docker tag quay.io/coreos/package-server-ci:${CI_COMMIT_REF_SLUG}-pre quay.io/coreos/package-server:${CI_COMMIT_TAG}
- docker push quay.io/coreos/package-server:${CI_COMMIT_TAG}
- docker pull quay.io/coreos/alm-e2e:${CI_COMMIT_REF_SLUG}-${SHA8}
- docker tag quay.io/coreos/alm-e2e:${CI_COMMIT_REF_SLUG}-${SHA8} quay.io/coreos/alm-e2e:latest
- docker push quay.io/coreos/alm-e2e:latest
stage: docker_release
tags:
- kubernetes
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker-host.gitlab.svc.cluster.local:2375
unit-tests:
before_script:
- mkdir -p $GOPATH/src/github.com/operator-framework/operator-lifecycle-manager
Expand Down
19 changes: 19 additions & 0 deletions .gitlab-ci/vars.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@ local utils = import "utils.libsonnet";
},
},

tag: {
alm: {
repo: "quay.io/coreos/olm",
tag: "${CI_COMMIT_TAG}",
name: utils.containerName(self.repo, self.tag),
},
catalog: {
repo: "quay.io/coreos/catalog",
tag: "${CI_COMMIT_TAG}",
name: utils.containerName(self.repo, self.tag),
},
package: {
repo: "quay.io/coreos/package-server",
tag: "${CI_COMMIT_TAG}",
name: utils.containerName(self.repo, self.tag),
},
},


ci: {
alm: {
repo: "quay.io/coreos/alm-ci",
Expand Down

0 comments on commit 8799f39

Please sign in to comment.