Skip to content

Commit 1a687f5

Browse files
Merge pull request #2 from sugesh-cloudops/feature/development
Feature/development
2 parents 12e4fb6 + 59918b2 commit 1a687f5

File tree

4 files changed

+305
-172
lines changed

4 files changed

+305
-172
lines changed

.github/dependabot.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "maven"
4+
directory: "/springboot-postgres/app"
5+
schedule:
6+
interval: "daily"
7+
8+
- package-ecosystem: "docker"
9+
directory: "/springboot-postgres/app"
10+
schedule:
11+
interval: "weekly"
12+
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
schedule:
16+
interval: "weekly"

.github/workflows/helm-ci.yaml

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,82 @@
1-
name: Helm CI - Build and Push
2-
3-
on:
4-
push:
5-
branches:
6-
- main
7-
8-
jobs:
9-
build-and-push:
10-
name: Build and Push Docker Image
11-
runs-on: ubuntu-latest
12-
13-
outputs:
14-
image-tag: ${{ steps.set-tag.outputs.tag }}
15-
16-
env:
17-
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/springboot-postgres
18-
19-
steps:
20-
- name: Checkout code
21-
uses: actions/checkout@v4
22-
23-
- name: Set up JDK 17
24-
uses: actions/setup-java@v4
25-
with:
26-
distribution: 'temurin'
27-
java-version: '17'
28-
29-
- name: Build Spring Boot App
30-
working-directory: ./app
31-
run: ./mvnw clean package -DskipTests
32-
33-
- name: Set up Docker Buildx
34-
uses: docker/setup-buildx-action@v3
35-
36-
- name: Log in to DockerHub
37-
uses: docker/login-action@v3
38-
with:
39-
username: ${{ secrets.DOCKERHUB_USERNAME }}
40-
password: ${{ secrets.DOCKERHUB_TOKEN }}
41-
42-
- name: Set Image Tag
43-
id: set-tag
44-
run: |
45-
COMMIT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
46-
TAG="main-${COMMIT_SHA}"
47-
echo "tag=$TAG" >> $GITHUB_OUTPUT
48-
49-
- name: Build and Push Docker Image
50-
run: |
51-
docker build -t $IMAGE_NAME:${{ steps.set-tag.outputs.tag }} ./app
52-
docker push $IMAGE_NAME:${{ steps.set-tag.outputs.tag }}
53-
54-
update-values:
55-
name: Update Helm values.yaml
56-
needs: build-and-push
57-
runs-on: ubuntu-latest
58-
59-
env:
60-
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/springboot-postgres
61-
IMAGE_TAG: ${{ needs.build-and-push.outputs.image-tag }}
62-
FILE: helm/springboot-postgres-prod/values.yaml
63-
64-
steps:
65-
- name: Checkout code
66-
uses: actions/checkout@v4
67-
68-
- name: Configure Git
69-
run: |
70-
git config --global user.name "${{ secrets.GIT_USER_NAME }}"
71-
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
72-
73-
- name: Update values.yaml
74-
run: |
75-
echo "Updating $FILE with image: $IMAGE_NAME:$IMAGE_TAG"
76-
sed -i.bak -E "s|image:.*|image: ${IMAGE_NAME}:${IMAGE_TAG}|" "$FILE"
77-
78-
git add "$FILE"
79-
git commit -m "Update image tag to $IMAGE_TAG in Helm values.yaml"
80-
81-
git pull origin auto/helm-update --rebase || true
82-
git push origin HEAD:auto/helm-update-prod --force-with-lease
1+
# name: Helm CI - Build and Push
2+
3+
# on:
4+
# push:
5+
# branches:
6+
# - main
7+
8+
# jobs:
9+
# build-and-push:
10+
# name: Build and Push Docker Image
11+
# runs-on: ubuntu-latest
12+
13+
# outputs:
14+
# image-tag: ${{ steps.set-tag.outputs.tag }}
15+
16+
# env:
17+
# IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/springboot-postgres
18+
19+
# steps:
20+
# - name: Checkout code
21+
# uses: actions/checkout@v4
22+
23+
# - name: Set up JDK 17
24+
# uses: actions/setup-java@v4
25+
# with:
26+
# distribution: 'temurin'
27+
# java-version: '17'
28+
29+
# - name: Build Spring Boot App
30+
# working-directory: ./app
31+
# run: ./mvnw clean package -DskipTests
32+
33+
# - name: Set up Docker Buildx
34+
# uses: docker/setup-buildx-action@v3
35+
36+
# - name: Log in to DockerHub
37+
# uses: docker/login-action@v3
38+
# with:
39+
# username: ${{ secrets.DOCKERHUB_USERNAME }}
40+
# password: ${{ secrets.DOCKERHUB_TOKEN }}
41+
42+
# - name: Set Image Tag
43+
# id: set-tag
44+
# run: |
45+
# COMMIT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
46+
# TAG="main-${COMMIT_SHA}"
47+
# echo "tag=$TAG" >> $GITHUB_OUTPUT
48+
49+
# - name: Build and Push Docker Image
50+
# run: |
51+
# docker build -t $IMAGE_NAME:${{ steps.set-tag.outputs.tag }} ./app
52+
# docker push $IMAGE_NAME:${{ steps.set-tag.outputs.tag }}
53+
54+
# update-values:
55+
# name: Update Helm values.yaml
56+
# needs: build-and-push
57+
# runs-on: ubuntu-latest
58+
59+
# env:
60+
# IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/springboot-postgres
61+
# IMAGE_TAG: ${{ needs.build-and-push.outputs.image-tag }}
62+
# FILE: helm/springboot-postgres-prod/values.yaml
63+
64+
# steps:
65+
# - name: Checkout code
66+
# uses: actions/checkout@v4
67+
68+
# - name: Configure Git
69+
# run: |
70+
# git config --global user.name "${{ secrets.GIT_USER_NAME }}"
71+
# git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
72+
73+
# - name: Update values.yaml
74+
# run: |
75+
# echo "Updating $FILE with image: $IMAGE_NAME:$IMAGE_TAG"
76+
# sed -i.bak -E "s|image:.*|image: ${IMAGE_NAME}:${IMAGE_TAG}|" "$FILE"
77+
78+
# git add "$FILE"
79+
# git commit -m "Update image tag to $IMAGE_TAG in Helm values.yaml"
80+
81+
# git pull origin auto/helm-update --rebase || true
82+
# git push origin HEAD:auto/helm-update-prod --force-with-lease
Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,93 @@
1-
name: Kustomize CI - Build and Push
2-
3-
on:
4-
push:
5-
branches:
6-
- feature/development
7-
- development
8-
9-
concurrency:
10-
group: kustomize-update
11-
cancel-in-progress: true
12-
13-
jobs:
14-
build-and-push:
15-
name: Build and Push Docker Image
16-
runs-on: ubuntu-latest
17-
18-
outputs:
19-
image-tag: ${{ steps.set-tag.outputs.tag }}
20-
21-
env:
22-
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/springboot-postgres
23-
24-
steps:
25-
- name: Checkout code
26-
uses: actions/checkout@v4
27-
28-
- name: Set up JDK 17
29-
uses: actions/setup-java@v4
30-
with:
31-
distribution: 'temurin'
32-
java-version: '17'
33-
34-
- name: Build Spring Boot App
35-
working-directory: ./app
36-
run: ./mvnw clean package -DskipTests
37-
38-
- name: Set up Docker Buildx
39-
uses: docker/setup-buildx-action@v3
40-
41-
- name: Log in to DockerHub
42-
uses: docker/login-action@v3
43-
with:
44-
username: ${{ secrets.DOCKERHUB_USERNAME }}
45-
password: ${{ secrets.DOCKERHUB_TOKEN }}
46-
47-
- name: Set image tag
48-
id: set-tag
49-
run: |
50-
COMMIT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
51-
BRANCH=$(echo "${GITHUB_REF#refs/heads/}" | tr '/' '-')
52-
TAG="${BRANCH}-${COMMIT_SHA}"
53-
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
54-
55-
- name: Build and push Docker image
56-
run: |
57-
docker build -t $IMAGE_NAME:${{ steps.set-tag.outputs.tag }} ./app
58-
docker push $IMAGE_NAME:${{ steps.set-tag.outputs.tag }}
59-
60-
update-kustomize:
61-
name: Update Kustomize Overlay
62-
needs: build-and-push
63-
runs-on: ubuntu-latest
64-
65-
env:
66-
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/springboot-postgres
67-
IMAGE_TAG: ${{ needs.build-and-push.outputs.image-tag }}
68-
69-
steps:
70-
- name: Checkout code
71-
uses: actions/checkout@v4
72-
73-
- name: Configure git
74-
run: |
75-
git config --global user.name "${{ secrets.GIT_USER_NAME }}"
76-
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
77-
78-
- name: Update image tag and push to branch
79-
run: |
80-
FILE="kustomize/overlays/dev/patch-deployment-image.yaml"
81-
82-
echo "Updating $FILE with image: $IMAGE_NAME:$IMAGE_TAG"
83-
84-
sed -i.bak -E "s|image:.*|image: ${IMAGE_NAME}:${IMAGE_TAG}|" "$FILE"
85-
86-
git checkout -B auto/kustomize-update
87-
git add "$FILE"
88-
git commit -m "Update image tag to $IMAGE_TAG" || echo "No changes to commit"
89-
90-
git push origin auto/kustomize-update --force
1+
# name: Kustomize CI - Build and Push
2+
3+
# on:
4+
# push:
5+
# branches:
6+
# - feature/development
7+
# - development
8+
9+
# concurrency:
10+
# group: kustomize-update
11+
# cancel-in-progress: true
12+
13+
# jobs:
14+
# build-and-push:
15+
# name: Build and Push Docker Image
16+
# runs-on: ubuntu-latest
17+
18+
# outputs:
19+
# image-tag: ${{ steps.set-tag.outputs.tag }}
20+
21+
# env:
22+
# IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/springboot-postgres
23+
24+
# steps:
25+
# - name: Checkout code
26+
# uses: actions/checkout@v4
27+
28+
# - name: Set up JDK 17
29+
# uses: actions/setup-java@v4
30+
# with:
31+
# distribution: 'temurin'
32+
# java-version: '17'
33+
34+
# - name: Build Spring Boot App
35+
# working-directory: ./app
36+
# run: ./mvnw clean package -DskipTests
37+
38+
# - name: Set up Docker Buildx
39+
# uses: docker/setup-buildx-action@v3
40+
41+
# - name: Log in to DockerHub
42+
# uses: docker/login-action@v3
43+
# with:
44+
# username: ${{ secrets.DOCKERHUB_USERNAME }}
45+
# password: ${{ secrets.DOCKERHUB_TOKEN }}
46+
47+
# - name: Set image tag
48+
# id: set-tag
49+
# run: |
50+
# COMMIT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
51+
# BRANCH=$(echo "${GITHUB_REF#refs/heads/}" | tr '/' '-')
52+
# TAG="${BRANCH}-${COMMIT_SHA}"
53+
# echo "tag=$TAG" >> "$GITHUB_OUTPUT"
54+
55+
# - name: Build and push Docker image
56+
# run: |
57+
# docker build -t $IMAGE_NAME:${{ steps.set-tag.outputs.tag }} ./app
58+
# docker push $IMAGE_NAME:${{ steps.set-tag.outputs.tag }}
59+
60+
# update-kustomize:
61+
# name: Update Kustomize Overlay
62+
# needs: build-and-push
63+
# runs-on: ubuntu-latest
64+
65+
# env:
66+
# IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/springboot-postgres
67+
# IMAGE_TAG: ${{ needs.build-and-push.outputs.image-tag }}
68+
69+
# steps:
70+
# - name: Checkout code
71+
# uses: actions/checkout@v4
72+
73+
# - name: Configure git
74+
# run: |
75+
# git config --global user.name "${{ secrets.GIT_USER_NAME }}"
76+
# git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
77+
78+
# - name: Update image tag and push to branch
79+
# run: |
80+
# FILE="kustomize/overlays/dev/patch-deployment-image.yaml"
81+
82+
# echo "Updating $FILE with image: $IMAGE_NAME:$IMAGE_TAG"
83+
84+
# sed -i.bak -E "s|image:.*|image: ${IMAGE_NAME}:${IMAGE_TAG}|" "$FILE"
85+
86+
# git checkout -B auto/kustomize-update
87+
# git add "$FILE"
88+
# git commit -m "Update image tag to $IMAGE_TAG" || echo "No changes to commit"
89+
90+
# git push origin auto/kustomize-update --force
9191

9292

9393

0 commit comments

Comments
 (0)