From d262bbca7ebdd5eed0415860f12874cdbc7e13d8 Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Mon, 27 Sep 2021 10:48:48 -0300 Subject: [PATCH 1/6] Add workflows to build image in India and Ireland --- .../build-develop-india-courier.yaml | 37 +++++++++++++++++++ .../build-develop-ireland-courier.yaml | 37 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .github/workflows/build-develop-india-courier.yaml create mode 100644 .github/workflows/build-develop-ireland-courier.yaml diff --git a/.github/workflows/build-develop-india-courier.yaml b/.github/workflows/build-develop-india-courier.yaml new file mode 100644 index 000000000..6320fc4ae --- /dev/null +++ b/.github/workflows/build-develop-india-courier.yaml @@ -0,0 +1,37 @@ +name: Build Develop India RP-courier +on: + push: + branches: + - 'feature/build' +jobs: + docker: + runs-on: ubuntu-latest + environment: + name: develop-india + steps: + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: feature/build + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Set output + id: vars + run: echo ::set-output name=tag::develop-v6.5.2 + - name: Login to ECR + uses: docker/login-action@v1 + with: + registry: 242357350604.dkr.ecr.ap-south-1.amazonaws.com + username: ${{ secrets.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Build and push - Courier Image + id: docker_build1 + uses: docker/build-push-action@v2 + with: + context: . + file: docker/Dockerfile + push: true + tags: 242357350604.dkr.ecr.ap-south-1.amazonaws.com/courier:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-develop-ireland-courier.yaml b/.github/workflows/build-develop-ireland-courier.yaml new file mode 100644 index 000000000..d566b1f6c --- /dev/null +++ b/.github/workflows/build-develop-ireland-courier.yaml @@ -0,0 +1,37 @@ +name: Build Develop Ireland RP-Courier +on: + push: + branches: + - 'feature/build' +jobs: + docker: + runs-on: ubuntu-latest + environment: + name: develop-ireland + steps: + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: feature/build + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Set output + id: vars + run: echo ::set-output name=tag::develop-v6.5.2 + - name: Login to ECR + uses: docker/login-action@v1 + with: + registry: 452158872079.dkr.ecr.eu-west-1.amazonaws.com + username: ${{ secrets.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Build and push - Courier Image + id: docker_build1 + uses: docker/build-push-action@v2 + with: + context: . + file: docker/Dockerfile + push: true + tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-courier-rapidpro:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file From e370a11ebc795aca1728a8f91fc519f212e97a6a Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Mon, 27 Sep 2021 10:56:22 -0300 Subject: [PATCH 2/6] Fix path to Ireland repository --- .github/workflows/build-develop-ireland-courier.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-develop-ireland-courier.yaml b/.github/workflows/build-develop-ireland-courier.yaml index d566b1f6c..47d05814d 100644 --- a/.github/workflows/build-develop-ireland-courier.yaml +++ b/.github/workflows/build-develop-ireland-courier.yaml @@ -33,5 +33,5 @@ jobs: context: . file: docker/Dockerfile push: true - tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-courier-rapidpro:${{ steps.vars.outputs.tag }} + tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/courier-rapidpro:${{ steps.vars.outputs.tag }} no-cache: true \ No newline at end of file From 3d74f871ac5f3a56c3283cac65be732648fbf829 Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Mon, 27 Sep 2021 11:04:25 -0300 Subject: [PATCH 3/6] Fix path to Ireland repository --- .github/workflows/build-develop-ireland-courier.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-develop-ireland-courier.yaml b/.github/workflows/build-develop-ireland-courier.yaml index 47d05814d..d566b1f6c 100644 --- a/.github/workflows/build-develop-ireland-courier.yaml +++ b/.github/workflows/build-develop-ireland-courier.yaml @@ -33,5 +33,5 @@ jobs: context: . file: docker/Dockerfile push: true - tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/courier-rapidpro:${{ steps.vars.outputs.tag }} + tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-courier-rapidpro:${{ steps.vars.outputs.tag }} no-cache: true \ No newline at end of file From 5808291dc460956589bb0bb2620afe7a484c7fb5 Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Thu, 30 Sep 2021 17:03:28 -0300 Subject: [PATCH 4/6] Fix tag based Actions --- .../build-develop-india-courier.yaml | 12 +++--- .../build-develop-ireland-courier.yaml | 12 +++--- .../workflows/build-develop-sp-courier.yaml | 39 ++++++++++++++++++ .../build-production-india-courier.yaml | 39 ++++++++++++++++++ .../build-production-ireland-courier.yaml | 39 ++++++++++++++++++ .../build-production-sp-courier.yaml | 41 +++++++++++++++++++ 6 files changed, 172 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/build-develop-sp-courier.yaml create mode 100644 .github/workflows/build-production-india-courier.yaml create mode 100644 .github/workflows/build-production-ireland-courier.yaml create mode 100644 .github/workflows/build-production-sp-courier.yaml diff --git a/.github/workflows/build-develop-india-courier.yaml b/.github/workflows/build-develop-india-courier.yaml index 6320fc4ae..2104ca6ef 100644 --- a/.github/workflows/build-develop-india-courier.yaml +++ b/.github/workflows/build-develop-india-courier.yaml @@ -1,14 +1,19 @@ name: Build Develop India RP-courier on: push: - branches: - - 'feature/build' + tags: + - 'v*.*.*-develop*' jobs: docker: runs-on: ubuntu-latest environment: name: develop-india steps: + - name: Set output + id: vars + run: | + echo ::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/}|cut -d'-' -f3-4|tr -s '-' '/'); + echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); - name: Check out the repo uses: actions/checkout@v2 with: @@ -17,9 +22,6 @@ jobs: uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Set output - id: vars - run: echo ::set-output name=tag::develop-v6.5.2 - name: Login to ECR uses: docker/login-action@v1 with: diff --git a/.github/workflows/build-develop-ireland-courier.yaml b/.github/workflows/build-develop-ireland-courier.yaml index d566b1f6c..ce3fbccc1 100644 --- a/.github/workflows/build-develop-ireland-courier.yaml +++ b/.github/workflows/build-develop-ireland-courier.yaml @@ -1,14 +1,19 @@ name: Build Develop Ireland RP-Courier on: push: - branches: - - 'feature/build' + tags: + - 'v*.*.*-develop*' jobs: docker: runs-on: ubuntu-latest environment: name: develop-ireland steps: + - name: Set output + id: vars + run: | + echo ::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/}|cut -d'-' -f3-4|tr -s '-' '/'); + echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); - name: Check out the repo uses: actions/checkout@v2 with: @@ -17,9 +22,6 @@ jobs: uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Set output - id: vars - run: echo ::set-output name=tag::develop-v6.5.2 - name: Login to ECR uses: docker/login-action@v1 with: diff --git a/.github/workflows/build-develop-sp-courier.yaml b/.github/workflows/build-develop-sp-courier.yaml new file mode 100644 index 000000000..1f1c6e771 --- /dev/null +++ b/.github/workflows/build-develop-sp-courier.yaml @@ -0,0 +1,39 @@ +name: Build Develop SP RP-Courier +on: + push: + tags: + - 'v*.*.*-develop*' +jobs: + docker: + runs-on: ubuntu-latest + environment: + name: develop + steps: + - name: Set output + id: vars + run: | + echo ::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/}|cut -d'-' -f3-4|tr -s '-' '/'); + echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: feature/build + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ECR + uses: docker/login-action@v1 + with: + registry: 242357350604.dkr.ecr.sa-east-1.amazonaws.com + username: ${{ secrets.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Build and push - Courier Image + id: docker_build1 + uses: docker/build-push-action@v2 + with: + context: . + file: docker/Dockerfile + push: true + tags: 242357350604.dkr.ecr.sa-east-1.amazonaws.com/push-courier:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-india-courier.yaml b/.github/workflows/build-production-india-courier.yaml new file mode 100644 index 000000000..5f89899e3 --- /dev/null +++ b/.github/workflows/build-production-india-courier.yaml @@ -0,0 +1,39 @@ +name: Build Production India RP-courier +on: + push: + tags: + - '!v*.*.*-staging*' + - '!v*.*.*-develop*' + - 'v*.*.*' +jobs: + docker: + runs-on: ubuntu-latest + environment: + name: production-india + steps: + - name: Set output + id: vars + run: echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: main + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ECR + uses: docker/login-action@v1 + with: + registry: 242357350604.dkr.ecr.ap-south-1.amazonaws.com + username: ${{ secrets.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Build and push - Courier Image + id: docker_build1 + uses: docker/build-push-action@v2 + with: + context: . + file: docker/Dockerfile + push: true + tags: 242357350604.dkr.ecr.ap-south-1.amazonaws.com/courier:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-ireland-courier.yaml b/.github/workflows/build-production-ireland-courier.yaml new file mode 100644 index 000000000..584298fec --- /dev/null +++ b/.github/workflows/build-production-ireland-courier.yaml @@ -0,0 +1,39 @@ +name: Build Production Ireland RP-Courier +on: + push: + tags: + - '!v*.*.*-staging*' + - '!v*.*.*-develop*' + - 'v*.*.*' +jobs: + docker: + runs-on: ubuntu-latest + environment: + name: production-ireland + steps: + - name: Set output + id: vars + run: echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: main + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ECR + uses: docker/login-action@v1 + with: + registry: 452158872079.dkr.ecr.eu-west-1.amazonaws.com + username: ${{ secrets.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Build and push - Courier Image + id: docker_build1 + uses: docker/build-push-action@v2 + with: + context: . + file: docker/Dockerfile + push: true + tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-courier-rapidpro:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-sp-courier.yaml b/.github/workflows/build-production-sp-courier.yaml new file mode 100644 index 000000000..20bc0c6ff --- /dev/null +++ b/.github/workflows/build-production-sp-courier.yaml @@ -0,0 +1,41 @@ +name: Build Production SP RP-Courier +on: + push: + tags: + - '!v*.*.*-staging*' + - '!v*.*.*-develop*' + - 'v*.*.*' +jobs: + docker: + runs-on: ubuntu-latest + environment: + name: production + steps: + - name: Set output + id: vars + run: | + echo ::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/}|cut -d'-' -f3-4|tr -s '-' '/'); + echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: main + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ECR + uses: docker/login-action@v1 + with: + registry: 242357350604.dkr.ecr.sa-east-1.amazonaws.com + username: ${{ secrets.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Build and push - Courier Image + id: docker_build1 + uses: docker/build-push-action@v2 + with: + context: . + file: docker/Dockerfile + push: true + tags: 242357350604.dkr.ecr.sa-east-1.amazonaws.com/push-courier:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file From b6931f929e854ab03c0b1eff6e2e36242168d07f Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Fri, 1 Oct 2021 17:42:58 -0300 Subject: [PATCH 5/6] Check and Fix all GitHub Actions files to build images --- .../build-production-india-courier.yaml | 2 +- .../build-production-ireland-courier.yaml | 2 +- .../build-production-sp-courier.yaml | 3 +- .../build-staging-india-courier.yaml | 37 ++++++++++++++++++ .../build-staging-ireland-courier.yaml | 37 ++++++++++++++++++ .../workflows/build-staging-sp-courier.yaml | 38 +++++++++++++++++++ 6 files changed, 115 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build-staging-india-courier.yaml create mode 100644 .github/workflows/build-staging-ireland-courier.yaml create mode 100644 .github/workflows/build-staging-sp-courier.yaml diff --git a/.github/workflows/build-production-india-courier.yaml b/.github/workflows/build-production-india-courier.yaml index 5f89899e3..b5b8f26cc 100644 --- a/.github/workflows/build-production-india-courier.yaml +++ b/.github/workflows/build-production-india-courier.yaml @@ -2,9 +2,9 @@ name: Build Production India RP-courier on: push: tags: + - 'v*.*.*' - '!v*.*.*-staging*' - '!v*.*.*-develop*' - - 'v*.*.*' jobs: docker: runs-on: ubuntu-latest diff --git a/.github/workflows/build-production-ireland-courier.yaml b/.github/workflows/build-production-ireland-courier.yaml index 584298fec..42f9a941e 100644 --- a/.github/workflows/build-production-ireland-courier.yaml +++ b/.github/workflows/build-production-ireland-courier.yaml @@ -2,9 +2,9 @@ name: Build Production Ireland RP-Courier on: push: tags: + - 'v*.*.*' - '!v*.*.*-staging*' - '!v*.*.*-develop*' - - 'v*.*.*' jobs: docker: runs-on: ubuntu-latest diff --git a/.github/workflows/build-production-sp-courier.yaml b/.github/workflows/build-production-sp-courier.yaml index 20bc0c6ff..a08e7901f 100644 --- a/.github/workflows/build-production-sp-courier.yaml +++ b/.github/workflows/build-production-sp-courier.yaml @@ -2,9 +2,9 @@ name: Build Production SP RP-Courier on: push: tags: + - 'v*.*.*' - '!v*.*.*-staging*' - '!v*.*.*-develop*' - - 'v*.*.*' jobs: docker: runs-on: ubuntu-latest @@ -14,7 +14,6 @@ jobs: - name: Set output id: vars run: | - echo ::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/}|cut -d'-' -f3-4|tr -s '-' '/'); echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); - name: Check out the repo uses: actions/checkout@v2 diff --git a/.github/workflows/build-staging-india-courier.yaml b/.github/workflows/build-staging-india-courier.yaml new file mode 100644 index 000000000..66624e5d0 --- /dev/null +++ b/.github/workflows/build-staging-india-courier.yaml @@ -0,0 +1,37 @@ +name: Build Staging India RP-courier +on: + push: + tags: + - 'v*.*.*-staging*' +jobs: + docker: + runs-on: ubuntu-latest + environment: + name: staging-india + steps: + - name: Set output + id: vars + run: echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: main + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ECR + uses: docker/login-action@v1 + with: + registry: 242357350604.dkr.ecr.ap-south-1.amazonaws.com + username: ${{ secrets.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Build and push - Courier Image + id: docker_build1 + uses: docker/build-push-action@v2 + with: + context: . + file: docker/Dockerfile + push: true + tags: 242357350604.dkr.ecr.ap-south-1.amazonaws.com/courier:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-staging-ireland-courier.yaml b/.github/workflows/build-staging-ireland-courier.yaml new file mode 100644 index 000000000..738a6c5ff --- /dev/null +++ b/.github/workflows/build-staging-ireland-courier.yaml @@ -0,0 +1,37 @@ +name: Build Staging Ireland RP-Courier +on: + push: + tags: + - 'v*.*.*-staging*' +jobs: + docker: + runs-on: ubuntu-latest + environment: + name: staging-ireland + steps: + - name: Set output + id: vars + run: echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: main + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ECR + uses: docker/login-action@v1 + with: + registry: 452158872079.dkr.ecr.eu-west-1.amazonaws.com + username: ${{ secrets.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Build and push - Courier Image + id: docker_build1 + uses: docker/build-push-action@v2 + with: + context: . + file: docker/Dockerfile + push: true + tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-courier-rapidpro:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-staging-sp-courier.yaml b/.github/workflows/build-staging-sp-courier.yaml new file mode 100644 index 000000000..a5dc164e4 --- /dev/null +++ b/.github/workflows/build-staging-sp-courier.yaml @@ -0,0 +1,38 @@ +name: Build Staging SP RP-Courier +on: + push: + tags: + - 'v*.*.*-staging*' +jobs: + docker: + runs-on: ubuntu-latest + environment: + name: staging + steps: + - name: Set output + id: vars + run: | + echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: main + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ECR + uses: docker/login-action@v1 + with: + registry: 242357350604.dkr.ecr.sa-east-1.amazonaws.com + username: ${{ secrets.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Build and push - Courier Image + id: docker_build1 + uses: docker/build-push-action@v2 + with: + context: . + file: docker/Dockerfile + push: true + tags: 242357350604.dkr.ecr.sa-east-1.amazonaws.com/push-courier:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file From fa4ae89c441a8a58c7ca5e232928884ddde5ac1c Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Thu, 2 Dec 2021 14:39:19 -0300 Subject: [PATCH 6/6] Change Github token used in secret --- .../build-courier-dispatch-shared.yaml | 123 ++++++++++++++ .../build-courier-push-tag-shared.yaml | 159 ++++++++++++++++++ .../build-develop-india-courier.yaml | 78 ++++----- .../build-develop-ireland-courier.yaml | 78 ++++----- .../workflows/build-develop-sp-courier.yaml | 78 ++++----- .../build-production-india-courier.yaml | 78 ++++----- .../build-production-ireland-courier.yaml | 78 ++++----- .../build-production-sp-courier.yaml | 80 ++++----- .../build-staging-india-courier.yaml | 74 ++++---- .../build-staging-ireland-courier.yaml | 74 ++++---- .../workflows/build-staging-sp-courier.yaml | 76 ++++----- 11 files changed, 629 insertions(+), 347 deletions(-) create mode 100644 .github/workflows/build-courier-dispatch-shared.yaml create mode 100644 .github/workflows/build-courier-push-tag-shared.yaml diff --git a/.github/workflows/build-courier-dispatch-shared.yaml b/.github/workflows/build-courier-dispatch-shared.yaml new file mode 100644 index 000000000..e2d4bce8c --- /dev/null +++ b/.github/workflows/build-courier-dispatch-shared.yaml @@ -0,0 +1,123 @@ +name: Build Rapidpro Courier in Shared (Dispatch) + +on: + workflow_dispatch: + inputs: + + source-branch: + description: 'Source branch in Courier repository (main, staging, develop, fix/sentry etc.)' + required: true + default: 'main' + + tag-name: + description: 'Tag id (v0.0.1-develop, v0.0.2, etc.)' + required: true + + destination-env: + description: 'Destination environment (develop, production, staging)' + required: true + +jobs: + docker: + runs-on: ubuntu-latest + steps: + + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: ${{github.event.inputs.source-branch}} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to ECR + uses: docker/login-action@v1 + with: + registry: 869898323958.dkr.ecr.us-east-1.amazonaws.com + username: ${{ secrets.AWS_ACCESS_KEY_ID_SHARED }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY_SHARED }} + + - name: Build and push - Rapidpro Archiver Image + id: docker_build1 + uses: docker/build-push-action@v2 + with: + context: . + labels: branch=${{github.event.inputs.source-branch}},commit=${{env.GITHUB_SHA}},repository=https://github.com/Ilhasoft/courier + file: ./docker/Dockerfile + push: true + tags: 869898323958.dkr.ecr.us-east-1.amazonaws.com/courier:${{github.event.inputs.tag-name}} + no-cache: true + + - name: Check out Kubernetes Manifests + uses: actions/checkout@master + with: + ref: main + repository: Ilhasoft/kubernetes-manifests-platform + token: ${{ secrets.DEVOPS_GITHUB_PERMANENT_TOKEN }} + path: ./kubernetes-manifests/ + + - name: Set variable tag for jq + run: | + echo "IMAGE_TAG=869898323958.dkr.ecr.us-east-1.amazonaws.com/courier:${{github.event.inputs.tag-name}}" >> $GITHUB_ENV + + - name: Update image on deployment + run: | + which jq > /dev/null 2>&1 || ( sudo apt update ; sudo apt install -y jq ) + # Dep: coreutils + verlte() { + [ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] + } + verlt(){ + [ "$1" = "$2" ] && return 1 || verlte $1 $2 + } + export PROJECT_DIR="weni-flows/courier" PATCH_TARGET="deployment.json" + for e in ${{github.event.inputs.destination-env}}; do + echo "Update ${e}:" + if [ ! -d "kubernetes-manifests/${PROJECT_DIR}/${e}" ] ; then + echo "kubernetes-manifests/${PROJECT_DIR}/${e}: Does not exist, skipping" + elif [ ! -r "kubernetes-manifests/${PROJECT_DIR}/${e}/kustomization.yaml" ] ; then + echo "kubernetes-manifests/${PROJECT_DIR}/${e}/kustomization.yaml: Does not readable, skipping" + elif [ ! -r "kubernetes-manifests/${PROJECT_DIR}/${e}/${PATCH_TARGET}" ] ; then + echo "kubernetes-manifests/${PROJECT_DIR}/${e}/${PATCH_TARGET}: Does not readable, skipping" + else + OLD_IMAGE=$( + cat "kubernetes-manifests/${PROJECT_DIR}/${e}/${PATCH_TARGET}" \ + | jq '.[] | select(.path == "/spec/template/spec/containers/0/image") | .value' + ) + echo "Old image to replace: ${OLD_IMAGE}" + OLD_VERSION=$( + echo "${OLD_IMAGE}" \ + | sed s'/^.*[v:-]\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/'g \ + | head -n1 + ) + NEW_VERSION=$(echo ${{github.event.inputs.tag-name}}|grep -o -e '[0-9]*\.[0-9]*\.[0-9]*') + echo "Old image version to compare: ${OLD_VERSION}<=${NEW_VERSION}" + if verlte "${OLD_VERSION}" "${NEW_VERSION}" ; then + echo 'New configurations:' + new_configuration=$( + cat "kubernetes-manifests/${PROJECT_DIR}/${e}/${PATCH_TARGET}" \ + | jq '(..|select(.path == "/spec/template/spec/containers/0/image")?) += {value: "'"${{env.IMAGE_TAG}}"'"}' + ) + echo "${new_configuration}" + echo "${new_configuration}" > "kubernetes-manifests/${PROJECT_DIR}/${e}/${PATCH_TARGET}" + else + echo "Version in file is greater than build, skiping update yaml" + fi + fi + done + + - name: Commit & Push changes + uses: actions-js/push@master + with: + github_token: ${{ secrets.DEVOPS_GITHUB_PERMANENT_TOKEN }} + repository: Ilhasoft/kubernetes-manifests-platform + directory: ./kubernetes-manifests/ + branch: main + message: "From Rapidpro Courier Build (Dispatch)" + + - name: Generated Image URL to Copy + run: | + echo ${{ env.IMAGE_TAG }} \ No newline at end of file diff --git a/.github/workflows/build-courier-push-tag-shared.yaml b/.github/workflows/build-courier-push-tag-shared.yaml new file mode 100644 index 000000000..244d64268 --- /dev/null +++ b/.github/workflows/build-courier-push-tag-shared.yaml @@ -0,0 +1,159 @@ +name: Build Rapidpro Courier in Shared (Push Tag) + +on: + push: + tags: + - 'v*.*.*-develop*' + - 'v*.*.*-staging*' + - 'v*.*.*' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + + - name: Set variables + run: | + TAG=$(echo $GITHUB_REF|cut -d"/" -f3) + if $(echo $TAG|grep --silent -e 'v*.*.*-develop*') + then + echo "Found environment: DEVELOP - $TAG" + echo "MANIFESTS_ENVIRONMENT=develop" >> $GITHUB_ENV + echo "MANIFESTS_ENVIRONMENT=develop" + echo "TAG=$TAG" >> $GITHUB_ENV + echo "TAG=$TAG" + VERSION=${TAG#v} + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "VERSION=$VERSION" + echo "COMMIT_SHA=$GITHUB_SHA" >> $GITHUB_ENV + echo "COMMIT_SHA=$GITHUB_SHA" + echo "IMAGE_TAG=869898323958.dkr.ecr.us-east-1.amazonaws.com/courier:$TAG" >> $GITHUB_ENV + echo "IMAGE_TAG=869898323958.dkr.ecr.us-east-1.amazonaws.com/courier:$TAG" + elif $(echo $TAG|grep --silent -e 'v*.*.*-staging*') + then + echo "Found environment: STAGING - $TAG" + echo "MANIFESTS_ENVIRONMENT=staging" >> $GITHUB_ENV + echo "MANIFESTS_ENVIRONMENT=staging" + echo "TAG=$TAG" >> $GITHUB_ENV + echo "TAG=$TAG" + VERSION=${TAG#v} + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "VERSION=$VERSION" + echo "COMMIT_SHA=$GITHUB_SHA" >> $GITHUB_ENV + echo "COMMIT_SHA=$GITHUB_SHA" + echo "IMAGE_TAG=869898323958.dkr.ecr.us-east-1.amazonaws.com/courier:$TAG" >> $GITHUB_ENV + echo "IMAGE_TAG=869898323958.dkr.ecr.us-east-1.amazonaws.com/courier:$TAG" + elif $(echo $TAG|grep --silent -e 'v*.*.*') + then + echo "No environment found, assuming: PRODUCTION - $TAG" + echo "MANIFESTS_ENVIRONMENT=production" >> $GITHUB_ENV + echo "MANIFESTS_ENVIRONMENT=production" + echo "TAG=$TAG" >> $GITHUB_ENV + echo "TAG=$TAG" + VERSION=${TAG#v} + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "VERSION=$VERSION" + echo "COMMIT_SHA=$GITHUB_SHA" >> $GITHUB_ENV + echo "COMMIT_SHA=$GITHUB_SHA" + echo "IMAGE_TAG=869898323958.dkr.ecr.us-east-1.amazonaws.com/courier:$TAG" >> $GITHUB_ENV + echo "IMAGE_TAG=869898323958.dkr.ecr.us-east-1.amazonaws.com/courier:$TAG" + else + echo 'Not a valid tag. Skipping...' + exit 1 + fi + + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: ${{env.GITHUB_SHA}} + repository: Ilhasoft/courier + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to ECR + uses: docker/login-action@v1 + with: + registry: 869898323958.dkr.ecr.us-east-1.amazonaws.com + username: ${{secrets.AWS_ACCESS_KEY_ID_SHARED}} + password: ${{secrets.AWS_SECRET_ACCESS_KEY_SHARED}} + + - name: Build and push - Rapidpro Archiver Image + id: docker_build1 + uses: docker/build-push-action@v2 + with: + context: . + labels: branch=${{env.TAG}},commit=${{env.COMMIT_SHA}},repository=https://github.com/Ilhasoft/courier + file: ./docker/Dockerfile + push: true + tags: ${{env.IMAGE_TAG}} + no-cache: true + + - name: Check out Kubernetes Manifests + uses: actions/checkout@master + with: + ref: main + repository: Ilhasoft/kubernetes-manifests-platform + token: ${{secrets.DEVOPS_GITHUB_PERMANENT_TOKEN}} + path: ./kubernetes-manifests/ + + - name: Update image on deployment + run: | + which jq > /dev/null 2>&1 || ( sudo apt update ; sudo apt install -y jq ) + # Dep: coreutils + verlte() { + [ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] + } + verlt(){ + [ "$1" = "$2" ] && return 1 || verlte $1 $2 + } + export PROJECT_DIR="weni-flows/courier" PATCH_TARGET="deployment.json" + for e in ${{env.MANIFESTS_ENVIRONMENT}}; do + echo "Update ${e}:" + if [ ! -d "kubernetes-manifests/${PROJECT_DIR}/${e}" ] ; then + echo "kubernetes-manifests/${PROJECT_DIR}/${e}: Does not exist, skipping" + elif [ ! -r "kubernetes-manifests/${PROJECT_DIR}/${e}/kustomization.yaml" ] ; then + echo "kubernetes-manifests/${PROJECT_DIR}/${e}/kustomization.yaml: Does not readable, skipping" + elif [ ! -r "kubernetes-manifests/${PROJECT_DIR}/${e}/${PATCH_TARGET}" ] ; then + echo "kubernetes-manifests/${PROJECT_DIR}/${e}/${PATCH_TARGET}: Does not readable, skipping" + else + OLD_IMAGE=$( + cat "kubernetes-manifests/${PROJECT_DIR}/${e}/${PATCH_TARGET}" \ + | jq '.[] | select(.path == "/spec/template/spec/containers/0/image") | .value' + ) + echo "Old image to replace: ${OLD_IMAGE}" + OLD_VERSION=$( + echo "${OLD_IMAGE}" \ + | sed s'/^.*[v:-]\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/'g \ + | head -n1 + ) + echo "Old image version to compare: ${OLD_VERSION}<=${{env.VERSION}}" + if verlte "${OLD_VERSION}" "${{env.VERSION}}" ; then + echo 'New configurations:' + new_configuration=$( + cat "kubernetes-manifests/${PROJECT_DIR}/${e}/${PATCH_TARGET}" \ + | jq '(..|select(.path == "/spec/template/spec/containers/0/image")?) += {value: "'"${{env.IMAGE_TAG}}"'"}' + ) + echo "${new_configuration}" + echo "${new_configuration}" > "kubernetes-manifests/${PROJECT_DIR}/${e}/${PATCH_TARGET}" + else + echo "Version in file is greater than build, skiping update yaml" + fi + fi + done + + - name: Commit & Push changes + uses: actions-js/push@master + with: + github_token: ${{ secrets.DEVOPS_GITHUB_PERMANENT_TOKEN }} + repository: Ilhasoft/kubernetes-manifests-platform + directory: ./kubernetes-manifests/ + branch: main + message: "From Rapidpro Archiver Build (Push-Tag)" + + - name: Generated Image + run: | + echo "IMAGE: " ${{env.IMAGE_TAG}} \ No newline at end of file diff --git a/.github/workflows/build-develop-india-courier.yaml b/.github/workflows/build-develop-india-courier.yaml index 2104ca6ef..611af242a 100644 --- a/.github/workflows/build-develop-india-courier.yaml +++ b/.github/workflows/build-develop-india-courier.yaml @@ -1,39 +1,39 @@ -name: Build Develop India RP-courier -on: - push: - tags: - - 'v*.*.*-develop*' -jobs: - docker: - runs-on: ubuntu-latest - environment: - name: develop-india - steps: - - name: Set output - id: vars - run: | - echo ::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/}|cut -d'-' -f3-4|tr -s '-' '/'); - echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: feature/build - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to ECR - uses: docker/login-action@v1 - with: - registry: 242357350604.dkr.ecr.ap-south-1.amazonaws.com - username: ${{ secrets.AWS_ACCESS_KEY_ID }} - password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: Build and push - Courier Image - id: docker_build1 - uses: docker/build-push-action@v2 - with: - context: . - file: docker/Dockerfile - push: true - tags: 242357350604.dkr.ecr.ap-south-1.amazonaws.com/courier:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Develop India RP-courier +# on: +# push: +# tags: +# - 'v*.*.*-develop*' +# jobs: +# docker: +# runs-on: ubuntu-latest +# environment: +# name: develop-india +# steps: +# - name: Set output +# id: vars +# run: | +# echo ::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/}|cut -d'-' -f3-4|tr -s '-' '/'); +# echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); +# - name: Check out the repo +# uses: actions/checkout@v2 +# with: +# ref: feature/build +# - name: Set up QEMU +# uses: docker/setup-qemu-action@v1 +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v1 +# - name: Login to ECR +# uses: docker/login-action@v1 +# with: +# registry: 242357350604.dkr.ecr.ap-south-1.amazonaws.com +# username: ${{ secrets.AWS_ACCESS_KEY_ID }} +# password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# - name: Build and push - Courier Image +# id: docker_build1 +# uses: docker/build-push-action@v2 +# with: +# context: . +# file: docker/Dockerfile +# push: true +# tags: 242357350604.dkr.ecr.ap-south-1.amazonaws.com/courier:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-develop-ireland-courier.yaml b/.github/workflows/build-develop-ireland-courier.yaml index ce3fbccc1..eadb01fe9 100644 --- a/.github/workflows/build-develop-ireland-courier.yaml +++ b/.github/workflows/build-develop-ireland-courier.yaml @@ -1,39 +1,39 @@ -name: Build Develop Ireland RP-Courier -on: - push: - tags: - - 'v*.*.*-develop*' -jobs: - docker: - runs-on: ubuntu-latest - environment: - name: develop-ireland - steps: - - name: Set output - id: vars - run: | - echo ::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/}|cut -d'-' -f3-4|tr -s '-' '/'); - echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: feature/build - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to ECR - uses: docker/login-action@v1 - with: - registry: 452158872079.dkr.ecr.eu-west-1.amazonaws.com - username: ${{ secrets.AWS_ACCESS_KEY_ID }} - password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: Build and push - Courier Image - id: docker_build1 - uses: docker/build-push-action@v2 - with: - context: . - file: docker/Dockerfile - push: true - tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-courier-rapidpro:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Develop Ireland RP-Courier +# on: +# push: +# tags: +# - 'v*.*.*-develop*' +# jobs: +# docker: +# runs-on: ubuntu-latest +# environment: +# name: develop-ireland +# steps: +# - name: Set output +# id: vars +# run: | +# echo ::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/}|cut -d'-' -f3-4|tr -s '-' '/'); +# echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); +# - name: Check out the repo +# uses: actions/checkout@v2 +# with: +# ref: feature/build +# - name: Set up QEMU +# uses: docker/setup-qemu-action@v1 +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v1 +# - name: Login to ECR +# uses: docker/login-action@v1 +# with: +# registry: 452158872079.dkr.ecr.eu-west-1.amazonaws.com +# username: ${{ secrets.AWS_ACCESS_KEY_ID }} +# password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# - name: Build and push - Courier Image +# id: docker_build1 +# uses: docker/build-push-action@v2 +# with: +# context: . +# file: docker/Dockerfile +# push: true +# tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-courier-rapidpro:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-develop-sp-courier.yaml b/.github/workflows/build-develop-sp-courier.yaml index 1f1c6e771..5969542d0 100644 --- a/.github/workflows/build-develop-sp-courier.yaml +++ b/.github/workflows/build-develop-sp-courier.yaml @@ -1,39 +1,39 @@ -name: Build Develop SP RP-Courier -on: - push: - tags: - - 'v*.*.*-develop*' -jobs: - docker: - runs-on: ubuntu-latest - environment: - name: develop - steps: - - name: Set output - id: vars - run: | - echo ::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/}|cut -d'-' -f3-4|tr -s '-' '/'); - echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: feature/build - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to ECR - uses: docker/login-action@v1 - with: - registry: 242357350604.dkr.ecr.sa-east-1.amazonaws.com - username: ${{ secrets.AWS_ACCESS_KEY_ID }} - password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: Build and push - Courier Image - id: docker_build1 - uses: docker/build-push-action@v2 - with: - context: . - file: docker/Dockerfile - push: true - tags: 242357350604.dkr.ecr.sa-east-1.amazonaws.com/push-courier:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Develop SP RP-Courier +# on: +# push: +# tags: +# - 'v*.*.*-develop*' +# jobs: +# docker: +# runs-on: ubuntu-latest +# environment: +# name: develop +# steps: +# - name: Set output +# id: vars +# run: | +# echo ::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/}|cut -d'-' -f3-4|tr -s '-' '/'); +# echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); +# - name: Check out the repo +# uses: actions/checkout@v2 +# with: +# ref: feature/build +# - name: Set up QEMU +# uses: docker/setup-qemu-action@v1 +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v1 +# - name: Login to ECR +# uses: docker/login-action@v1 +# with: +# registry: 242357350604.dkr.ecr.sa-east-1.amazonaws.com +# username: ${{ secrets.AWS_ACCESS_KEY_ID }} +# password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# - name: Build and push - Courier Image +# id: docker_build1 +# uses: docker/build-push-action@v2 +# with: +# context: . +# file: docker/Dockerfile +# push: true +# tags: 242357350604.dkr.ecr.sa-east-1.amazonaws.com/push-courier:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-india-courier.yaml b/.github/workflows/build-production-india-courier.yaml index b5b8f26cc..2f3bd8456 100644 --- a/.github/workflows/build-production-india-courier.yaml +++ b/.github/workflows/build-production-india-courier.yaml @@ -1,39 +1,39 @@ -name: Build Production India RP-courier -on: - push: - tags: - - 'v*.*.*' - - '!v*.*.*-staging*' - - '!v*.*.*-develop*' -jobs: - docker: - runs-on: ubuntu-latest - environment: - name: production-india - steps: - - name: Set output - id: vars - run: echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: main - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to ECR - uses: docker/login-action@v1 - with: - registry: 242357350604.dkr.ecr.ap-south-1.amazonaws.com - username: ${{ secrets.AWS_ACCESS_KEY_ID }} - password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: Build and push - Courier Image - id: docker_build1 - uses: docker/build-push-action@v2 - with: - context: . - file: docker/Dockerfile - push: true - tags: 242357350604.dkr.ecr.ap-south-1.amazonaws.com/courier:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Production India RP-courier +# on: +# push: +# tags: +# - 'v*.*.*' +# - '!v*.*.*-staging*' +# - '!v*.*.*-develop*' +# jobs: +# docker: +# runs-on: ubuntu-latest +# environment: +# name: production-india +# steps: +# - name: Set output +# id: vars +# run: echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); +# - name: Check out the repo +# uses: actions/checkout@v2 +# with: +# ref: main +# - name: Set up QEMU +# uses: docker/setup-qemu-action@v1 +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v1 +# - name: Login to ECR +# uses: docker/login-action@v1 +# with: +# registry: 242357350604.dkr.ecr.ap-south-1.amazonaws.com +# username: ${{ secrets.AWS_ACCESS_KEY_ID }} +# password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# - name: Build and push - Courier Image +# id: docker_build1 +# uses: docker/build-push-action@v2 +# with: +# context: . +# file: docker/Dockerfile +# push: true +# tags: 242357350604.dkr.ecr.ap-south-1.amazonaws.com/courier:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-ireland-courier.yaml b/.github/workflows/build-production-ireland-courier.yaml index 42f9a941e..5a20fc2a2 100644 --- a/.github/workflows/build-production-ireland-courier.yaml +++ b/.github/workflows/build-production-ireland-courier.yaml @@ -1,39 +1,39 @@ -name: Build Production Ireland RP-Courier -on: - push: - tags: - - 'v*.*.*' - - '!v*.*.*-staging*' - - '!v*.*.*-develop*' -jobs: - docker: - runs-on: ubuntu-latest - environment: - name: production-ireland - steps: - - name: Set output - id: vars - run: echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: main - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to ECR - uses: docker/login-action@v1 - with: - registry: 452158872079.dkr.ecr.eu-west-1.amazonaws.com - username: ${{ secrets.AWS_ACCESS_KEY_ID }} - password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: Build and push - Courier Image - id: docker_build1 - uses: docker/build-push-action@v2 - with: - context: . - file: docker/Dockerfile - push: true - tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-courier-rapidpro:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Production Ireland RP-Courier +# on: +# push: +# tags: +# - 'v*.*.*' +# - '!v*.*.*-staging*' +# - '!v*.*.*-develop*' +# jobs: +# docker: +# runs-on: ubuntu-latest +# environment: +# name: production-ireland +# steps: +# - name: Set output +# id: vars +# run: echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); +# - name: Check out the repo +# uses: actions/checkout@v2 +# with: +# ref: main +# - name: Set up QEMU +# uses: docker/setup-qemu-action@v1 +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v1 +# - name: Login to ECR +# uses: docker/login-action@v1 +# with: +# registry: 452158872079.dkr.ecr.eu-west-1.amazonaws.com +# username: ${{ secrets.AWS_ACCESS_KEY_ID }} +# password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# - name: Build and push - Courier Image +# id: docker_build1 +# uses: docker/build-push-action@v2 +# with: +# context: . +# file: docker/Dockerfile +# push: true +# tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-courier-rapidpro:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-sp-courier.yaml b/.github/workflows/build-production-sp-courier.yaml index a08e7901f..381e28c08 100644 --- a/.github/workflows/build-production-sp-courier.yaml +++ b/.github/workflows/build-production-sp-courier.yaml @@ -1,40 +1,40 @@ -name: Build Production SP RP-Courier -on: - push: - tags: - - 'v*.*.*' - - '!v*.*.*-staging*' - - '!v*.*.*-develop*' -jobs: - docker: - runs-on: ubuntu-latest - environment: - name: production - steps: - - name: Set output - id: vars - run: | - echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: main - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to ECR - uses: docker/login-action@v1 - with: - registry: 242357350604.dkr.ecr.sa-east-1.amazonaws.com - username: ${{ secrets.AWS_ACCESS_KEY_ID }} - password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: Build and push - Courier Image - id: docker_build1 - uses: docker/build-push-action@v2 - with: - context: . - file: docker/Dockerfile - push: true - tags: 242357350604.dkr.ecr.sa-east-1.amazonaws.com/push-courier:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Production SP RP-Courier +# on: +# push: +# tags: +# - 'v*.*.*' +# - '!v*.*.*-staging*' +# - '!v*.*.*-develop*' +# jobs: +# docker: +# runs-on: ubuntu-latest +# environment: +# name: production +# steps: +# - name: Set output +# id: vars +# run: | +# echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); +# - name: Check out the repo +# uses: actions/checkout@v2 +# with: +# ref: main +# - name: Set up QEMU +# uses: docker/setup-qemu-action@v1 +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v1 +# - name: Login to ECR +# uses: docker/login-action@v1 +# with: +# registry: 242357350604.dkr.ecr.sa-east-1.amazonaws.com +# username: ${{ secrets.AWS_ACCESS_KEY_ID }} +# password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# - name: Build and push - Courier Image +# id: docker_build1 +# uses: docker/build-push-action@v2 +# with: +# context: . +# file: docker/Dockerfile +# push: true +# tags: 242357350604.dkr.ecr.sa-east-1.amazonaws.com/push-courier:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-staging-india-courier.yaml b/.github/workflows/build-staging-india-courier.yaml index 66624e5d0..2a45b25d5 100644 --- a/.github/workflows/build-staging-india-courier.yaml +++ b/.github/workflows/build-staging-india-courier.yaml @@ -1,37 +1,37 @@ -name: Build Staging India RP-courier -on: - push: - tags: - - 'v*.*.*-staging*' -jobs: - docker: - runs-on: ubuntu-latest - environment: - name: staging-india - steps: - - name: Set output - id: vars - run: echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: main - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to ECR - uses: docker/login-action@v1 - with: - registry: 242357350604.dkr.ecr.ap-south-1.amazonaws.com - username: ${{ secrets.AWS_ACCESS_KEY_ID }} - password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: Build and push - Courier Image - id: docker_build1 - uses: docker/build-push-action@v2 - with: - context: . - file: docker/Dockerfile - push: true - tags: 242357350604.dkr.ecr.ap-south-1.amazonaws.com/courier:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Staging India RP-courier +# on: +# push: +# tags: +# - 'v*.*.*-staging*' +# jobs: +# docker: +# runs-on: ubuntu-latest +# environment: +# name: staging-india +# steps: +# - name: Set output +# id: vars +# run: echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); +# - name: Check out the repo +# uses: actions/checkout@v2 +# with: +# ref: main +# - name: Set up QEMU +# uses: docker/setup-qemu-action@v1 +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v1 +# - name: Login to ECR +# uses: docker/login-action@v1 +# with: +# registry: 242357350604.dkr.ecr.ap-south-1.amazonaws.com +# username: ${{ secrets.AWS_ACCESS_KEY_ID }} +# password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# - name: Build and push - Courier Image +# id: docker_build1 +# uses: docker/build-push-action@v2 +# with: +# context: . +# file: docker/Dockerfile +# push: true +# tags: 242357350604.dkr.ecr.ap-south-1.amazonaws.com/courier:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-staging-ireland-courier.yaml b/.github/workflows/build-staging-ireland-courier.yaml index 738a6c5ff..0b251402d 100644 --- a/.github/workflows/build-staging-ireland-courier.yaml +++ b/.github/workflows/build-staging-ireland-courier.yaml @@ -1,37 +1,37 @@ -name: Build Staging Ireland RP-Courier -on: - push: - tags: - - 'v*.*.*-staging*' -jobs: - docker: - runs-on: ubuntu-latest - environment: - name: staging-ireland - steps: - - name: Set output - id: vars - run: echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: main - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to ECR - uses: docker/login-action@v1 - with: - registry: 452158872079.dkr.ecr.eu-west-1.amazonaws.com - username: ${{ secrets.AWS_ACCESS_KEY_ID }} - password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: Build and push - Courier Image - id: docker_build1 - uses: docker/build-push-action@v2 - with: - context: . - file: docker/Dockerfile - push: true - tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-courier-rapidpro:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Staging Ireland RP-Courier +# on: +# push: +# tags: +# - 'v*.*.*-staging*' +# jobs: +# docker: +# runs-on: ubuntu-latest +# environment: +# name: staging-ireland +# steps: +# - name: Set output +# id: vars +# run: echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); +# - name: Check out the repo +# uses: actions/checkout@v2 +# with: +# ref: main +# - name: Set up QEMU +# uses: docker/setup-qemu-action@v1 +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v1 +# - name: Login to ECR +# uses: docker/login-action@v1 +# with: +# registry: 452158872079.dkr.ecr.eu-west-1.amazonaws.com +# username: ${{ secrets.AWS_ACCESS_KEY_ID }} +# password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# - name: Build and push - Courier Image +# id: docker_build1 +# uses: docker/build-push-action@v2 +# with: +# context: . +# file: docker/Dockerfile +# push: true +# tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-courier-rapidpro:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-staging-sp-courier.yaml b/.github/workflows/build-staging-sp-courier.yaml index a5dc164e4..3cd50ae49 100644 --- a/.github/workflows/build-staging-sp-courier.yaml +++ b/.github/workflows/build-staging-sp-courier.yaml @@ -1,38 +1,38 @@ -name: Build Staging SP RP-Courier -on: - push: - tags: - - 'v*.*.*-staging*' -jobs: - docker: - runs-on: ubuntu-latest - environment: - name: staging - steps: - - name: Set output - id: vars - run: | - echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: main - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to ECR - uses: docker/login-action@v1 - with: - registry: 242357350604.dkr.ecr.sa-east-1.amazonaws.com - username: ${{ secrets.AWS_ACCESS_KEY_ID }} - password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: Build and push - Courier Image - id: docker_build1 - uses: docker/build-push-action@v2 - with: - context: . - file: docker/Dockerfile - push: true - tags: 242357350604.dkr.ecr.sa-east-1.amazonaws.com/push-courier:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Staging SP RP-Courier +# on: +# push: +# tags: +# - 'v*.*.*-staging*' +# jobs: +# docker: +# runs-on: ubuntu-latest +# environment: +# name: staging +# steps: +# - name: Set output +# id: vars +# run: | +# echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3-|cut -d'-' -f1-2); +# - name: Check out the repo +# uses: actions/checkout@v2 +# with: +# ref: main +# - name: Set up QEMU +# uses: docker/setup-qemu-action@v1 +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v1 +# - name: Login to ECR +# uses: docker/login-action@v1 +# with: +# registry: 242357350604.dkr.ecr.sa-east-1.amazonaws.com +# username: ${{ secrets.AWS_ACCESS_KEY_ID }} +# password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# - name: Build and push - Courier Image +# id: docker_build1 +# uses: docker/build-push-action@v2 +# with: +# context: . +# file: docker/Dockerfile +# push: true +# tags: 242357350604.dkr.ecr.sa-east-1.amazonaws.com/push-courier:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file