Skip to content

Commit

Permalink
fix: Resolving PR Comments. Made an array of taskfile tasks, and iter…
Browse files Browse the repository at this point in the history
…ating over it when pushing charts and images
  • Loading branch information
werniq committed Oct 1, 2024
1 parent f21cc37 commit bd17a05
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
18 changes: 3 additions & 15 deletions .github/workflows/ecr-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,11 @@ jobs:
run: |
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
- name: Login to ECR
- name: Login to AWS ECR
id: ecr_login
run: |
task awsLogin
- name: Build and Push Operator Docker image to ECR
- name: Build and Push all Charts and All Images to AWS ECR
run: |
task operator:docker-build
- name: Build and Push Docker image to ECR
run: |
task goGatorImageEcrPush
- name: Build and Push Helm chart to ECR
run: |
task goGatorChartEcrPush
- name: Build and Push Helm Day-0 chart to ECR
run: |
task day0EcrPush
task deployAll
13 changes: 12 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
version: '3'

includes:
operator: ./operator
operator:
taskfile: ./operator/Taskfile.yml
dir: ./operator
cronJob:
taskfile: ./news_fetcher/Taskfile.yml
dir: ./news_fetcher

env:
DOCKER_IMAGE_NAME: '{{ .DOCKER_IMAGE_NAME | default "go-gator" }}'
Expand Down Expand Up @@ -156,3 +161,9 @@ tasks:
- day0EcrBuild
cmds:
- helm push day-0-{{ .DAY_0_CHART_VERSION }}.tgz oci://{{ .AWS_ACCOUNT_ID }}.dkr.ecr.us-east-2.amazonaws.com/qniw984/

deployAll:
desc: Deploy all images and charts to ECR
cmds:
- for: [awsLogin, operator:docker-build, cronJob:publish, goGatorImageEcrPush, goGatorChartEcrPush, day0EcrPush]
task: {{.ITEM}}
5 changes: 2 additions & 3 deletions news_fetcher/Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'

env:
DOCKER_IMAGE_NAME: '{{ .DOCKER_IMAGE_NAME | default "news-fetching-job" }}'
DOCKER_IMAGE_NAME: '{{ .DOCKER_IMAGE_NAME | default "406477933661.dkr.ecr.us-east-2.amazonaws.com/qniw984/news-fetching-job" }}'
DOCKER_USERNAME: '{{ .DOCKER_USERNAME | default "qniw984" }}'
DOCKER_IMAGE_TAG: '{{ .DOCKER_IMAGE_TAG | default "latest" }}'
DOCKERHUB_USERNAME: '{{ .DOCKER_LOGIN_USERNAME }}'
Expand Down Expand Up @@ -40,5 +40,4 @@ tasks:
deps:
- docker-build
cmds:
- docker login -u {{ .DOCKERHUB_USERNAME }} -p {{ .DOCKERHUB_PASSWORD }}
- docker push {{ .DOCKER_USERNAME }}/{{ .DOCKER_IMAGE_NAME }}:{{ .DOCKER_IMAGE_TAG }}
- docker push {{ .DOCKER_IMAGE_NAME }}

0 comments on commit bd17a05

Please sign in to comment.