Skip to content

Commit ae7b7c1

Browse files
[DOP-1608] (#3)
* [DOP-1608] Pull images from private crunchy registry using service account. * [DOP-1608] temp add branch name to test pull/push images * [DOP-1608] Fix private crunchy registry variable, pull from correct path. * [DOP-1608] Remove last empty line * [DOP-1608] Fix missing ) * [DOP-1608] remove temp build branch after successful test.
1 parent e44f3f1 commit ae7b7c1

File tree

2 files changed

+35
-13
lines changed

2 files changed

+35
-13
lines changed

‎.drone.yml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ steps:
3636
from_secret: harbor_password
3737
HARBOR_USERNAME:
3838
from_secret: harbor_username
39+
CRUNCHY_PASSWORD:
40+
from_secret: crunchy_sa_password
41+
CRUNCHY_USERNAME:
42+
from_secret: crunchy_sa_username
3943
DOCKER_HOST: tcp://docker:2375
4044
when:
4145
branch:
@@ -92,3 +96,17 @@ name: gcr_credentials
9296
get:
9397
path: tools/drone/devops_gcr_credentials
9498
name: data
99+
100+
---
101+
kind: secret
102+
name: crunchy_sa_password
103+
get:
104+
path: tools/drone/crunchy_sa
105+
name: password
106+
107+
---
108+
kind: secret
109+
name: crunchy_sa_username
110+
get:
111+
path: tools/drone/crunchy_sa
112+
name: username

‎push_and_tag.sh‎

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
CRUNCHY_REGISTRY=registry.crunchydata.com
12
#Grab the images that need to be tagged and then pushed
23
CONTROLLER_IMAGE_CLUSTER=$(cat helm/install/values.yaml | shyaml get-value controllerImages.cluster)
34
CONTROLLER_IMAGE_UPGRADE=$(cat helm/install/values.yaml | shyaml get-value controllerImages.upgrade)
@@ -7,44 +8,47 @@ RELATED_IMAGES=$(cat helm/install/values.yaml | shyaml values relatedImages imag
78
echo$GCR_CREDENTIALS| base64 -d > keyfile.json
89
docker login -u _json_key --password-stdin https://gcr.io < keyfile.json
910
echo$HARBOR_PASSWORD| docker login -u $HARBOR_USERNAME --password-stdin https://harbor.devops.indico.io
11+
echo$CRUNCHY_PASSWORD| docker login -u $CRUNCHY_USERNAME --password-stdin https://$CRUNCHY_REGISTRY
1012
# pull images
1113

1214
#pull postgres-operator controller image
13-
docker pull $CONTROLLER_IMAGE_CLUSTER
1415
IMAGE_BASE=$(basename $CONTROLLER_IMAGE_CLUSTER)
16+
PRIVATE_IMAGE=$CRUNCHY_REGISTRY/crunchydata/$IMAGE_BASE
17+
docker pull $PRIVATE_IMAGE
1518
#push to gcr
16-
docker tag $CONTROLLER_IMAGE_CLUSTER gcr.io/new-indico/$IMAGE_BASE
19+
docker tag $PRIVATE_IMAGE gcr.io/new-indico/$IMAGE_BASE
1720
docker push gcr.io/new-indico/$IMAGE_BASE
1821
#push to harbor
19-
docker tag $CONTROLLER_IMAGE_CLUSTER harbor.devops.indico.io/indico/$IMAGE_BASE
22+
docker tag $PRIVATE_IMAGE harbor.devops.indico.io/indico/$IMAGE_BASE
2023
docker push harbor.devops.indico.io/indico/$IMAGE_BASE
2124
#Remove Junk
22-
docker rmi $CONTROLLER_IMAGE_CLUSTER gcr.io/new-indico/$IMAGE_BASE harbor.devops.indico.io/indico/$IMAGE_BASE
25+
docker rmi $PRIVATE_IMAGE gcr.io/new-indico/$IMAGE_BASE harbor.devops.indico.io/indico/$IMAGE_BASE
2326

2427
#pull postgres-operator upgrade image
25-
docker pull $CONTROLLER_IMAGE_UPGRADE
2628
IMAGE_BASE=$(basename $CONTROLLER_IMAGE_UPGRADE)
29+
PRIVATE_IMAGE=$CRUNCHY_REGISTRY/crunchydata/$IMAGE_BASE
30+
docker pull $PRIVATE_IMAGE
2731
#push to gcr
28-
docker tag $CONTROLLER_IMAGE_UPGRADE gcr.io/new-indico/$IMAGE_BASE
32+
docker tag $PRIVATE_IMAGE gcr.io/new-indico/$IMAGE_BASE
2933
docker push gcr.io/new-indico/$IMAGE_BASE
3034
#push to harbor
31-
docker tag $CONTROLLER_IMAGE_UPGRADE harbor.devops.indico.io/indico/$IMAGE_BASE
35+
docker tag $PRIVATE_IMAGE harbor.devops.indico.io/indico/$IMAGE_BASE
3236
docker push harbor.devops.indico.io/indico/$IMAGE_BASE
3337
#Remove Junk
34-
docker rmi $CONTROLLER_IMAGE_UPGRADE gcr.io/new-indico/$IMAGE_BASE harbor.devops.indico.io/indico/$IMAGE_BASE
38+
docker rmi $PRIVATE_IMAGE gcr.io/new-indico/$IMAGE_BASE harbor.devops.indico.io/indico/$IMAGE_BASE
3539

3640
forriin$RELATED_IMAGES;
3741
do
3842
IMAGE=$ri
39-
docker pull $IMAGE
4043
IMAGE_BASE=$(basename $IMAGE)
44+
PRIVATE_IMAGE=$CRUNCHY_REGISTRY/crunchydata/$IMAGE_BASE
45+
docker pull $PRIVATE_IMAGE
4146
#push to gcr
42-
docker tag $IMAGE gcr.io/new-indico/$IMAGE_BASE
47+
docker tag $PRIVATE_IMAGE gcr.io/new-indico/$IMAGE_BASE
4348
docker push gcr.io/new-indico/$IMAGE_BASE
4449
#push to harbor
45-
docker tag $IMAGE harbor.devops.indico.io/indico/$IMAGE_BASE
50+
docker tag $PRIVATE_IMAGE harbor.devops.indico.io/indico/$IMAGE_BASE
4651
docker push harbor.devops.indico.io/indico/$IMAGE_BASE
4752
#Remove Junk
48-
docker rmi $IMAGE gcr.io/new-indico/$IMAGE_BASE harbor.devops.indico.io/indico/$IMAGE_BASE
53+
docker rmi $PRIVATE_IMAGE gcr.io/new-indico/$IMAGE_BASE harbor.devops.indico.io/indico/$IMAGE_BASE
4954
done
50-

0 commit comments

Comments
(0)