From 06926f9ee4f60a370fd8ac039404a7ce1b58be67 Mon Sep 17 00:00:00 2001 From: bhuridech Date: Sat, 23 Mar 2024 07:53:13 +0700 Subject: [PATCH] initial group repo --- .github/workflows/cicd.yaml | 4 ++-- .github/workflows/prod-cd.yaml | 2 +- .vscode/settings.json | 4 ++++ README.md | 2 +- infra/gitops/dev/configmap.yml | 4 ++-- infra/gitops/dev/deployment.yml | 4 ++-- infra/gitops/dev/ingress.yaml | 4 ++-- infra/gitops/dev/namespace.yml | 2 +- infra/gitops/dev/service.yml | 2 +- infra/gitops/prod/configmap.yml | 4 ++-- infra/gitops/prod/deployment.yml | 4 ++-- infra/gitops/prod/ingress.yaml | 4 ++-- infra/gitops/prod/namespace.yml | 2 +- infra/gitops/prod/service.yml | 2 +- kbazaar/build.gradle | 2 +- 15 files changed, 25 insertions(+), 21 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index de45ef2..29b695e 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -74,7 +74,7 @@ jobs: with: context: ./kbazaar push: ${{ github.ref == 'refs/heads/main' }} - tags: ghcr.io/kbtg-kampus-classnest-se-java/workshop-:${{ env.GITHUB_SHA }} + tags: ghcr.io/kbtg-kampus-classnest-se-java/workshop-group-5:${{ env.GITHUB_SHA }} - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} @@ -95,7 +95,7 @@ jobs: git config user.email "root@aorjoa.link" - name: change image tag run: | - sed -i -E "s/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-.*$/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-:${GITHUB_SHA}/" infra/gitops/dev/deployment.yml + sed -i -E "s/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-group-5.*$/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-group-5:${GITHUB_SHA}/" infra/gitops/dev/deployment.yml git add infra/gitops/dev/deployment.yml git commit -m "[skip actions] 🤖 change docker image version to ${GITHUB_SHA}" - name: push changes diff --git a/.github/workflows/prod-cd.yaml b/.github/workflows/prod-cd.yaml index 7c4a90e..cd5f5a0 100644 --- a/.github/workflows/prod-cd.yaml +++ b/.github/workflows/prod-cd.yaml @@ -40,7 +40,7 @@ jobs: - name: change image tag run: | - sed -i -E "s/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-.*$/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-:${GITHUB_SHA}/" infra/gitops/prod/deployment.yml + sed -i -E "s/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-group-5.*$/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-group-5:${GITHUB_SHA}/" infra/gitops/prod/deployment.yml git add infra/gitops/prod/deployment.yml git commit -m "[skip actions] 🤖 change prd docker image version to ${{ inputs.deploy-tag }}" git pull --rebase diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..70236e5 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "java.configuration.updateBuildConfiguration": "disabled", + "java.compile.nullAnalysis.mode": "disabled" +} \ No newline at end of file diff --git a/README.md b/README.md index f0457c6..99ac256 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ KBazaar - Online Shopping Application (Workshop) ### STEP0: Initial Repository 1. ใช้ repository ที่เตรียมไว้ให้ตามกลุ่ม -2. Replace all `` ด้วย กลุ่มตัวเอง e.g `group-1` +2. Replace all `group-5` ด้วย กลุ่มตัวเอง e.g `group-1` 1. ทำการเพิ่มสมาชิกใน Github ของทีมเพื่อให้สามารถเข้าถึง Repository ได้ 1. ไปที่ Settings > Collaborators and teams > Manage access diff --git a/infra/gitops/dev/configmap.yml b/infra/gitops/dev/configmap.yml index 35bc95f..836a647 100644 --- a/infra/gitops/dev/configmap.yml +++ b/infra/gitops/dev/configmap.yml @@ -2,9 +2,9 @@ apiVersion: v1 kind: ConfigMap metadata: name: app-config - namespace: -dev + namespace: group-5-dev data: - db.url: "jdbc:postgresql://db-postgresql-sgp1-09974-do-user-856918-0.c.db.ondigitalocean.com:25060/dev-" + db.url: "jdbc:postgresql://db-postgresql-sgp1-09974-do-user-856918-0.c.db.ondigitalocean.com:25060/dev-group-5" db.username: "doadmin" db.password: "AVNS_2KxS7zrsXbMV3L_4Eaj" enabled.feature.promotion.list.api: "true" diff --git a/infra/gitops/dev/deployment.yml b/infra/gitops/dev/deployment.yml index f990fdd..f61c2b2 100644 --- a/infra/gitops/dev/deployment.yml +++ b/infra/gitops/dev/deployment.yml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: api - namespace: -dev + namespace: group-5-dev spec: selector: matchLabels: @@ -15,7 +15,7 @@ spec: spec: containers: - name: kbazaar-api - image: ghcr.io/kbtg-kampus-classnest-se-java/workshop-:342b25a526f325f284259db8f71d8c866b2b527d + image: ghcr.io/kbtg-kampus-classnest-se-java/workshop-group-5:342b25a526f325f284259db8f71d8c866b2b527d imagePullPolicy: Always ports: - containerPort: 8080 diff --git a/infra/gitops/dev/ingress.yaml b/infra/gitops/dev/ingress.yaml index c60d455..507f93a 100644 --- a/infra/gitops/dev/ingress.yaml +++ b/infra/gitops/dev/ingress.yaml @@ -2,14 +2,14 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-website - namespace: -dev + namespace: group-5-dev annotations: nginx.ingress.kubernetes.io/force-ssl-redirect: "true" nginx.ingress.kubernetes.io/rewrite-target: /$2 spec: ingressClassName: nginx rules: - - host: -dev.aorjoa.com + - host: group-5-dev.aorjoa.com http: paths: - path: / diff --git a/infra/gitops/dev/namespace.yml b/infra/gitops/dev/namespace.yml index 3a040c8..880c2cc 100644 --- a/infra/gitops/dev/namespace.yml +++ b/infra/gitops/dev/namespace.yml @@ -1,4 +1,4 @@ apiVersion: v1 kind: Namespace metadata: - name: -dev \ No newline at end of file + name: group-5-dev \ No newline at end of file diff --git a/infra/gitops/dev/service.yml b/infra/gitops/dev/service.yml index 6871160..542dd8a 100644 --- a/infra/gitops/dev/service.yml +++ b/infra/gitops/dev/service.yml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: api - namespace: -dev + namespace: group-5-dev spec: ports: - port: 80 diff --git a/infra/gitops/prod/configmap.yml b/infra/gitops/prod/configmap.yml index d7140e8..6e743de 100644 --- a/infra/gitops/prod/configmap.yml +++ b/infra/gitops/prod/configmap.yml @@ -2,9 +2,9 @@ apiVersion: v1 kind: ConfigMap metadata: name: app-config - namespace: -prod + namespace: group-5-prod data: - db.url: "jdbc:postgresql://db-postgresql-sgp1-09974-do-user-856918-0.c.db.ondigitalocean.com:25060/prod-" + db.url: "jdbc:postgresql://db-postgresql-sgp1-09974-do-user-856918-0.c.db.ondigitalocean.com:25060/prod-group-5" db.username: "doadmin" db.password: "AVNS_2KxS7zrsXbMV3L_4Eaj" enabled.feature.promotion.list.api: "true" \ No newline at end of file diff --git a/infra/gitops/prod/deployment.yml b/infra/gitops/prod/deployment.yml index a825c70..51f47b5 100644 --- a/infra/gitops/prod/deployment.yml +++ b/infra/gitops/prod/deployment.yml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: api - namespace: -prod + namespace: group-5-prod spec: selector: matchLabels: @@ -15,7 +15,7 @@ spec: spec: containers: - name: kbazaar-api - image: ghcr.io/kbtg-kampus-classnest-se-java/workshop-:342b25a526f325f284259db8f71d8c866b2b527d + image: ghcr.io/kbtg-kampus-classnest-se-java/workshop-group-5:342b25a526f325f284259db8f71d8c866b2b527d imagePullPolicy: Always ports: - containerPort: 8080 diff --git a/infra/gitops/prod/ingress.yaml b/infra/gitops/prod/ingress.yaml index 0097ff2..e620bbf 100644 --- a/infra/gitops/prod/ingress.yaml +++ b/infra/gitops/prod/ingress.yaml @@ -2,14 +2,14 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-website - namespace: -prod + namespace: group-5-prod annotations: nginx.ingress.kubernetes.io/force-ssl-redirect: "true" nginx.ingress.kubernetes.io/rewrite-target: /$2 spec: ingressClassName: nginx rules: - - host: -prod.aorjoa.com + - host: group-5-prod.aorjoa.com http: paths: - path: / diff --git a/infra/gitops/prod/namespace.yml b/infra/gitops/prod/namespace.yml index 5094a19..65b04e7 100644 --- a/infra/gitops/prod/namespace.yml +++ b/infra/gitops/prod/namespace.yml @@ -1,4 +1,4 @@ apiVersion: v1 kind: Namespace metadata: - name: -prod \ No newline at end of file + name: group-5-prod \ No newline at end of file diff --git a/infra/gitops/prod/service.yml b/infra/gitops/prod/service.yml index 2666072..31dc1c3 100644 --- a/infra/gitops/prod/service.yml +++ b/infra/gitops/prod/service.yml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: api - namespace: -prod + namespace: group-5-prod spec: ports: - port: 80 diff --git a/kbazaar/build.gradle b/kbazaar/build.gradle index fa51abf..79c8a5f 100644 --- a/kbazaar/build.gradle +++ b/kbazaar/build.gradle @@ -75,7 +75,7 @@ task("test-it", type: Test) { sonar { properties { property "sonar.gradle.skipCompile", "true" - property "sonar.projectKey", "" + property "sonar.projectKey", "group-5" property "sonar.token", System.getenv("SONAR_TOKEN") property "sonar.host.url", System.getenv("SONAR_HOST_URL") }