From 63c573277047ab247fe109c15e86e605c15b4583 Mon Sep 17 00:00:00 2001 From: BlazeIsClone Date: Mon, 16 Sep 2024 21:29:22 +0530 Subject: [PATCH 1/2] cicd: publish image update job name --- .github/workflows/publish-image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index 60f294b..f4f967a 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -10,6 +10,7 @@ env: jobs: test: + name: "Run Tests" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 791bd377a167e657842298354a72d721c7bf591f Mon Sep 17 00:00:00 2001 From: BlazeIsClone Date: Tue, 17 Sep 2024 07:39:49 +0530 Subject: [PATCH 2/2] deploy: container & dockerfile env --- Dockerfile.production | 4 ++++ deploy/local/deployment.yml | 15 +-------------- deploy/local/service.yml | 12 ++++++++++++ deploy/prod/deployment.yml | 4 ++-- deploy/prod/ingress.yml | 2 +- deploy/prod/service.yml | 4 ++-- 6 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 deploy/local/service.yml diff --git a/Dockerfile.production b/Dockerfile.production index 22ca3b3..e369072 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -4,6 +4,10 @@ WORKDIR /app ADD . . +ENV PORT=3000 + +ENV BASE_PATH="/api/v1" + RUN make build EXPOSE 3000 diff --git a/deploy/local/deployment.yml b/deploy/local/deployment.yml index 5ef42b7..911b52f 100644 --- a/deploy/local/deployment.yml +++ b/deploy/local/deployment.yml @@ -16,7 +16,7 @@ spec: spec: containers: - name: go-app - image: blazeclone/spaceops-mission-ctrl:latest + image: ghcr.io/blazeisclone/spaceops-mission-ctrl:v0.0.1 ports: - containerPort: 3000 resources: @@ -26,16 +26,3 @@ spec: limits: memory: "128Mi" cpu: "500m" ---- -apiVersion: v1 -kind: Service -metadata: - name: go-app-service -spec: - selector: - app: go-app - ports: - - protocol: TCP - port: 80 - targetPort: 3000 - type: LoadBalancer diff --git a/deploy/local/service.yml b/deploy/local/service.yml new file mode 100644 index 0000000..cde4773 --- /dev/null +++ b/deploy/local/service.yml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: go-app-service +spec: + selector: + app: go-app + ports: + - protocol: TCP + port: 80 + targetPort: 3000 + type: LoadBalancer diff --git a/deploy/prod/deployment.yml b/deploy/prod/deployment.yml index a30839d..473d417 100644 --- a/deploy/prod/deployment.yml +++ b/deploy/prod/deployment.yml @@ -17,9 +17,9 @@ spec: spec: containers: - name: hello-app - image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0 + image: ghcr.io/blazeisclone/spaceops-mission-ctrl:v0.0.1 ports: - - containerPort: 8080 + - containerPort: 3000 resources: requests: cpu: 200m diff --git a/deploy/prod/ingress.yml b/deploy/prod/ingress.yml index f94924b..165ca2e 100644 --- a/deploy/prod/ingress.yml +++ b/deploy/prod/ingress.yml @@ -11,4 +11,4 @@ spec: service: name: helloweb-backend port: - number: 8080 + number: 3000 diff --git a/deploy/prod/service.yml b/deploy/prod/service.yml index b49d5e8..ac65e37 100644 --- a/deploy/prod/service.yml +++ b/deploy/prod/service.yml @@ -10,5 +10,5 @@ spec: app: hello tier: web ports: - - port: 8080 - targetPort: 8080 + - port: 3000 + targetPort: 3000