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

[BPROC-2448] - Passa usar imagens pagarme pelo ECR #413

Merged
merged 1 commit into from
Dec 30, 2024
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: 2 additions & 0 deletions .github/workflows/build_and_deploy_prd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ jobs:
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DOCKER_IMAGES_AWS_PULL_ACCESS_KEY_ID: ${{ secrets.DOCKER_IMAGES_AWS_PULL_ACCESS_KEY_ID }}
DOCKER_IMAGES_AWS_PULL_SECRET_ACCESS_KEY: ${{ secrets.DOCKER_IMAGES_AWS_PULL_SECRET_ACCESS_KEY }}
2 changes: 2 additions & 0 deletions .github/workflows/build_and_deploy_sdx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ jobs:
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DOCKER_IMAGES_AWS_PULL_ACCESS_KEY_ID: ${{ secrets.DOCKER_IMAGES_AWS_PULL_ACCESS_KEY_ID }}
DOCKER_IMAGES_AWS_PULL_SECRET_ACCESS_KEY: ${{ secrets.DOCKER_IMAGES_AWS_PULL_SECRET_ACCESS_KEY }}
2 changes: 2 additions & 0 deletions .github/workflows/build_and_deploy_stg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ jobs:
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DOCKER_IMAGES_AWS_PULL_ACCESS_KEY_ID: ${{ secrets.DOCKER_IMAGES_AWS_PULL_ACCESS_KEY_ID }}
DOCKER_IMAGES_AWS_PULL_SECRET_ACCESS_KEY: ${{ secrets.DOCKER_IMAGES_AWS_PULL_SECRET_ACCESS_KEY }}
20 changes: 16 additions & 4 deletions .github/workflows/lint_tests_and_sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,23 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v2
- name: Instalar Docker Compose Standalone
run: |
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
id: configure-ecr
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
aws-access-key-id: ${{ secrets.DOCKER_IMAGES_AWS_PULL_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DOCKER_IMAGES_AWS_PULL_SECRET_ACCESS_KEY }}
aws-region: us-east-1
mask-aws-account-id: "no"

- name: Login no Elastic Container Registry / ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Run tests
run: make test-ci
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/superbowleto_build_and_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ on:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
DOCKER_IMAGES_AWS_PULL_ACCESS_KEY_ID:
required: true
DOCKER_IMAGES_AWS_PULL_SECRET_ACCESS_KEY:
required: true

jobs:
generate-tag:
Expand Down Expand Up @@ -91,6 +95,22 @@ jobs:
- name: checkout
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
id: configure-ecr
with:
aws-access-key-id: ${{ secrets.DOCKER_IMAGES_AWS_PULL_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DOCKER_IMAGES_AWS_PULL_SECRET_ACCESS_KEY }}
aws-region: us-east-1
mask-aws-account-id: "no"

- name: Login no Elastic Container Registry / ECR
uses: aws-actions/amazon-ecr-login@v1

- name: Instalar Docker Compose Standalone
run: |
docker pull 697525377503.dkr.ecr.us-east-1.amazonaws.com/pay-docker-base-images:pagarme-node8.9

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM pagarme/docker-nodejs:8.9
FROM 697525377503.dkr.ecr.us-east-1.amazonaws.com/pay-docker-base-images:pagarme-node8.9

COPY package.json /superbowleto/package.json
COPY package-lock.json /superbowleto/package-lock.json
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM pagarme/docker-nodejs:8.9
FROM 697525377503.dkr.ecr.us-east-1.amazonaws.com/pay-docker-base-images:pagarme-node8.9

# Copy package definition files
COPY package.json /app/package.json
Expand All @@ -11,7 +11,7 @@ RUN apk update && \
apk add python make g++ && \
npm install --production

FROM pagarme/docker-nodejs:8.9
FROM 697525377503.dkr.ecr.us-east-1.amazonaws.com/pay-docker-base-images:pagarme-node8.9

ENV APP_NAME 'superbowleto'

Expand Down
14 changes: 1 addition & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,11 @@ services:
retries: 5

yopa:
image: pagarme/yopa:latest
command: java -Xms64m -Xmx256m -jar uberjar.jar -c /tmp/yopa-in/config.yml -o /tmp/dev-env-aws-regions-override.xml
image: 697525377503.dkr.ecr.us-east-1.amazonaws.com/pay-docker-base-images:pagarme-yopa
ports:
- 47195
volumes:
- ./yopa-config.yml:/tmp/yopa-in/config.yml:ro
healthcheck:
test: [
"CMD-SHELL",
"curl -f 'http://localhost:47195?Action=GetQueueUrl&QueueName=test'",
"&&",
"curl -f 'http://localhost:47195?Action=GetQueueUrl&QueueName=boletos-to-register'",
]
interval: 5s
retries: 5

test:
build: .
Expand All @@ -42,8 +32,6 @@ services:
depends_on:
postgres:
condition: service_healthy
yopa:
condition: service_healthy
superbowleto-web:
condition: service_started
links:
Expand Down
Loading