This commit is contained in:
25
Jenkinsfile
vendored
25
Jenkinsfile
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
def repo = 'nexus.ingress.lab.gitfitlive.com'
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent {
|
||||||
kubernetes {
|
kubernetes {
|
||||||
@@ -10,7 +12,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: docker-client
|
- name: docker-client
|
||||||
image: harbor.ingress.lab.gitfitlive.com/mirror/docker:latest
|
image: ${repo}/docker-proxy/docker:latest
|
||||||
command: ['cat']
|
command: ['cat']
|
||||||
tty: true
|
tty: true
|
||||||
env:
|
env:
|
||||||
@@ -27,7 +29,7 @@ spec:
|
|||||||
mountPath: /certs
|
mountPath: /certs
|
||||||
readOnly: true
|
readOnly: true
|
||||||
- name: docker-dind
|
- name: docker-dind
|
||||||
image: harbor.ingress.lab.gitfitlive.com/mirror/docker:dind
|
image: ${repo}/docker-proxy/docker:dind
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
env:
|
env:
|
||||||
@@ -44,8 +46,7 @@ spec:
|
|||||||
}
|
}
|
||||||
|
|
||||||
environment {
|
environment {
|
||||||
HARBOR = 'harbor.ingress.lab.gitfitlive.com'
|
CONTAINER_NAME = "${repo}/docker-hosted/resume:latest"
|
||||||
CONTAINER_NAME = 'harbor.ingress.lab.gitfitlive.com/oasis/resume:latest'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
@@ -66,13 +67,13 @@ spec:
|
|||||||
|
|
||||||
withCredentials([
|
withCredentials([
|
||||||
usernamePassword(
|
usernamePassword(
|
||||||
credentialsId: 'harbor-credentials',
|
credentialsId: 'nexus-admin',
|
||||||
usernameVariable: 'HARBOR_USERNAME',
|
usernameVariable: 'USERNAME',
|
||||||
passwordVariable: 'HARBOR_PASSWORD'
|
passwordVariable: 'PASSWORD'
|
||||||
)
|
)
|
||||||
]) {
|
]) {
|
||||||
sh """
|
sh """
|
||||||
echo "\$HARBOR_PASSWORD" | docker login -u "\$HARBOR_USERNAME" https://harbor.ingress.lab.gitfitlive.com --password-stdin
|
echo "\$PASSWORD" | docker login -u "\$USERNAME" https://${repo} --password-stdin
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,13 +96,13 @@ spec:
|
|||||||
steps {
|
steps {
|
||||||
withCredentials([
|
withCredentials([
|
||||||
usernamePassword(
|
usernamePassword(
|
||||||
credentialsId: 'harbor-credentials',
|
credentialsId: 'nexus-admin',
|
||||||
usernameVariable: 'HARBOR_USERNAME',
|
usernameVariable: 'USERNAME',
|
||||||
passwordVariable: 'HARBOR_PASSWORD'
|
passwordVariable: 'PASSWORD'
|
||||||
)
|
)
|
||||||
]) {
|
]) {
|
||||||
sh """
|
sh """
|
||||||
docker login -u "\$HARBOR_USERNAME" -p "\$HARBOR_PASSWORD" https://harbor.ingress.lab.gitfitlive.com
|
docker login -u "\$USERNAME" -p "\$PASSWORD" https://${repo}
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
echo "Pulling the docker image..."
|
echo "Pulling the docker image..."
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM harbor.ingress.lab.gitfitlive.com/mirror/nginx:alpine
|
FROM nexus.ingress.lab.gitfitlive.com/docker-proxy/nginx:alpine
|
||||||
|
|
||||||
|
|
||||||
RUN rm -rf /usr/share/nginx/html/*
|
RUN rm -rf /usr/share/nginx/html/*
|
||||||
|
|||||||
Reference in New Issue
Block a user