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 248a114
Show file tree
Hide file tree
Showing 14 changed files with 21 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-3:${{ 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-3.*$/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-group-3:${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-3.*$/ghcr.io\/kbtg-kampus-classnest-se-java\/workshop-group-3:${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
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-3` ด้วย กลุ่มตัวเอง 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-3-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-3"
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-3-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-3: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-3-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-3-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-3-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-3-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-3-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-3"
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-3-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-3: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-3-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-3-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-3-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-3-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-3"
property "sonar.token", System.getenv("SONAR_TOKEN")
property "sonar.host.url", System.getenv("SONAR_HOST_URL")
}
Expand Down

0 comments on commit 248a114

Please sign in to comment.