Skip to content
Snippets Groups Projects
Commit 322d2762 authored by Martin Lowe's avatar Martin Lowe :flag_ca:
Browse files

Merge branch 'malowe/main/37' into 'main'

Iss #37 - Update Jenkinsfile + staging k8s for new latest-staging tag

See merge request !43
parents 11cfccdc e96fea0c
No related branches found
No related tags found
1 merge request!43Iss #37 - Update Jenkinsfile + staging k8s for new latest-staging tag
Pipeline #41368 passed
...@@ -96,6 +96,16 @@ pipeline { ...@@ -96,6 +96,16 @@ pipeline {
""", """,
returnStdout: true returnStdout: true
) )
LATEST_TAG_NAME = sh(
script: """
if [ "${env.ENVIRONMENT}" = "staging" ]; then
printf latest-staging
else
printf latest
fi
""",
returnStdout: true
)
} }
options { options {
...@@ -124,7 +134,7 @@ pipeline { ...@@ -124,7 +134,7 @@ pipeline {
readTrusted 'src/main/docker/Dockerfile.jvm' readTrusted 'src/main/docker/Dockerfile.jvm'
unstash 'target' unstash 'target'
sh ''' sh '''
docker build -f src/main/docker/Dockerfile.jvm --no-cache -t ${IMAGE_NAME}:${TAG_NAME} -t ${IMAGE_NAME}:latest . docker build -f src/main/docker/Dockerfile.jvm --no-cache -t ${IMAGE_NAME}:${TAG_NAME} -t ${IMAGE_NAME}:${LATEST_TAG_NAME} .
''' '''
} }
} }
...@@ -143,7 +153,7 @@ pipeline { ...@@ -143,7 +153,7 @@ pipeline {
withDockerRegistry([credentialsId: '04264967-fea0-40c2-bf60-09af5aeba60f', url: 'https://index.docker.io/v1/']) { withDockerRegistry([credentialsId: '04264967-fea0-40c2-bf60-09af5aeba60f', url: 'https://index.docker.io/v1/']) {
sh ''' sh '''
docker push ${IMAGE_NAME}:${TAG_NAME} docker push ${IMAGE_NAME}:${TAG_NAME}
docker push ${IMAGE_NAME}:latest docker push ${IMAGE_NAME}:${LATEST_TAG_NAME}
''' '''
} }
} }
......
...@@ -30,7 +30,7 @@ spec: ...@@ -30,7 +30,7 @@ spec:
weight: 1 weight: 1
containers: containers:
- name: app - name: app
image: eclipsefdn/eclipsefdn-cve-api:latest image: eclipsefdn/eclipsefdn-cve-api:latest-staging
imagePullPolicy: Always imagePullPolicy: Always
ports: ports:
- containerPort: 8090 - containerPort: 8090
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment