Skip to content

Commit

Permalink
Merge pull request #289 from silinternational/feature/actions
Browse files Browse the repository at this point in the history
Convert to Actions
  • Loading branch information
jason-jackson authored Mar 18, 2024
2 parents 7a12167 + ced6378 commit 83ee092
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 40 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Continuous Integration

on:
push:

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run tests
run: docker-compose -f action-services.yml run test

build-and-publish:
name: Build and Publish
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ vars.DOCKER_ORG }}/ecs-deploy

- 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 }}
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ecs-deploy
=================

[ ![Codeship Status for silinternational/ecs-deploy](https://app.codeship.com/projects/393a91e0-da8d-0134-6603-1e487e818871/status?branch=master)](https://app.codeship.com/projects/203720)
![Status for silinternational/ecs-deploy](https://github.com/silinternational/ecs-deploy/actions/workflows/build-and-deploy.yml/badge.svg?branch=master)

This script uses the Task Definition and Service entities in Amazon's ECS to instigate an automatic blue/green deployment.

Expand Down Expand Up @@ -172,19 +172,16 @@ this script.
Use Environment Variable for tag name value
-------------------------------------------
In some cases you may want to use an environment variable for the tag name of your image.
For instance, we use Codeship for continuous integration and deployment. In their Docker
environment they can build images and tag them with different variables, such as
the current unix timestamp. We want to use these unique and changing values for image tags
so that each task definition refers to a unique docker image/tag. This gives us the
ability to revert/rollback changes by just selecting a previous task definition and
updating the service. We plan to add a revert command/option to ecs-deploy to simplify this further.
For example, we want to use a unique docker image/tag for each task definition. This
gives us the ability to revert/rollback changes by just selecting a previous task
definition and updating the service.

Using the ```-e``` argument you can provide the name of an environment variable that
holds the value you wish to use for the tag. On Codeship they set an env var named CI_TIMESTAMP.
Using the `-e` argument you can provide the name of an environment variable that
holds the value you wish to use for the tag.

So we use ```ecs-deploy``` like this:
For example:

ecs-deploy -c production1 -n doorman-api -i my.private.repo/doorman-api -e CI_TIMESTAMP
ecs-deploy -c CLUSTERNAME -n SERVICENAME -i my.private.repo.com/frontend_container -e CI_TIMESTAMP

AWS IAM Policy Configuration
-------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions action-services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: "3"

services:
test:
build: .
entrypoint: ["/run-tests.sh"]
6 changes: 0 additions & 6 deletions codeship-services.yml

This file was deleted.

21 changes: 0 additions & 21 deletions codeship-steps.yml

This file was deleted.

2 changes: 0 additions & 2 deletions dockercfg.encrypted

This file was deleted.

0 comments on commit 83ee092

Please sign in to comment.