Skip to content

Commit

Permalink
initial group repo
Browse files Browse the repository at this point in the history
  • Loading branch information
bhuridech committed Mar 23, 2024
1 parent 5053e26 commit 06926f9
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
with:
context: ./kbazaar
push: ${{ github.ref == 'refs/heads/main' }}
tags: ghcr.io/kbtg-kampus-classnest-se-java/workshop-<group-id>:${{ 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 }}
Expand All @@ -95,7 +95,7 @@ jobs:
git config user.email "[email protected]"
- name: change image tag
run: |
sed -i -E "s/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-<group-id>.*$/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-<group-id>:${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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prod-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: change image tag
run: |
sed -i -E "s/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-<group-id>.*$/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-<group-id>:${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
Expand Down
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"java.configuration.updateBuildConfiguration": "disabled",
"java.compile.nullAnalysis.mode": "disabled"
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ KBazaar - Online Shopping Application (Workshop)
### STEP0: Initial Repository

1. ใช้ repository ที่เตรียมไว้ให้ตามกลุ่ม
2. Replace all `<group-id>` ด้วย กลุ่มตัวเอง e.g `group-1`
2. Replace all `group-5` ด้วย กลุ่มตัวเอง e.g `group-1`
1. ทำการเพิ่มสมาชิกใน Github ของทีมเพื่อให้สามารถเข้าถึง Repository ได้
1. ไปที่ Settings > Collaborators and teams > Manage access

Expand Down
4 changes: 2 additions & 2 deletions infra/gitops/dev/configmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
namespace: <group-id>-dev
namespace: group-5-dev
data:
db.url: "jdbc:postgresql://db-postgresql-sgp1-09974-do-user-856918-0.c.db.ondigitalocean.com:25060/dev-<group-id>"
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"
Expand Down
4 changes: 2 additions & 2 deletions infra/gitops/dev/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: api
namespace: <group-id>-dev
namespace: group-5-dev
spec:
selector:
matchLabels:
Expand All @@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: kbazaar-api
image: ghcr.io/kbtg-kampus-classnest-se-java/workshop-<group-id>:342b25a526f325f284259db8f71d8c866b2b527d
image: ghcr.io/kbtg-kampus-classnest-se-java/workshop-group-5:342b25a526f325f284259db8f71d8c866b2b527d
imagePullPolicy: Always
ports:
- containerPort: 8080
Expand Down
4 changes: 2 additions & 2 deletions infra/gitops/dev/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-website
namespace: <group-id>-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: <group-id>-dev.aorjoa.com
- host: group-5-dev.aorjoa.com
http:
paths:
- path: /
Expand Down
2 changes: 1 addition & 1 deletion infra/gitops/dev/namespace.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: <group-id>-dev
name: group-5-dev
2 changes: 1 addition & 1 deletion infra/gitops/dev/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: api
namespace: <group-id>-dev
namespace: group-5-dev
spec:
ports:
- port: 80
Expand Down
4 changes: 2 additions & 2 deletions infra/gitops/prod/configmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
namespace: <group-id>-prod
namespace: group-5-prod
data:
db.url: "jdbc:postgresql://db-postgresql-sgp1-09974-do-user-856918-0.c.db.ondigitalocean.com:25060/prod-<group-id>"
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"
4 changes: 2 additions & 2 deletions infra/gitops/prod/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: api
namespace: <group-id>-prod
namespace: group-5-prod
spec:
selector:
matchLabels:
Expand All @@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: kbazaar-api
image: ghcr.io/kbtg-kampus-classnest-se-java/workshop-<group-id>:342b25a526f325f284259db8f71d8c866b2b527d
image: ghcr.io/kbtg-kampus-classnest-se-java/workshop-group-5:342b25a526f325f284259db8f71d8c866b2b527d
imagePullPolicy: Always
ports:
- containerPort: 8080
Expand Down
4 changes: 2 additions & 2 deletions infra/gitops/prod/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-website
namespace: <group-id>-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: <group-id>-prod.aorjoa.com
- host: group-5-prod.aorjoa.com
http:
paths:
- path: /
Expand Down
2 changes: 1 addition & 1 deletion infra/gitops/prod/namespace.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: <group-id>-prod
name: group-5-prod
2 changes: 1 addition & 1 deletion infra/gitops/prod/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: api
namespace: <group-id>-prod
namespace: group-5-prod
spec:
ports:
- port: 80
Expand Down
2 changes: 1 addition & 1 deletion kbazaar/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ task("test-it", type: Test) {
sonar {
properties {
property "sonar.gradle.skipCompile", "true"
property "sonar.projectKey", "<group-id>"
property "sonar.projectKey", "group-5"
property "sonar.token", System.getenv("SONAR_TOKEN")
property "sonar.host.url", System.getenv("SONAR_HOST_URL")
}
Expand Down

0 comments on commit 06926f9

Please sign in to comment.