From 6c3db13656c19892d9824f8c1b6f74e2d07a10ec Mon Sep 17 00:00:00 2001 From: Abhishek Veeramalla Date: Tue, 4 Feb 2025 15:26:03 +0530 Subject: [PATCH 1/5] chore: trivial change to verify ci --- src/product-catalog/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/product-catalog/main.go b/src/product-catalog/main.go index ae6393d994..5c632277e8 100644 --- a/src/product-catalog/main.go +++ b/src/product-catalog/main.go @@ -315,3 +315,6 @@ func createClient(ctx context.Context, svcAddr string) (*grpc.ClientConn, error) grpc.WithStatsHandler(otelgrpc.NewClientHandler()), ) } + + + From b0dc54032515244e75e04dfa6f64f28262025485 Mon Sep 17 00:00:00 2001 From: Abhishek Veeramalla Date: Tue, 4 Feb 2025 15:31:32 +0530 Subject: [PATCH 2/5] chore: update path --- .github/workflows/ci.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 708b1a1dd9..cc29677995 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,10 +21,13 @@ jobs: go-version: 1.22 - name: Build - run: go build -o product-catalog-service src/product-catalog/main.go + run: | + cd src/product-catalog + go mod download + go build -o product-catalog-service main.go - name: unit tests - run: go test src/product-catalog/... + run: go test ... code-quality: runs-on: ubuntu-latest From 9eb33cd63878e86513e2090f6ecbeee7cbe832cf Mon Sep 17 00:00:00 2001 From: Abhishek Veeramalla Date: Tue, 4 Feb 2025 15:38:06 +0530 Subject: [PATCH 3/5] chore: update path --- .github/workflows/ci.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cc29677995..f7d85331c2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,7 +27,10 @@ jobs: go build -o product-catalog-service main.go - name: unit tests - run: go test ... + run: | + cd src/product-catalog + go mod download + go build -o product-catalog-service main.go code-quality: runs-on: ubuntu-latest From 8b3097de5a84c051312b13a54a47adbceda93ab6 Mon Sep 17 00:00:00 2001 From: Abhishek Veeramalla Date: Tue, 4 Feb 2025 15:42:31 +0530 Subject: [PATCH 4/5] chore: update paths --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f7d85331c2..ca3e701b4e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -29,8 +29,7 @@ jobs: - name: unit tests run: | cd src/product-catalog - go mod download - go build -o product-catalog-service main.go + go test ./... code-quality: runs-on: ubuntu-latest @@ -42,7 +41,8 @@ jobs: - name: Run golangci-lint run: | go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2 - golangci-lint run src/product-catalog/... + cd src/product-catalog + golangci-lint run ./... docker: runs-on: ubuntu-latest From 1e3a32b6c8cb450def833dbc8be4f3f4d74da22c Mon Sep 17 00:00:00 2001 From: Abhishek Veeramalla Date: Tue, 4 Feb 2025 15:49:45 +0530 Subject: [PATCH 5/5] fix: incorrect secret name --- .github/workflows/ci.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ca3e701b4e..6a139156d6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -40,7 +40,7 @@ jobs: - name: Run golangci-lint run: | - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.63.4 cd src/product-catalog golangci-lint run ./... @@ -66,9 +66,9 @@ jobs: uses: docker/build-push-action@v6 with: context: src/product-catalog - file: Dockerfile + file: src/product-catalog/Dockerfile push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/product-catalog:${{github.run_id}} + tags: ${{ secrets.DOCKER_USERNAME }}/product-catalog:${{github.run_id}} updatek8s: @@ -84,7 +84,7 @@ jobs: - name: Update tag in kubernetes deployment manifest run: | - sed -i 's/image: .*/image: ${{ secrets.DOCKERHUB_USERNAME }}/product-catalog:${{github.run_id}}/' kubernetes/productcatalog/deploy.yaml + sed -i "s|image: .*|image: ${{ secrets.DOCKER_USERNAME }}/product-catalog:${{github.run_id}}|" kubernetes/productcatalog/deploy.yaml - name: Commit and push changes run: | @@ -92,7 +92,7 @@ jobs: git config --global user.name "Abhishek Veeramalla" git add kubernetes/productcatalog/deploy.yaml git commit -m "[CI]: Update product catalog image tag" - git push + git push origin HEAD:main -f