Skip to content
Merged
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
18 changes: 18 additions & 0 deletions .drone.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,6 +36,10 @@ steps:
from_secret: harbor_password
HARBOR_USERNAME:
from_secret: harbor_username
CRUNCHY_PASSWORD:
from_secret: crunchy_sa_password
CRUNCHY_USERNAME:
from_secret: crunchy_sa_username
DOCKER_HOST: tcp://docker:2375
when:
branch:
Expand DownExpand Up@@ -92,3 +96,17 @@ name: gcr_credentials
get:
path: tools/drone/devops_gcr_credentials
name: data

---
kind: secret
name: crunchy_sa_password
get:
path: tools/drone/crunchy_sa
name: password

---
kind: secret
name: crunchy_sa_username
get:
path: tools/drone/crunchy_sa
name: username
30 changes: 17 additions & 13 deletions push_and_tag.sh
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
CRUNCHY_REGISTRY=registry.crunchydata.com
#Grab the images that need to be tagged and then pushed
CONTROLLER_IMAGE_CLUSTER=$(cat helm/install/values.yaml | shyaml get-value controllerImages.cluster)
CONTROLLER_IMAGE_UPGRADE=$(cat helm/install/values.yaml | shyaml get-value controllerImages.upgrade)
Expand All@@ -7,44 +8,47 @@ RELATED_IMAGES=$(cat helm/install/values.yaml | shyaml values relatedImages imag
echo $GCR_CREDENTIALS | base64 -d > keyfile.json
docker login -u _json_key --password-stdin https://gcr.io < keyfile.json
echo $HARBOR_PASSWORD | docker login -u $HARBOR_USERNAME --password-stdin https://harbor.devops.indico.io
echo $CRUNCHY_PASSWORD | docker login -u $CRUNCHY_USERNAME --password-stdin https://$CRUNCHY_REGISTRY
# pull images

#pull postgres-operator controller image
docker pull $CONTROLLER_IMAGE_CLUSTER
IMAGE_BASE=$(basename $CONTROLLER_IMAGE_CLUSTER)
PRIVATE_IMAGE=$CRUNCHY_REGISTRY/crunchydata/$IMAGE_BASE
docker pull $PRIVATE_IMAGE
#push to gcr
docker tag $CONTROLLER_IMAGE_CLUSTER gcr.io/new-indico/$IMAGE_BASE
docker tag $PRIVATE_IMAGE gcr.io/new-indico/$IMAGE_BASE
docker push gcr.io/new-indico/$IMAGE_BASE
#push to harbor
docker tag $CONTROLLER_IMAGE_CLUSTER harbor.devops.indico.io/indico/$IMAGE_BASE
docker tag $PRIVATE_IMAGE harbor.devops.indico.io/indico/$IMAGE_BASE
docker push harbor.devops.indico.io/indico/$IMAGE_BASE
#Remove Junk
docker rmi $CONTROLLER_IMAGE_CLUSTER gcr.io/new-indico/$IMAGE_BASE harbor.devops.indico.io/indico/$IMAGE_BASE
docker rmi $PRIVATE_IMAGE gcr.io/new-indico/$IMAGE_BASE harbor.devops.indico.io/indico/$IMAGE_BASE

#pull postgres-operator upgrade image
docker pull $CONTROLLER_IMAGE_UPGRADE
IMAGE_BASE=$(basename $CONTROLLER_IMAGE_UPGRADE)
PRIVATE_IMAGE=$CRUNCHY_REGISTRY/crunchydata/$IMAGE_BASE
docker pull $PRIVATE_IMAGE
#push to gcr
docker tag $CONTROLLER_IMAGE_UPGRADE gcr.io/new-indico/$IMAGE_BASE
docker tag $PRIVATE_IMAGE gcr.io/new-indico/$IMAGE_BASE
docker push gcr.io/new-indico/$IMAGE_BASE
#push to harbor
docker tag $CONTROLLER_IMAGE_UPGRADE harbor.devops.indico.io/indico/$IMAGE_BASE
docker tag $PRIVATE_IMAGE harbor.devops.indico.io/indico/$IMAGE_BASE
docker push harbor.devops.indico.io/indico/$IMAGE_BASE
#Remove Junk
docker rmi $CONTROLLER_IMAGE_UPGRADE gcr.io/new-indico/$IMAGE_BASE harbor.devops.indico.io/indico/$IMAGE_BASE
docker rmi $PRIVATE_IMAGE gcr.io/new-indico/$IMAGE_BASE harbor.devops.indico.io/indico/$IMAGE_BASE

for ri in $RELATED_IMAGES;
do
IMAGE=$ri
docker pull $IMAGE
IMAGE_BASE=$(basename $IMAGE)
PRIVATE_IMAGE=$CRUNCHY_REGISTRY/crunchydata/$IMAGE_BASE
docker pull $PRIVATE_IMAGE
#push to gcr
docker tag $IMAGE gcr.io/new-indico/$IMAGE_BASE
docker tag $PRIVATE_IMAGE gcr.io/new-indico/$IMAGE_BASE
docker push gcr.io/new-indico/$IMAGE_BASE
#push to harbor
docker tag $IMAGE harbor.devops.indico.io/indico/$IMAGE_BASE
docker tag $PRIVATE_IMAGE harbor.devops.indico.io/indico/$IMAGE_BASE
docker push harbor.devops.indico.io/indico/$IMAGE_BASE
#Remove Junk
docker rmi $IMAGE gcr.io/new-indico/$IMAGE_BASE harbor.devops.indico.io/indico/$IMAGE_BASE
docker rmi $PRIVATE_IMAGE gcr.io/new-indico/$IMAGE_BASE harbor.devops.indico.io/indico/$IMAGE_BASE
done