forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
if [ "$#" -ne 2 ]; then | ||
echo "Invalid number of arguments. Usage: stop-ecs-task.sh <cluster> <service>" | ||
exit 1 | ||
fi | ||
|
||
cluster=$1 | ||
service=$2 | ||
|
||
tasks=$(aws ecs list-tasks --cluster $cluster --service-name $service) | ||
|
||
task_arn=$(echo $tasks | awk -F\[ '{print $2}' | awk -F\" '{print $2}') | ||
|
||
if [ -n "${task_arn}" ]; then | ||
aws ecs stop-task --cluster $cluster --task $task_arn > /dev/null | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Build & Tag Container, Push to ECR, Deploy to Dev | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
name: Build, Tag & push to ECR, Deploy task | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup golang | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.14.2' | ||
|
||
- name: Install & Build | ||
run: make all | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_CI_USER_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_CI_USER_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-2 | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: Build, tag, and push image to Amazon ECR | ||
env: | ||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
ECR_REPOSITORY: optimism/geth | ||
IMAGE_TAG: latest | ||
run: | | ||
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . | ||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | ||
# TODO: Add this when the DEV env is set up | ||
# - name: Stop existing dev-geth ECS task to auto-start task with new image | ||
# run: | | ||
# ./.github/scripts/stop-ecs-task.sh dev-geth geth | ||
|
||
- name: Logout of Amazon ECR | ||
if: always() | ||
run: docker logout ${{ steps.login-ecr.outputs.registry }} |