Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAOPN-494: add new images to cd #215

Merged
merged 4 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/data/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '2'
version: '3.4'
volumes:
mariadb_data:
driver: local
Expand Down
6 changes: 6 additions & 0 deletions .github/data/master/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM bitnami/magento:2.4.5
MAINTAINER Open Source Team

WORKDIR /opt/bitnami/magento
COPY auth.json /opt/bitnami/magento
RUN composer require pagarme/pagarme-magento2-module:master
6 changes: 6 additions & 0 deletions .github/data/php8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM bitnami/magento:2.4.5
MAINTAINER Open Source Team

WORKDIR /opt/bitnami/magento
COPY auth.json /opt/bitnami/magento
RUN composer require pagarme/pagarme-magento2-module:dev-stg
2 changes: 1 addition & 1 deletion .github/data/Dockerfile → .github/data/stg/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ MAINTAINER Open Source Team

WORKDIR /opt/bitnami/magento
COPY auth.json /opt/bitnami/magento
RUN composer require pagarme/pagarme-magento2-module
RUN composer require pagarme/pagarme-magento2-module:dev-stg
6 changes: 6 additions & 0 deletions .github/data/test/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM bitnami/magento:2.4.3
MAINTAINER Open Source Team

WORKDIR /opt/bitnami/magento
COPY auth.json /opt/bitnami/magento
RUN composer require pagarme/pagarme-magento2-module:dev-test
17 changes: 17 additions & 0 deletions .github/workflows/cd_master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CD Master

on:
pull_request:
branches: ["master"]
types: closed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
call-workflow-cd:
uses: pagarme/magento2/.github/workflows/cd_reusable.yml@master
with:
matrix_tags: "['master']"
secrets:
inherit
44 changes: 21 additions & 23 deletions .github/workflows/cd.yml → .github/workflows/cd_reusable.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
name: CD
name: CD REUSABLE

on:
push:
branches:
- develop
- test
- stg
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
workflow_call:
inputs:
matrix_tags:
required: true
type: string

jobs:

publish:
strategy:
matrix:
tags: ${{ fromJson( inputs.matrix_tags ) }}
name: Publish
runs-on: ubuntu-latest
steps:
Expand All @@ -25,7 +23,7 @@ jobs:
run: |
cp .github/data/auth.json .
cp .github/data/docker-compose.yml .
cp .github/data/Dockerfile .
cp .github/data/${{ matrix.tags }}/Dockerfile .
cp .github/data/wait-for-mysql.sh .
cp .github/data/magento2_module_install.sql .
-
Expand Down Expand Up @@ -55,15 +53,15 @@ jobs:
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: mpdockerregistry.azurecr.io/magento2-pagarme:${{ matrix.tags }}
labels: ${{ steps.meta.outputs.labels }}
# name: Commit and push Docker image
# run: |
# sleep 5 && docker stop magento2_bitnami
# docker login ${{ secrets.DOCKER_ACCOUNT }} -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
# docker commit magento2_bitnami "magento2-pagarme:${{ github.ref_name }}"
# docker push "magento2-pagarme:${{ github.ref_name }}"
# name: Send deployment webhook to Rancher
# run: |
# BODY='{"push_data":{"tag":"'"${{ github.ref }}"'"},"repository":{"repo_name":"'"${{ secrets.DOCKER_ACCOUNT }}/${{ github.repository }}"'"}}'
# curl -X POST ${{ secrets.RANCHER_STG_DEPLOY_URL }} -H 'Content-Type: application/json' -d "${BODY}"
# name: Commit and push Docker image
# run: |
# sleep 5 && docker stop magento2_bitnami
# docker login ${{ secrets.DOCKER_ACCOUNT }} -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
# docker commit magento2_bitnami "magento2-pagarme:${{ github.ref_name }}"
# docker push "magento2-pagarme:${{ github.ref_name }}"
# name: Send deployment webhook to Rancher
# run: |
# BODY='{"push_data":{"tag":"'"${{ github.ref }}"'"},"repository":{"repo_name":"'"${{ secrets.DOCKER_ACCOUNT }}/${{ github.repository }}"'"}}'
# curl -X POST ${{ secrets.RANCHER_STG_DEPLOY_URL }} -H 'Content-Type: application/json' -d "${BODY}"
17 changes: 17 additions & 0 deletions .github/workflows/cd_stg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CD STG AND PHP8

on:
pull_request:
branches: ["stg"]
types: closed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
call-workflow-cd:
uses: pagarme/magento2/.github/workflows/cd_reusable.yml@master
with:
matrix_tags: "['stg', 'php8']"
secrets:
inherit
17 changes: 17 additions & 0 deletions .github/workflows/cd_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CD TEST

on:
pull_request:
branches: ["develop"]
types: closed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
call-workflow-cd:
uses: pagarme/magento2/.github/workflows/cd_reusable.yml@master
with:
matrix_tags: "['test']"
secrets:
inherit