Skip to content

Commit

Permalink
use actual dockerhub repo in taskfile
Browse files Browse the repository at this point in the history
  • Loading branch information
sidpalas committed Jun 11, 2024
1 parent 7e0779c commit 9192f15
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 11 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/image-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: image-ci

on:
push:
branches:
- "main"
tags:
- "[0-9]*.[0-9]*.[0-9]*"

jobs:
build-tag-push:
runs-on: ubuntu-latest
strategy:
matrix:
image:
- 06-demo-application/api-golang
- 06-demo-application/api-node
- 06-demo-application/client-react
- 06-demo-application/load-generator-python
- 06-demo-application/postgresql

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Generate Image Tag
id: generate-image-tag
working-directory: 14-cicd/github-actions
run: |
image_tag=$(task generate-version-tag)
echo "image_tag=$image_tag" >> $GITHUB_OUTPUT
- name: Build Image
env:
IMAGE_TAG: ${{ steps.generate-image-tag.outputs.image_tag }}
working-directory: ${{ matrix.image }}
run: |
task build-container-image-multi-arch IMAGE_TAG=${IMAGE_TAG}
7 changes: 5 additions & 2 deletions 06-demo-application/api-golang/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ version: "3"

vars:
DATABASE_URL: "postgres://postgres:foobarbaz@localhost:5432/postgres"
IMAGE_REPO: localhost:5000/devops-directive-docker-course-api-golang
# IMAGE_REPO: sidpalas/devops-directive-docker-course-api-golang
IMAGE_REPO: sidpalas/devops-directive-docker-course-api-golang
IMAGE_TAG: foobarbaz

tasks:
Expand All @@ -28,3 +27,7 @@ tasks:
--bare \
--tags={{.IMAGE_TAG}} \
--platform=all
build-container-image-multi-arch:
cmds:
- task: build-container-image
3 changes: 1 addition & 2 deletions 06-demo-application/api-node/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ version: "3"

vars:
DATABASE_URL: "postgres://postgres:foobarbaz@localhost:5432/postgres"
IMAGE_REPO: localhost:5000/devops-directive-docker-course-api-node
# IMAGE_REPO: sidpalas/devops-directive-docker-course-api-node
IMAGE_REPO: sidpalas/devops-directive-docker-course-api-node
IMAGE_TAG: foobarbaz

tasks:
Expand Down
3 changes: 1 addition & 2 deletions 06-demo-application/client-react/Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
version: "3"

vars:
IMAGE_REPO: localhost:5000/devops-directive-docker-course-client-react-nginx
# IMAGE_REPO: sidpalas/devops-directive-docker-course-client-react-nginx
IMAGE_REPO: sidpalas/devops-directive-docker-course-client-react-nginx
IMAGE_TAG: foobarbaz

tasks:
Expand Down
7 changes: 3 additions & 4 deletions 06-demo-application/load-generator-python/Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
version: "3"

vars:
IMAGE_REPO: localhost:5000/devops-directive-kubernetes-course-load-generator-python
# IMAGE_REPO: sidpalas/devops-directive-kubernetes-course-load-generator-python
IMAGE_REPO: sidpalas/devops-directive-kubernetes-course-load-generator-python
IMAGE_TAG: foobarbaz

tasks:
Expand All @@ -29,5 +28,5 @@ tasks:
run:
desc: Start load generator
cmds:
# api-golang is listening on port 8080
- API_URL=http://localhost:8080/ DELAY_MS=100 poetry run python main.py
# api-golang is listening on port 8000
- API_URL=http://localhost:8000/ DELAY_MS=100 poetry run python main.py
1 change: 0 additions & 1 deletion 06-demo-application/postgresql/Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: "3"

vars:
# IMAGE_REPO: localhost:5000/devops-directive-kubernetes-course-db-migrator
IMAGE_REPO: sidpalas/devops-directive-kubernetes-course-db-migrator
IMAGE_TAG: foobarbaz

Expand Down

0 comments on commit 9192f15

Please sign in to comment.