Skip to content

Commit

Permalink
Merge pull request #196 from certego/ecr
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
0ssigeno authored Oct 4, 2023
2 parents dcf0d85 + f8c0852 commit 26fe1ec
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 20 deletions.
15 changes: 10 additions & 5 deletions .github/actions/push_on_ecr/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ inputs:
repository:
description: Repository name
required: true
dockerfile:
description: Path for dockerfile from working directory
required: true
working_directory:
description: Docker build context
required: true

aws_account_id:
description: Aws User code
required: true
Expand All @@ -13,9 +20,6 @@ inputs:
aws_secret_access_key:
description: Aws secret access key
required: true
dockerfile:
description: Path for dockerfile
required: true
image_tag:
description: Directory that must be run against the linters
required: true
Expand Down Expand Up @@ -45,6 +49,7 @@ runs:
REPOSITORY: ${{ inputs.repository }}
IMAGE_TAG: ${{ inputs.image_tag }}
run: |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG ${{inputs.dockerfile}}
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG -f ${{inputs.dockerfile}} .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
shell: bash
shell: bash
working-directory: ${{ inputs.working_directory }}
17 changes: 13 additions & 4 deletions .github/workflows/_release_and_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,22 @@ on:
required: false
default: false
repository:
description: todo
description: Repository name
type: string
required: false
default: ${{ github.event.repository.name }}

dockerfile:
description: todo
description: Path for dockerfile from working directory
type: string
required: false
working_directory:
description: Docker build context
type: string
required: false
default: .
aws_region:
description: todo
description: Aws region
type: string
required: false
default: eu-central-1
Expand All @@ -72,6 +79,7 @@ jobs:
dockerfile: ${{ inputs.dockerfile }}
image_tag: ${{ ( github.base_ref == 'main' || github.base_ref == 'master' ) && 'prod' || 'stag' }}
aws_region: ${{ inputs.aws_region }}
working_directory: ${{ inputs.working_directory }}

- name: Check Tag
id: check-tag
Expand Down Expand Up @@ -160,4 +168,5 @@ jobs:
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
dockerfile: ${{ inputs.dockerfile }}
image_tag: ${{ github.event.pull_request.title }}
aws_region: ${{ inputs.aws_region }}
aws_region: ${{ inputs.aws_region }}
working_directory: ${{ inputs.working_directory }}
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ jobs:
publish_on_twitter: false
publish_on_ecr: false
repository: certego-test
dockerfile: .github/test/python_test/Dockerfile
working_directory: .github/test/python_test
dockerfile: Dockerfile
aws_region: eu-central-1
15 changes: 10 additions & 5 deletions actions/push_on_ecr/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ inputs:
repository:
description: Repository name
required: true
dockerfile:
description: Path for dockerfile from working directory
required: true
working_directory:
description: Docker build context
required: true

aws_account_id:
description: Aws User code
required: true
Expand All @@ -13,9 +20,6 @@ inputs:
aws_secret_access_key:
description: Aws secret access key
required: true
dockerfile:
description: Path for dockerfile
required: true
image_tag:
description: Directory that must be run against the linters
required: true
Expand Down Expand Up @@ -45,6 +49,7 @@ runs:
REPOSITORY: ${{ inputs.repository }}
IMAGE_TAG: ${{ inputs.image_tag }}
run: |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG ${{inputs.dockerfile}}
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG -f ${{inputs.dockerfile}} .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
shell: bash
shell: bash
working-directory: inputs.dockerfile.parent
17 changes: 13 additions & 4 deletions workflows/_release_and_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,22 @@ on:
required: false
default: false
repository:
description: todo
description: Repository name
type: string
required: false
default: ${{ github.event.repository.name }}

dockerfile:
description: todo
description: Path for dockerfile from working directory
type: string
required: false
working_directory:
description: Docker build context
type: string
required: false
default: .
aws_region:
description: todo
description: Aws region
type: string
required: false
default: eu-central-1
Expand All @@ -72,6 +79,7 @@ jobs:
dockerfile: ${{ inputs.dockerfile }}
image_tag: ${{ ( github.base_ref == 'main' || github.base_ref == 'master' ) && 'prod' || 'stag' }}
aws_region: ${{ inputs.aws_region }}
working_directory: ${{ inputs.working_directory }}

- name: Check Tag
id: check-tag
Expand Down Expand Up @@ -160,4 +168,5 @@ jobs:
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
dockerfile: ${{ inputs.dockerfile }}
image_tag: ${{ github.event.pull_request.title }}
aws_region: ${{ inputs.aws_region }}
aws_region: ${{ inputs.aws_region }}
working_directory: ${{ inputs.working_directory }}
3 changes: 2 additions & 1 deletion workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ jobs:
publish_on_twitter: false
publish_on_ecr: false
repository: certego-test
dockerfile: .github/test/python_test/Dockerfile
working_directory: .github/test/python_test
dockerfile: Dockerfile
aws_region: eu-central-1

0 comments on commit 26fe1ec

Please sign in to comment.