Skip to content

Commit 34885d4

Browse files
tasking to hook to argocd in dev env
1 parent 50a73a0 commit 34885d4

File tree

3 files changed

+75
-28
lines changed

3 files changed

+75
-28
lines changed

.github/workflows/build-package-mock-ims.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,31 @@ jobs:
6161
APP: '${{matrix.app}}'
6262
run: |
6363
echo "APP_LOWERCASE=${APP,,}" >> $GITHUB_ENV
64+
65+
- name: Generate Date-Time Tag
66+
id: tag
67+
run: |
68+
# Get the current date-time in YYYYMMDDHHMMSS format
69+
TIMESTAMP=$(date +"%Y%m%d%H%M%S")
70+
echo "Generated tag: $TIMESTAMP"
71+
# Store it as an output to use in later steps
72+
echo "GIT_TAG=$TIMESTAMP" >> $GITHUB_ENV
73+
74+
- name: Update k8s wids-idsse-1 deployments with git tag
75+
if: ${{ github.ref == 'refs/heads/main' }}
76+
run: |
77+
sed -i "s/proxy:[^ ]\+/proxy:${GIT_TAG}/g" ./deployments/wids-idsse-1/nwsc-proxy.yml
78+
79+
- name: Pull before Push
80+
run: |
81+
git pull origin main
82+
83+
- name: Commit & push changes to k8s dev deployment yaml files
84+
if: ${{ github.ref == 'refs/heads/main' }}
85+
uses: actions-js/push@master
86+
with:
87+
message: Update k8s dev deployment yamls with git tag
88+
github_token: ${{ secrets.GITHUB_TOKEN }}
6489

6590
- name: Build Image
6691
run: |
@@ -69,13 +94,13 @@ jobs:
6994
--build-arg BUILDVER="${{env.VERSION}}" \
7095
--build-arg COMMITBRANCH=${{env.BRANCH}} \
7196
--build-arg COMMITSHA=${{github.sha}} \
72-
-t ${{env.DEV_REGISTRY}}/${{env.APP_LOWERCASE}}:${{env.BRANCH}} \
97+
-t ${{env.DEV_REGISTRY}}/${{env.APP_LOWERCASE}}:${{env.GIT_TAG}} \
7398
-f ./docker/nwsc_proxy/dev/Dockerfile .
7499
75100
- name: Run Trivy vulnerability scanner
76101
uses: aquasecurity/trivy-action@master
77102
with:
78-
image-ref: '${{env.DEV_REGISTRY}}/${{env.APP_LOWERCASE}}:${{env.BRANCH}}'
103+
image-ref: '${{env.DEV_REGISTRY}}/${{env.APP_LOWERCASE}}:${{env.GIT_TAG}}'
79104
format: 'table'
80105
#exit-code: '1'
81106
ignore-unfixed: true
@@ -101,7 +126,7 @@ jobs:
101126

102127
- name: Push Image to Dev Registry
103128
run: |
104-
docker push ${{env.DEV_REGISTRY}}/${{env.APP_LOWERCASE}}:${{env.BRANCH}}
129+
docker push ${{env.DEV_REGISTRY}}/${{env.APP_LOWERCASE}}:${{env.GIT_TAG}}
105130
job2:
106131
name: NWSC Proxy Service - UAT
107132
needs: job1
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: nwsc-proxy-deployment
5+
namespace: idsse
6+
spec:
7+
replicas: 1
8+
selector:
9+
matchLabels:
10+
app: nwsc-proxy
11+
template:
12+
metadata:
13+
labels:
14+
app: nwsc-proxy
15+
spec:
16+
containers:
17+
- name: nwsc-proxy
18+
image: ghcr.io/noaa-gsl/idss/service/ims-gateway/proxy:main
19+
imagePullPolicy: Always
20+
resources:
21+
requests:
22+
memory: 128Mi
23+
cpu: 50m
24+
limits:
25+
memory: 256Mi
26+
cpu: 250m
27+
ports:
28+
- containerPort: 5000
29+
name: service
30+
restartPolicy: Always
31+
imagePullSecrets:
32+
- name: ghcr-io-dockerconfig
33+
---
34+
apiVersion: v1
35+
kind: Service
36+
metadata:
37+
name: nwscproxy
38+
namespace: idsse
39+
spec:
40+
# ClusterIP is internal to k8s only
41+
type: ClusterIP
42+
selector:
43+
app: nwsc-proxy
44+
ports:
45+
- name: service
46+
port: 5000
47+
targetPort: 5000

docker/nwsc_proxy/local/Dockerfile

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)