diff --git a/.github/workflows/ecr-deployment.yml b/.github/workflows/ecr-deployment.yml index 054f875..98da286 100644 --- a/.github/workflows/ecr-deployment.yml +++ b/.github/workflows/ecr-deployment.yml @@ -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 diff --git a/Taskfile.yml b/Taskfile.yml index af03c4f..11efe1b 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -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" }}' @@ -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}} diff --git a/news_fetcher/Taskfile.yml b/news_fetcher/Taskfile.yml index 8d17fff..7acf479 100644 --- a/news_fetcher/Taskfile.yml +++ b/news_fetcher/Taskfile.yml @@ -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 }}' @@ -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 }} \ No newline at end of file + - docker push {{ .DOCKER_IMAGE_NAME }} \ No newline at end of file