Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Continuous Integration

on:
push:
branches: ['master','main'] # Trigger on the pushes to master & main branches
tags: [ '[0-9]+.[0-9]+.[0-9]+' ]

jobs:
test:
Expand All @@ -18,25 +16,23 @@ jobs:
name: Build and Publish
needs: test
runs-on: ubuntu-latest
if: github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/')
Comment thread
briskt marked this conversation as resolved.
steps:
- uses: actions/checkout@v4

# Step to login to DockerHub

Comment thread
briskt marked this conversation as resolved.
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Step to login to GitHub Container Registry

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor}}
password: ${{ secrets.GITHUB_TOKEN}}

# Extract metadata for the Docker images using the semver

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
Expand All @@ -50,12 +46,10 @@ jobs:
type=semver,pattern={{major.minor}}


# Build and push Docker image to GHCR and Docker Hub
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

labels: ${{ steps.meta.outputs.labels }}
6 changes: 3 additions & 3 deletions ecs-deploy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# Setup default values for variables
VERSION="3.10.21"
VERSION="3.10.22"
CLUSTER=false
SERVICE=false
TASK_DEFINITION=false
Expand Down Expand Up @@ -292,7 +292,7 @@ function parseImageName() {
tag=${!TAGVAR}
if [[ "x$tag" == "x" ]]; then
tag="latest"
else
else
# If !TAGVAR isn't empty, we should use the value of the env var as the tag whether IMAGE contains a digest or not.
emptyOrSha=""
fi
Expand Down Expand Up @@ -379,7 +379,7 @@ function createNewTaskDefJson() {
# + Filter the def
if [[ "x$TAGONLY" == "x" ]]; then
DEF=$( echo "$taskDefinition" \
| sed -e 's~"image":.*'"${imageWithoutTag}"'.*,~"image": "'"${useImage}"'",~g' \
| sed -e 's~"image":.*'"${imageWithoutTag}:"'.*,~"image": "'"${useImage}"'",~g' \
Comment thread
briskt marked this conversation as resolved.
| jq '.taskDefinition' )
else
DEF=$( echo "$taskDefinition" \
Expand Down
4 changes: 2 additions & 2 deletions test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ EOF
"name": "cache",
"links": [],
"mountPoints": [],
"image": "redis:latest",
"image": "121212345678.dkr.ecr.us-east-1.amazonaws.com/acct/repo-two:1487623908",
"essential": true,
"portMappings": [
{
Expand All @@ -491,7 +491,7 @@ EOF
}
EOF
)
expected='{ "family": "app-task-def", "volumes": [], "containerDefinitions": [ { "environment": [ { "name": "KEY", "value": "value" } ], "name": "API", "links": [], "mountPoints": [], "image": "121212345678.dkr.ecr.us-east-1.amazonaws.com/acct/repo:1111111111", "essential": true, "portMappings": [ { "protocol": "tcp", "containerPort": 80, "hostPort": 10080 } ], "entryPoint": [], "memory": 128, "command": [ "/data/run.sh" ], "cpu": 200, "volumesFrom": [] }, { "environment": [ { "name": "KEY", "value": "value" } ], "name": "cache", "links": [], "mountPoints": [], "image": "redis:latest", "essential": true, "portMappings": [ { "protocol": "tcp", "containerPort": 6376, "hostPort": 10376 } ], "entryPoint": [], "memory": 128, "command": [ "/data/run.sh" ], "cpu": 200, "volumesFrom": [] } ], "placementConstraints": null, "networkMode": "bridge" }'
expected='{ "family": "app-task-def", "volumes": [], "containerDefinitions": [ { "environment": [ { "name": "KEY", "value": "value" } ], "name": "API", "links": [], "mountPoints": [], "image": "121212345678.dkr.ecr.us-east-1.amazonaws.com/acct/repo:1111111111", "essential": true, "portMappings": [ { "protocol": "tcp", "containerPort": 80, "hostPort": 10080 } ], "entryPoint": [], "memory": 128, "command": [ "/data/run.sh" ], "cpu": 200, "volumesFrom": [] }, { "environment": [ { "name": "KEY", "value": "value" } ], "name": "cache", "links": [], "mountPoints": [], "image": "121212345678.dkr.ecr.us-east-1.amazonaws.com/acct/repo-two:1487623908", "essential": true, "portMappings": [ { "protocol": "tcp", "containerPort": 6376, "hostPort": 10376 } ], "entryPoint": [], "memory": 128, "command": [ "/data/run.sh" ], "cpu": 200, "volumesFrom": [] } ], "placementConstraints": null, "networkMode": "bridge" }'
Comment thread
briskt marked this conversation as resolved.
run createNewTaskDefJson
[ ! -z $status ]
[ "$(echo "$output" | jq .)" == "$(echo "$expected" | jq .)" ]
Expand Down