Skip to content

Commit

Permalink
[CICD] build community platform image in circle
Browse files Browse the repository at this point in the history
  • Loading branch information
geekflyer authored and aptos-bot committed May 10, 2022
1 parent db9637c commit f220999
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,21 @@ jobs:
done
exit $ret
fi
build-push-community-platform:
executor: ubuntu-medium
steps:
- checkout
- aws-setup
- aws-ecr-setup
- run: echo $GITHUB_CONTAINER_REGISTRY_TOKEN | docker login ghcr.io -u USERNAME --password-stdin
- run:
name: Build or skip
shell: /bin/bash
command: |
set -e
cd ecosystem/platform/server
docker buildx create --use
GIT_SHA1=${CIRCLE_SHA1} docker buildx bake --progress=plain --push -f ./docker-bake.hcl
ecr-dockerhub-mirror:
executor: ubuntu-medium
parameters:
Expand Down Expand Up @@ -267,6 +282,8 @@ workflows:
- lint
- ecosystem-lint
- unit-test
- build-push-community-platform:
context: aws-dev
- docker-build-push:
context: aws-dev
- ecosystem-test:
Expand Down
25 changes: 25 additions & 0 deletions ecosystem/platform/server/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This is a docker bake file in HCL syntax.
# It provides a high-level mechenanism to build multiple dockerfiles in one shot.
# Check https://crazymax.dev/docker-allhands2-buildx-bake and https://docs.docker.com/engine/reference/commandline/buildx_bake/#file-definition for an intro.


variable "GIT_SHA1" {}
variable "AWS_ECR_ACCOUNT_URL" {}

variable "gh_image_cache" {
default = "ghcr.io/aptos-labs/aptos-core/community-platform"
}

group "default" {
targets = [
"community-platform",
]
}

target "community-platform" {
dockerfile = "Dockerfile"
context = "."
cache-from = ["type=registry,ref=${gh_image_cache}"]
cache-to = ["type=registry,ref=${gh_image_cache},mode=max"]
tags = ["${AWS_ECR_ACCOUNT_URL}/aptos/community-platform:${GIT_SHA1}"]
}

0 comments on commit f220999

Please sign in to comment.