forked from ChainSafe/gossamer
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (83 loc) · 3.46 KB
/
devnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: devnet
on:
push:
branches:
- devnet
jobs:
update:
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
all_but_latest: true
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.21"
stable: true
check-latest: true
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push alice image to Amazon ECR
id: build-alice
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: gssmr-devnet-alice
IMAGE_TAG: ${{ github.sha }}
DD_API_KEY: ${{ secrets.DD_API_KEY }}
run: |
docker build --progress=plain \
-t=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t=$ECR_REGISTRY/$ECR_REPOSITORY:latest \
--build-arg DD_API_KEY=$DD_API_KEY --build-arg METRICS_NAMESPACE=gossamer.ecs.devnet \
-f=devnet/alice.Dockerfile .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
- name: Build, tag, and push bob image to Amazon ECR
id: build-bob
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: gssmr-devnet-bob
IMAGE_TAG: ${{ github.sha }}
DD_API_KEY: ${{ secrets.DD_API_KEY }}
run: |
docker build --progress=plain \
-t=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t=$ECR_REGISTRY/$ECR_REPOSITORY:latest \
--build-arg key=bob --build-arg DD_API_KEY=$DD_API_KEY --build-arg METRICS_NAMESPACE=gossamer.ecs.devnet \
-f=devnet/bob.Dockerfile .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
- name: Build, tag, and push charlie image to Amazon ECR
id: build-charlie
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: gssmr-devnet-charlie
IMAGE_TAG: ${{ github.sha }}
DD_API_KEY: ${{ secrets.DD_API_KEY }}
run: |
docker build --progress=plain \
-t=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t=$ECR_REGISTRY/$ECR_REPOSITORY:latest \
--build-arg key=charlie --build-arg DD_API_KEY=$DD_API_KEY --build-arg METRICS_NAMESPACE=gossamer.ecs.devnet \
-f=devnet/bob.Dockerfile .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
- name: Scale down existing Bob and Charlie
id: scale-down
working-directory: ./devnet/cmd/scale-down-ecs-service
run: |
go run . -c gssmr-ecs -s="gssmr-ecs-(Charlie|Bob)Service-.+$"
- name: docker compose up
id: docker-compose-up
working-directory: ./devnet/gssmr-ecs
run: |
curl -L https://raw.githubusercontent.com/docker/compose-cli/main/scripts/install/install_linux.sh | sh
docker context create ecs gssmr-ecs --from-env
docker context use gssmr-ecs
docker compose up