-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
24 lines (21 loc) · 1.04 KB
/
buildspec.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
version: 0.2
phases:
install:
commands:
- wget https://go.dev/dl/go1.17.7.linux-amd64.tar.gz --quiet
- rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.7.linux-amd64.tar.gz > /dev/null
- export PATH=/usr/local/go/bin:$PATH
- go version
pre_build:
commands:
- cd grpc
- go build -o ../containers/grpc-server/ server/server.go
- go build -o ../containers/grpc-client/ client/client.go
- cd ../containers/
- docker build -t $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/sample-grpc-server:latest grpc-server/
- docker build -t $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/sample-grpc-client:latest grpc-client/
build:
commands:
- aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/sample-grpc-server:latest
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/sample-grpc-client:latest