Skip to content

Commit b7ae8d5

Browse files
authored
ci: publish docker image only to public registry (#829)
## fixes KILTprotocol/ticket#3600 Maintain only two versions of docker images on the public registry. `kiltprotocol/kilt-node` `kiltprotocol/standalone-node` ## Metadata Diff to Develop Branch <details> <summary>Peregrine Diff</summary> ``` ``` </details> <details> <summary>Spiritnet Diff</summary> ``` ``` </details> ## Checklist: - [ ] I have verified that the code works - [ ] No panics! (checked arithmetic ops, no indexing `array[3]` use `get(3)`, ...) - [ ] I have verified that the code is easy to understand - [ ] If not, I have left a well-balanced amount of inline comments - [ ] I have [left the code in a better state](https://deviq.com/principles/boy-scout-rule) - [ ] I have documented the changes (where applicable) * Either PR or Ticket to update [the Docs](https://github.com/KILTprotocol/docs) * Link the PR/Ticket here
1 parent f6a0908 commit b7ae8d5

File tree

6 files changed

+11
-26
lines changed

6 files changed

+11
-26
lines changed

.gitlab-ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,9 @@ build-docker-images:
7878
DOCKER_HUB_DIP_PROVIDER_TEMPLATE: "kiltprotocol/dip-provider-node-template"
7979
DOCKER_HUB_DIP_CONSUMER_TEMPLATE: "kiltprotocol/dip-consumer-node-template"
8080
before_script:
81-
- aws --version
8281
- docker --version
8382
script:
8483
- echo -n $CI_REGISTRY_TOKEN | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
85-
- aws ecr get-login-password | docker login --username AWS --password-stdin $AWS_REGISTRY
86-
- ./.maintain/docker-auth-config.sh
8784

8885
- ./.maintain/build-image.sh build
8986
- "if [[ ! -z ${CI_COMMIT_BRANCH} ]]; then ./.maintain/push-image.sh build ${CI_COMMIT_SHORT_SHA}; fi"

.maintain/build-image.sh

100755100644
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ target_tag=$1
77
# Build the builder image and push it in the background
88
docker build \
99
--target builder \
10-
--cache-from $AWS_REGISTRY/kilt-parachain/collator:builder \
11-
-t $AWS_REGISTRY/kilt-parachain/collator:builder \
10+
--cache-from $CI_REGISTRY/kilt-node:builder \
11+
-t $CI_REGISTRY/kilt-node:builder \
1212
. &
13-
docker push $AWS_REGISTRY/kilt-parachain/collator:builder &
13+
docker push $CI_REGISTRY/kilt-node:builder &
1414

1515
wait
1616

@@ -21,19 +21,19 @@ build_and_tag() {
2121
local cache_image=$3
2222

2323
docker build \
24-
--cache-from $AWS_REGISTRY/kilt-parachain/collator:builder \
25-
--cache-from $AWS_REGISTRY/$cache_image:$target_tag \
24+
--cache-from $CI_REGISTRY/kilt-node:builder \
25+
--cache-from $CI_REGISTRY/$cache_image:$target_tag \
2626
--build-arg NODE_TYPE=$node_type \
2727
-t local/$image_name:$target_tag \
2828
.
2929
}
3030

31-
build_and_tag "kilt-parachain" "kilt-node" "kilt-parachain/collator" &
31+
build_and_tag "kilt-parachain" "kilt-node" "kilt-node" &
3232

33-
build_and_tag "standalone-node" "standalone-node" "kilt/prototype-chain" &
33+
build_and_tag "standalone-node" "standalone-node" "standalone-node" &
3434

35-
build_and_tag "dip-provider-node-template" "dip-provider-node-template" "kilt-parachain/collator" &
35+
build_and_tag "dip-provider-node-template" "dip-provider-node-template" "kilt-node" &
3636

37-
build_and_tag "dip-consumer-node-template" "dip-consumer-node-template" "kilt-parachain/collator" &
37+
build_and_tag "dip-consumer-node-template" "dip-consumer-node-template" "kilt-node" &
3838

3939
wait

.maintain/docker-auth-config.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

.maintain/push-image.sh

100755100644
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,4 @@ tag_and_push local/kilt-node:$source_tag ${DOCKER_HUB_PARACHAIN}:$target_tag
2121
tag_and_push local/$PROVIDER_BIN_NAME:$source_tag ${DOCKER_HUB_DIP_PROVIDER_TEMPLATE}:$target_tag
2222
tag_and_push local/$CONSUMER_BIN_NAME:$source_tag ${DOCKER_HUB_DIP_CONSUMER_TEMPLATE}:$target_tag
2323

24-
# Tag and push to AWS
25-
tag_and_push local/standalone-node:$source_tag $AWS_REGISTRY/standalone-node:$target_tag
26-
tag_and_push local/kilt-node:$source_tag $AWS_REGISTRY/kilt-node:$target_tag
27-
tag_and_push local/$PROVIDER_BIN_NAME:$source_tag $AWS_REGISTRY/$PROVIDER_BIN_NAME:$target_tag
28-
tag_and_push local/$CONSUMER_BIN_NAME:$source_tag $AWS_REGISTRY/$CONSUMER_BIN_NAME:$target_tag
29-
3024
wait

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN cargo build --locked --release --features $FEATURES
1313

1414
# ===== SECOND STAGE ======
1515

16-
FROM docker.io/library/ubuntu:20.04
16+
FROM docker.io/library/ubuntu:22.04
1717
LABEL description="This is the 2nd stage: a very small image where we copy the kilt-parachain binary."
1818

1919
ARG NODE_TYPE=kilt-parachain

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ services:
44
dev-node:
55
build: .
66
image: local/standalone-node
7-
command: ./target/release/standalone-node --dev --ws-port 9944 --ws-external
7+
command: ./target/release/standalone-node --dev --rpc-port 9944 --rpc-external
88
ports:
99
- 9944:9944
1010
sdk:

0 commit comments

Comments
 (0)