From a9ec8096b09dd2ef106183728114980a2fd3fa3e Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Thu, 23 Sep 2021 18:36:26 -0300 Subject: [PATCH 01/14] Add workflows to build Mailroom images --- .../build-develop-india-mailroom.yaml | 37 +++++++++++++++++++ .../build-develop-ireland-mailroom.yaml | 37 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .github/workflows/build-develop-india-mailroom.yaml create mode 100644 .github/workflows/build-develop-ireland-mailroom.yaml diff --git a/.github/workflows/build-develop-india-mailroom.yaml b/.github/workflows/build-develop-india-mailroom.yaml new file mode 100644 index 000000000..66db1c8fb --- /dev/null +++ b/.github/workflows/build-develop-india-mailroom.yaml @@ -0,0 +1,37 @@ +name: Build Develop India Mailroom +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.6 + - 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 - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-develop-ireland-mailroom.yaml b/.github/workflows/build-develop-ireland-mailroom.yaml new file mode 100644 index 000000000..a81e26b61 --- /dev/null +++ b/.github/workflows/build-develop-ireland-mailroom.yaml @@ -0,0 +1,37 @@ +name: Build Develop Ireland Mailroom +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.6 + - 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 - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file From ccfe82109ea7cdd4e679f6c753c6eb5854b72711 Mon Sep 17 00:00:00 2001 From: cicerow-weni <86980297+cicerow-weni@users.noreply.github.com> Date: Fri, 24 Sep 2021 09:04:26 -0300 Subject: [PATCH 02/14] Fix repository path --- .github/workflows/build-develop-ireland-mailroom.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-develop-ireland-mailroom.yaml b/.github/workflows/build-develop-ireland-mailroom.yaml index a81e26b61..30dd369f2 100644 --- a/.github/workflows/build-develop-ireland-mailroom.yaml +++ b/.github/workflows/build-develop-ireland-mailroom.yaml @@ -33,5 +33,5 @@ jobs: context: . file: docker/Dockerfile push: true - tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/mailroom:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file + tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-mailroom-rapidpro:${{ steps.vars.outputs.tag }} + no-cache: true From 277dfe3de3de0fa014f690372e064c2b09eeb422 Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Thu, 30 Sep 2021 17:03:35 -0300 Subject: [PATCH 03/14] Fix tag based Actions --- .../build-develop-india-mailroom.yaml | 16 ++++--- .../build-develop-ireland-mailroom.yaml | 16 ++++--- .../workflows/build-develop-sp-mailroom.yaml | 43 +++++++++++++++++++ .../build-production-india-mailroom.yaml | 39 +++++++++++++++++ .../build-production-ireland-mailroom.yaml | 41 ++++++++++++++++++ .../build-production-sp-mailroom.yaml | 43 +++++++++++++++++++ 6 files changed, 186 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/build-develop-sp-mailroom.yaml create mode 100644 .github/workflows/build-production-india-mailroom.yaml create mode 100644 .github/workflows/build-production-ireland-mailroom.yaml create mode 100644 .github/workflows/build-production-sp-mailroom.yaml diff --git a/.github/workflows/build-develop-india-mailroom.yaml b/.github/workflows/build-develop-india-mailroom.yaml index 66db1c8fb..e3be71ef0 100644 --- a/.github/workflows/build-develop-india-mailroom.yaml +++ b/.github/workflows/build-develop-india-mailroom.yaml @@ -1,25 +1,27 @@ name: Build Develop India Mailroom 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: - ref: feature/build + with: + ref: ${{ steps.vars.ouptuts.branch }} - 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.6 - name: Login to ECR uses: docker/login-action@v1 with: diff --git a/.github/workflows/build-develop-ireland-mailroom.yaml b/.github/workflows/build-develop-ireland-mailroom.yaml index a81e26b61..1b875845d 100644 --- a/.github/workflows/build-develop-ireland-mailroom.yaml +++ b/.github/workflows/build-develop-ireland-mailroom.yaml @@ -1,14 +1,23 @@ name: Build Develop Ireland Mailroom 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: + ref: ${{ steps.vars.ouptuts.branch }} - name: Check out the repo uses: actions/checkout@v2 with: @@ -17,9 +26,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.6 - name: Login to ECR uses: docker/login-action@v1 with: diff --git a/.github/workflows/build-develop-sp-mailroom.yaml b/.github/workflows/build-develop-sp-mailroom.yaml new file mode 100644 index 000000000..54615e9a6 --- /dev/null +++ b/.github/workflows/build-develop-sp-mailroom.yaml @@ -0,0 +1,43 @@ +name: Build Develop SP Mailroom +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: ${{ steps.vars.ouptuts.branch }} + - 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 - Mailroom 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-mailroom:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-india-mailroom.yaml b/.github/workflows/build-production-india-mailroom.yaml new file mode 100644 index 000000000..25b1edd21 --- /dev/null +++ b/.github/workflows/build-production-india-mailroom.yaml @@ -0,0 +1,39 @@ +name: Build Production India Mailroom +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 - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-ireland-mailroom.yaml b/.github/workflows/build-production-ireland-mailroom.yaml new file mode 100644 index 000000000..29bfd6979 --- /dev/null +++ b/.github/workflows/build-production-ireland-mailroom.yaml @@ -0,0 +1,41 @@ +name: Build Production Ireland Mailroom +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=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: main + - 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 - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-sp-mailroom.yaml b/.github/workflows/build-production-sp-mailroom.yaml new file mode 100644 index 000000000..2b4569905 --- /dev/null +++ b/.github/workflows/build-production-sp-mailroom.yaml @@ -0,0 +1,43 @@ +name: Build Production SP Mailroom +on: + push: + tags: + - '!v*.*.*-staging*' + - '!v*.*.*-develop*' + - 'v*.*.*' +jobs: + docker: + runs-on: ubuntu-latest + environment: + name: develop + 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: ${{ steps.vars.ouptuts.branch }} + - 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 - Mailroom 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-mailroom:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file From 21840e4a310cb6f43aaf7869575462f972556663 Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Thu, 23 Sep 2021 18:36:26 -0300 Subject: [PATCH 04/14] Add workflows to build Mailroom images --- .../build-develop-india-mailroom.yaml | 37 +++++++++++++++++++ .../build-develop-ireland-mailroom.yaml | 37 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .github/workflows/build-develop-india-mailroom.yaml create mode 100644 .github/workflows/build-develop-ireland-mailroom.yaml diff --git a/.github/workflows/build-develop-india-mailroom.yaml b/.github/workflows/build-develop-india-mailroom.yaml new file mode 100644 index 000000000..66db1c8fb --- /dev/null +++ b/.github/workflows/build-develop-india-mailroom.yaml @@ -0,0 +1,37 @@ +name: Build Develop India Mailroom +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.6 + - 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 - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-develop-ireland-mailroom.yaml b/.github/workflows/build-develop-ireland-mailroom.yaml new file mode 100644 index 000000000..a81e26b61 --- /dev/null +++ b/.github/workflows/build-develop-ireland-mailroom.yaml @@ -0,0 +1,37 @@ +name: Build Develop Ireland Mailroom +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.6 + - 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 - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file From 343d5469eb3809125534308976b2986caec33bad Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Thu, 30 Sep 2021 17:03:35 -0300 Subject: [PATCH 05/14] Fix tag based Actions --- .../build-develop-india-mailroom.yaml | 16 ++++--- .../build-develop-ireland-mailroom.yaml | 16 ++++--- .../workflows/build-develop-sp-mailroom.yaml | 43 +++++++++++++++++++ .../build-production-india-mailroom.yaml | 39 +++++++++++++++++ .../build-production-ireland-mailroom.yaml | 41 ++++++++++++++++++ .../build-production-sp-mailroom.yaml | 43 +++++++++++++++++++ 6 files changed, 186 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/build-develop-sp-mailroom.yaml create mode 100644 .github/workflows/build-production-india-mailroom.yaml create mode 100644 .github/workflows/build-production-ireland-mailroom.yaml create mode 100644 .github/workflows/build-production-sp-mailroom.yaml diff --git a/.github/workflows/build-develop-india-mailroom.yaml b/.github/workflows/build-develop-india-mailroom.yaml index 66db1c8fb..e3be71ef0 100644 --- a/.github/workflows/build-develop-india-mailroom.yaml +++ b/.github/workflows/build-develop-india-mailroom.yaml @@ -1,25 +1,27 @@ name: Build Develop India Mailroom 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: - ref: feature/build + with: + ref: ${{ steps.vars.ouptuts.branch }} - 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.6 - name: Login to ECR uses: docker/login-action@v1 with: diff --git a/.github/workflows/build-develop-ireland-mailroom.yaml b/.github/workflows/build-develop-ireland-mailroom.yaml index a81e26b61..1b875845d 100644 --- a/.github/workflows/build-develop-ireland-mailroom.yaml +++ b/.github/workflows/build-develop-ireland-mailroom.yaml @@ -1,14 +1,23 @@ name: Build Develop Ireland Mailroom 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: + ref: ${{ steps.vars.ouptuts.branch }} - name: Check out the repo uses: actions/checkout@v2 with: @@ -17,9 +26,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.6 - name: Login to ECR uses: docker/login-action@v1 with: diff --git a/.github/workflows/build-develop-sp-mailroom.yaml b/.github/workflows/build-develop-sp-mailroom.yaml new file mode 100644 index 000000000..54615e9a6 --- /dev/null +++ b/.github/workflows/build-develop-sp-mailroom.yaml @@ -0,0 +1,43 @@ +name: Build Develop SP Mailroom +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: ${{ steps.vars.ouptuts.branch }} + - 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 - Mailroom 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-mailroom:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-india-mailroom.yaml b/.github/workflows/build-production-india-mailroom.yaml new file mode 100644 index 000000000..25b1edd21 --- /dev/null +++ b/.github/workflows/build-production-india-mailroom.yaml @@ -0,0 +1,39 @@ +name: Build Production India Mailroom +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 - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-ireland-mailroom.yaml b/.github/workflows/build-production-ireland-mailroom.yaml new file mode 100644 index 000000000..29bfd6979 --- /dev/null +++ b/.github/workflows/build-production-ireland-mailroom.yaml @@ -0,0 +1,41 @@ +name: Build Production Ireland Mailroom +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=tag::$(echo ${GITHUB_REF#refs/heads/}|cut -d'/' -f3); + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: main + - 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 - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-sp-mailroom.yaml b/.github/workflows/build-production-sp-mailroom.yaml new file mode 100644 index 000000000..2b4569905 --- /dev/null +++ b/.github/workflows/build-production-sp-mailroom.yaml @@ -0,0 +1,43 @@ +name: Build Production SP Mailroom +on: + push: + tags: + - '!v*.*.*-staging*' + - '!v*.*.*-develop*' + - 'v*.*.*' +jobs: + docker: + runs-on: ubuntu-latest + environment: + name: develop + 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: ${{ steps.vars.ouptuts.branch }} + - 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 - Mailroom 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-mailroom:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file From 3b2bd59aa6bc07c96be89495110e7b1c30f2f99c Mon Sep 17 00:00:00 2001 From: cicerow-weni <86980297+cicerow-weni@users.noreply.github.com> Date: Fri, 24 Sep 2021 09:04:26 -0300 Subject: [PATCH 06/14] Fix repository path --- .github/workflows/build-develop-ireland-mailroom.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-develop-ireland-mailroom.yaml b/.github/workflows/build-develop-ireland-mailroom.yaml index 1b875845d..26cb2f547 100644 --- a/.github/workflows/build-develop-ireland-mailroom.yaml +++ b/.github/workflows/build-develop-ireland-mailroom.yaml @@ -39,5 +39,5 @@ jobs: context: . file: docker/Dockerfile push: true - tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/mailroom:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file + tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-mailroom-rapidpro:${{ steps.vars.outputs.tag }} + no-cache: true From 43144ec5056b17a73156863dba5688b6d6ca3d5b Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Thu, 30 Sep 2021 17:16:58 -0300 Subject: [PATCH 07/14] Fix tag based Actions --- .github/workflows/build-production-ireland-mailroom.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-production-ireland-mailroom.yaml b/.github/workflows/build-production-ireland-mailroom.yaml index 29bfd6979..6893bd0f5 100644 --- a/.github/workflows/build-production-ireland-mailroom.yaml +++ b/.github/workflows/build-production-ireland-mailroom.yaml @@ -2,7 +2,9 @@ name: Build Production Ireland Mailroom on: push: tags: - - 'v*.*.*-develop*' + - '!v*.*.*-staging*' + - '!v*.*.*-develop*' + - 'v*.*.*' jobs: docker: runs-on: ubuntu-latest From ca7ce7ac32a067535211c44210a2b673fe27b75c Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Thu, 30 Sep 2021 17:18:39 -0300 Subject: [PATCH 08/14] Fix tag based Actions --- .github/workflows/build-production-ireland-mailroom.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build-production-ireland-mailroom.yaml b/.github/workflows/build-production-ireland-mailroom.yaml index d808aace4..6893bd0f5 100644 --- a/.github/workflows/build-production-ireland-mailroom.yaml +++ b/.github/workflows/build-production-ireland-mailroom.yaml @@ -2,13 +2,9 @@ name: Build Production Ireland Mailroom on: push: tags: -<<<<<<< HEAD - '!v*.*.*-staging*' - '!v*.*.*-develop*' - 'v*.*.*' -======= - - 'v*.*.*-develop*' ->>>>>>> 3b2bd59aa6bc07c96be89495110e7b1c30f2f99c jobs: docker: runs-on: ubuntu-latest From dedc49c048e675b34d179c0b43717a122ed1a827 Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Thu, 30 Sep 2021 17:33:12 -0300 Subject: [PATCH 09/14] Fix tag based Actions --- .github/workflows/build-production-sp-mailroom.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-production-sp-mailroom.yaml b/.github/workflows/build-production-sp-mailroom.yaml index 2b4569905..10dd7bbf3 100644 --- a/.github/workflows/build-production-sp-mailroom.yaml +++ b/.github/workflows/build-production-sp-mailroom.yaml @@ -9,7 +9,7 @@ jobs: docker: runs-on: ubuntu-latest environment: - name: develop + name: production steps: - name: Set output id: vars From 08c1cc73a7ce38ed5de7c4058e279c5d3caea9ea Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Fri, 1 Oct 2021 16:11:24 -0300 Subject: [PATCH 10/14] Check and Fix all GitHub Actions files to build images --- .../build-production-india-mailroom.yaml | 2 +- .../build-production-ireland-mailroom.yaml | 2 +- .../build-production-sp-mailroom.yaml | 2 +- .../build-staging-india-mailroom.yaml | 37 +++++++++++++++++ .../build-staging-ireland-mailroom.yaml | 41 +++++++++++++++++++ .../workflows/build-staging-sp-mailroom.yaml | 41 +++++++++++++++++++ 6 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build-staging-india-mailroom.yaml create mode 100644 .github/workflows/build-staging-ireland-mailroom.yaml create mode 100644 .github/workflows/build-staging-sp-mailroom.yaml diff --git a/.github/workflows/build-production-india-mailroom.yaml b/.github/workflows/build-production-india-mailroom.yaml index 25b1edd21..51c59cf10 100644 --- a/.github/workflows/build-production-india-mailroom.yaml +++ b/.github/workflows/build-production-india-mailroom.yaml @@ -2,9 +2,9 @@ name: Build Production India Mailroom on: push: tags: + - 'v*.*.*' - '!v*.*.*-staging*' - '!v*.*.*-develop*' - - 'v*.*.*' jobs: docker: runs-on: ubuntu-latest diff --git a/.github/workflows/build-production-ireland-mailroom.yaml b/.github/workflows/build-production-ireland-mailroom.yaml index 6893bd0f5..da1e8722b 100644 --- a/.github/workflows/build-production-ireland-mailroom.yaml +++ b/.github/workflows/build-production-ireland-mailroom.yaml @@ -2,9 +2,9 @@ name: Build Production Ireland Mailroom on: push: tags: + - 'v*.*.*' - '!v*.*.*-staging*' - '!v*.*.*-develop*' - - 'v*.*.*' jobs: docker: runs-on: ubuntu-latest diff --git a/.github/workflows/build-production-sp-mailroom.yaml b/.github/workflows/build-production-sp-mailroom.yaml index 10dd7bbf3..e6d89e66d 100644 --- a/.github/workflows/build-production-sp-mailroom.yaml +++ b/.github/workflows/build-production-sp-mailroom.yaml @@ -2,9 +2,9 @@ name: Build Production SP Mailroom on: push: tags: + - 'v*.*.*' - '!v*.*.*-staging*' - '!v*.*.*-develop*' - - 'v*.*.*' jobs: docker: runs-on: ubuntu-latest diff --git a/.github/workflows/build-staging-india-mailroom.yaml b/.github/workflows/build-staging-india-mailroom.yaml new file mode 100644 index 000000000..803adc87a --- /dev/null +++ b/.github/workflows/build-staging-india-mailroom.yaml @@ -0,0 +1,37 @@ +name: Build Staging India Mailroom +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 - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-staging-ireland-mailroom.yaml b/.github/workflows/build-staging-ireland-mailroom.yaml new file mode 100644 index 000000000..9ef9e4fee --- /dev/null +++ b/.github/workflows/build-staging-ireland-mailroom.yaml @@ -0,0 +1,41 @@ +name: Build Staging Ireland Mailroom +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: 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 - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-staging-sp-mailroom.yaml b/.github/workflows/build-staging-sp-mailroom.yaml new file mode 100644 index 000000000..14a8d7ed7 --- /dev/null +++ b/.github/workflows/build-staging-sp-mailroom.yaml @@ -0,0 +1,41 @@ +name: Build Staging SP Mailroom +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); + - name: Check out the repo + uses: actions/checkout@v2 + with: + ref: ${{ steps.vars.ouptuts.branch }} + - 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 - Mailroom 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-mailroom:${{ steps.vars.outputs.tag }} + no-cache: true \ No newline at end of file From 676fd8424a71161f46e34c52d7b976d5bab5be45 Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Fri, 1 Oct 2021 16:49:24 -0300 Subject: [PATCH 11/14] Check and Fix all GitHub Actions files to build images --- .github/workflows/build-develop-sp-mailroom.yaml | 2 +- .github/workflows/build-production-sp-mailroom.yaml | 2 +- .github/workflows/build-staging-sp-mailroom.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-develop-sp-mailroom.yaml b/.github/workflows/build-develop-sp-mailroom.yaml index 54615e9a6..50c1f59a1 100644 --- a/.github/workflows/build-develop-sp-mailroom.yaml +++ b/.github/workflows/build-develop-sp-mailroom.yaml @@ -29,7 +29,7 @@ jobs: - name: Login to ECR uses: docker/login-action@v1 with: - registry: 452158872079.dkr.ecr.eu-west-1.amazonaws.com + 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 - Mailroom Image diff --git a/.github/workflows/build-production-sp-mailroom.yaml b/.github/workflows/build-production-sp-mailroom.yaml index e6d89e66d..137488956 100644 --- a/.github/workflows/build-production-sp-mailroom.yaml +++ b/.github/workflows/build-production-sp-mailroom.yaml @@ -29,7 +29,7 @@ jobs: - name: Login to ECR uses: docker/login-action@v1 with: - registry: 452158872079.dkr.ecr.eu-west-1.amazonaws.com + 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 - Mailroom Image diff --git a/.github/workflows/build-staging-sp-mailroom.yaml b/.github/workflows/build-staging-sp-mailroom.yaml index 14a8d7ed7..95a3a4a95 100644 --- a/.github/workflows/build-staging-sp-mailroom.yaml +++ b/.github/workflows/build-staging-sp-mailroom.yaml @@ -27,7 +27,7 @@ jobs: - name: Login to ECR uses: docker/login-action@v1 with: - registry: 452158872079.dkr.ecr.eu-west-1.amazonaws.com + registry: 242357350604.dkr.ecr.sa-east-1.amazonaws.com/push-mailroom username: ${{ secrets.AWS_ACCESS_KEY_ID }} password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - name: Build and push - Mailroom Image From ce46d0b77e8452b707c667731a25694ee87e0d89 Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Fri, 1 Oct 2021 17:10:13 -0300 Subject: [PATCH 12/14] Check and Fix all GitHub Actions files to build images --- .github/workflows/build-staging-ireland-mailroom.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-staging-ireland-mailroom.yaml b/.github/workflows/build-staging-ireland-mailroom.yaml index 9ef9e4fee..4eed9562c 100644 --- a/.github/workflows/build-staging-ireland-mailroom.yaml +++ b/.github/workflows/build-staging-ireland-mailroom.yaml @@ -37,5 +37,5 @@ jobs: context: . file: docker/Dockerfile push: true - tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/mailroom:${{ steps.vars.outputs.tag }} + tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-mailroom-rapidpro:${{ steps.vars.outputs.tag }} no-cache: true \ No newline at end of file From 63a9afb2e8f3ed06cc2f3a9266b753bce7400a82 Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Fri, 1 Oct 2021 17:15:18 -0300 Subject: [PATCH 13/14] Check and Fix all GitHub Actions files to build images --- .github/workflows/build-production-ireland-mailroom.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-production-ireland-mailroom.yaml b/.github/workflows/build-production-ireland-mailroom.yaml index da1e8722b..4ab0a2930 100644 --- a/.github/workflows/build-production-ireland-mailroom.yaml +++ b/.github/workflows/build-production-ireland-mailroom.yaml @@ -39,5 +39,5 @@ jobs: context: . file: docker/Dockerfile push: true - tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/mailroom:${{ steps.vars.outputs.tag }} + tags: 452158872079.dkr.ecr.eu-west-1.amazonaws.com/rp-mailroom-rapidpro:${{ steps.vars.outputs.tag }} no-cache: true \ No newline at end of file From 7e282f2119f270f6729ef9f78550250f1338124f Mon Sep 17 00:00:00 2001 From: Cicero Woshington Date: Thu, 2 Dec 2021 17:00:53 -0300 Subject: [PATCH 14/14] Change Github token used in secret, deactivate old builds --- .../build-develop-india-mailroom.yaml | 78 ++++----- .../build-develop-ireland-mailroom.yaml | 86 +++++----- .../workflows/build-develop-sp-mailroom.yaml | 86 +++++----- .../build-mailroom-dispatch-shared.yaml | 123 ++++++++++++++ .../build-mailroom-push-tag-shared.yaml | 159 ++++++++++++++++++ .../build-production-india-mailroom.yaml | 78 ++++----- .../build-production-ireland-mailroom.yaml | 86 +++++----- .../build-production-sp-mailroom.yaml | 86 +++++----- .../build-staging-india-mailroom.yaml | 74 ++++---- .../build-staging-ireland-mailroom.yaml | 82 ++++----- .../workflows/build-staging-sp-mailroom.yaml | 82 ++++----- 11 files changed, 651 insertions(+), 369 deletions(-) create mode 100644 .github/workflows/build-mailroom-dispatch-shared.yaml create mode 100644 .github/workflows/build-mailroom-push-tag-shared.yaml diff --git a/.github/workflows/build-develop-india-mailroom.yaml b/.github/workflows/build-develop-india-mailroom.yaml index e3be71ef0..4b75bea35 100644 --- a/.github/workflows/build-develop-india-mailroom.yaml +++ b/.github/workflows/build-develop-india-mailroom.yaml @@ -1,39 +1,39 @@ -name: Build Develop India Mailroom -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: ${{ steps.vars.ouptuts.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: 242357350604.dkr.ecr.ap-south-1.amazonaws.com - username: ${{ secrets.AWS_ACCESS_KEY_ID }} - password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: Build and push - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Develop India Mailroom +# 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: ${{ steps.vars.ouptuts.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: 242357350604.dkr.ecr.ap-south-1.amazonaws.com +# username: ${{ secrets.AWS_ACCESS_KEY_ID }} +# password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# - name: Build and push - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-develop-ireland-mailroom.yaml b/.github/workflows/build-develop-ireland-mailroom.yaml index 26cb2f547..cc0de0b5d 100644 --- a/.github/workflows/build-develop-ireland-mailroom.yaml +++ b/.github/workflows/build-develop-ireland-mailroom.yaml @@ -1,43 +1,43 @@ -name: Build Develop Ireland Mailroom -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: ${{ steps.vars.ouptuts.branch }} - - 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 - Mailroom 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-mailroom-rapidpro:${{ steps.vars.outputs.tag }} - no-cache: true +# name: Build Develop Ireland Mailroom +# 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: ${{ steps.vars.ouptuts.branch }} +# - 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 - Mailroom 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-mailroom-rapidpro:${{ steps.vars.outputs.tag }} +# no-cache: true diff --git a/.github/workflows/build-develop-sp-mailroom.yaml b/.github/workflows/build-develop-sp-mailroom.yaml index 50c1f59a1..dfec1cdee 100644 --- a/.github/workflows/build-develop-sp-mailroom.yaml +++ b/.github/workflows/build-develop-sp-mailroom.yaml @@ -1,43 +1,43 @@ -name: Build Develop SP Mailroom -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: ${{ steps.vars.ouptuts.branch }} - - 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 - Mailroom 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-mailroom:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Develop SP Mailroom +# 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: ${{ steps.vars.ouptuts.branch }} +# - 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 - Mailroom 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-mailroom:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-mailroom-dispatch-shared.yaml b/.github/workflows/build-mailroom-dispatch-shared.yaml new file mode 100644 index 000000000..68541fd51 --- /dev/null +++ b/.github/workflows/build-mailroom-dispatch-shared.yaml @@ -0,0 +1,123 @@ +name: Build Rapidpro Mailroom in Shared (Dispatch) + +on: + workflow_dispatch: + inputs: + + source-branch: + description: 'Source branch in Mailroom 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 - Mailroom 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/mailroom + file: ./docker/Dockerfile + push: true + tags: 869898323958.dkr.ecr.us-east-1.amazonaws.com/mailroom:${{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/mailroom:${{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/mailroom" 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 Mailroom 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-mailroom-push-tag-shared.yaml b/.github/workflows/build-mailroom-push-tag-shared.yaml new file mode 100644 index 000000000..6ab056f8f --- /dev/null +++ b/.github/workflows/build-mailroom-push-tag-shared.yaml @@ -0,0 +1,159 @@ +name: Build Rapidpro Mailroom 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/mailroom:$TAG" >> $GITHUB_ENV + echo "IMAGE_TAG=869898323958.dkr.ecr.us-east-1.amazonaws.com/mailroom:$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/mailroom:$TAG" >> $GITHUB_ENV + echo "IMAGE_TAG=869898323958.dkr.ecr.us-east-1.amazonaws.com/mailroom:$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/mailroom:$TAG" >> $GITHUB_ENV + echo "IMAGE_TAG=869898323958.dkr.ecr.us-east-1.amazonaws.com/mailroom:$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/mailroom + + - 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/mailroom + 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/mailroom" 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 Mailroom Build (Push-Tag)" + + - name: Generated Image + run: | + echo "IMAGE: " ${{env.IMAGE_TAG}} \ No newline at end of file diff --git a/.github/workflows/build-production-india-mailroom.yaml b/.github/workflows/build-production-india-mailroom.yaml index 51c59cf10..7ffae5f23 100644 --- a/.github/workflows/build-production-india-mailroom.yaml +++ b/.github/workflows/build-production-india-mailroom.yaml @@ -1,39 +1,39 @@ -name: Build Production India Mailroom -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 - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Production India Mailroom +# 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 - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-ireland-mailroom.yaml b/.github/workflows/build-production-ireland-mailroom.yaml index 4ab0a2930..bb8e90199 100644 --- a/.github/workflows/build-production-ireland-mailroom.yaml +++ b/.github/workflows/build-production-ireland-mailroom.yaml @@ -1,43 +1,43 @@ -name: Build Production Ireland Mailroom -on: - push: - tags: - - 'v*.*.*' - - '!v*.*.*-staging*' - - '!v*.*.*-develop*' -jobs: - docker: - runs-on: ubuntu-latest - environment: - name: develop-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: 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 - Mailroom 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-mailroom-rapidpro:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Production Ireland Mailroom +# on: +# push: +# tags: +# - 'v*.*.*' +# - '!v*.*.*-staging*' +# - '!v*.*.*-develop*' +# jobs: +# docker: +# runs-on: ubuntu-latest +# environment: +# name: develop-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: 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 - Mailroom 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-mailroom-rapidpro:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-production-sp-mailroom.yaml b/.github/workflows/build-production-sp-mailroom.yaml index 137488956..4ede80908 100644 --- a/.github/workflows/build-production-sp-mailroom.yaml +++ b/.github/workflows/build-production-sp-mailroom.yaml @@ -1,43 +1,43 @@ -name: Build Production SP Mailroom -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); - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: ${{ steps.vars.ouptuts.branch }} - - 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 - Mailroom 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-mailroom:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Production SP Mailroom +# 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); +# - name: Check out the repo +# uses: actions/checkout@v2 +# with: +# ref: ${{ steps.vars.ouptuts.branch }} +# - 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 - Mailroom 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-mailroom:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-staging-india-mailroom.yaml b/.github/workflows/build-staging-india-mailroom.yaml index 803adc87a..4e3c2df33 100644 --- a/.github/workflows/build-staging-india-mailroom.yaml +++ b/.github/workflows/build-staging-india-mailroom.yaml @@ -1,37 +1,37 @@ -name: Build Staging India Mailroom -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 - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Staging India Mailroom +# 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 - Mailroom 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/mailroom:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-staging-ireland-mailroom.yaml b/.github/workflows/build-staging-ireland-mailroom.yaml index 4eed9562c..061888e54 100644 --- a/.github/workflows/build-staging-ireland-mailroom.yaml +++ b/.github/workflows/build-staging-ireland-mailroom.yaml @@ -1,41 +1,41 @@ -name: Build Staging Ireland Mailroom -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: 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 - Mailroom 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-mailroom-rapidpro:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Staging Ireland Mailroom +# 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: 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 - Mailroom 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-mailroom-rapidpro:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file diff --git a/.github/workflows/build-staging-sp-mailroom.yaml b/.github/workflows/build-staging-sp-mailroom.yaml index 95a3a4a95..0f162de0f 100644 --- a/.github/workflows/build-staging-sp-mailroom.yaml +++ b/.github/workflows/build-staging-sp-mailroom.yaml @@ -1,41 +1,41 @@ -name: Build Staging SP Mailroom -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); - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: ${{ steps.vars.ouptuts.branch }} - - 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/push-mailroom - username: ${{ secrets.AWS_ACCESS_KEY_ID }} - password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: Build and push - Mailroom 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-mailroom:${{ steps.vars.outputs.tag }} - no-cache: true \ No newline at end of file +# name: Build Staging SP Mailroom +# 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); +# - name: Check out the repo +# uses: actions/checkout@v2 +# with: +# ref: ${{ steps.vars.ouptuts.branch }} +# - 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/push-mailroom +# username: ${{ secrets.AWS_ACCESS_KEY_ID }} +# password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# - name: Build and push - Mailroom 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-mailroom:${{ steps.vars.outputs.tag }} +# no-cache: true \ No newline at end of file