Skip to content
Open

67 #245

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflow/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: product-catalog-service-ci

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Go 1.22
uses: actions/setup-go@v2
with:
go-version: 1.22

- name: Build
run: |
cd src/product-catalog
go mod download
go build -o product-catalog-service main.go

- name: Unit tests
run: |
cd src/product-catalog
go test ./...

code-quality:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run golangci-lint
run: |
go install github.com/golangci/lint/cmd/[email protected]
golangci-lint run src/product-catalog/...

docker:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Docker push
uses: docker/build-push-action@v6
with:
context: src/product-catalog
file: Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/product-catalog-service:${{ github.run_id }}

updatek8s:
runs-on: ubuntu-latest
needs: [build, docker, code-quality]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Update tag in Kubernetes deployment manifest
run: |
sed -i 's|image:.*|image: ${{ secrets.DOCKERHUB_USERNAME }}/product-catalog-service:${{ github.run_id }}|' kubernetes/product-catalog/deploy.yaml

- name: Commit and push changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "Amitkamble5521"
git add kubernetes/product-catalog/deploy.yaml
git commit -m "[CI]: update product catalog image tag"
git push origin HEAD:main -f
108 changes: 0 additions & 108 deletions .github/workflows/ci.yaml

This file was deleted.

18 changes: 18 additions & 0 deletions internal/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,21 @@ module github.com/open-telemetry/opentelemetry-specification/internal/tools
go 1.12

require github.com/client9/misspell v0.3.4


















13 changes: 13 additions & 0 deletions src/checkout/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,16 @@ require (
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)













16 changes: 16 additions & 0 deletions src/checkout/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,3 +609,19 @@ func (cs *checkout) getIntFeatureFlag(ctx context.Context, featureFlagName strin

return int(featureFlagValue)
}
















23 changes: 23 additions & 0 deletions src/product-catalog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,33 @@ func createClient(ctx context.Context, svcAddr string) (*grpc.ClientConn, error)
return grpc.DialContext(ctx, svcAddr,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),


)
}