Skip to content

Commit

Permalink
Edit dicodingacademy#9 circleci config.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
slehmadi committed Oct 5, 2023
1 parent b1eac42 commit fb80882
Showing 1 changed file with 13 additions and 24 deletions.
37 changes: 13 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ orbs:
# Berisi tentang kumpulan jobs
jobs:

# Job 1 bernama test, dengan menggunakan docker yang berbasis image cimg/go:1.19
# Langkah yang dilakukan:
# - checkout terlebih dahulu
# - menjalankan perintah untuk mengetes applikasi golang
lint-dockerfile:
docker:
- image: ubuntu-2204:2023.02.1
steps:
- checkout
- run: docker run --rm --interactive hadolint/hadolint < Dockerfile
# Job 1 bernama test, dengan menggunakan docker yang berbasis image cimg/go:1.19
# Langkah yang dilakukan:
# - checkout terlebih dahulu
Expand All @@ -27,40 +37,19 @@ jobs:
# - Mem-build docker image
# - Mem-push docker image ke registry Github Package
build-and-push:
executor: docker/machine
docker:
- image: ubuntu-2204:2023.02.1
steps:
- checkout
- run: echo "$PAT" | docker login ghcr.io --username slehmadi --password-stdin
- run: docker build -t ghcr.io/slehmadi/karsajobs:latest .
- run: docker push ghcr.io/slehmadi/karsajobs:latest

lint-dockerfile:
executor: docker/machine
steps:
- checkout
- run: docker run --rm --interactive hadolint/hadolint < Dockerfile

# Alur kerja dari pipeline
workflows:
continues-integration:
jobs:
- docker/hadolint:
dockerfiles: Dockerfile
ignore-rules: DL4005,DL3008
trusted-registries: docker.io,ghcr.io
- lint-dockerfile

lint-dockerfile:
jobs:
- docker/hadolint:
dockerfiles: Dockerfile
ignore-rules: DL4005,DL3008
trusted-registries: docker.io,ghcr.io

# Mela
test-app:
jobs:
- test
build-app-karsajobs:
jobs:
- build-and-push

0 comments on commit fb80882

Please sign in to comment.