Update sslproxy jenkinsfile to use xai command line

This commit is contained in:
2020-06-06 21:22:23 -04:00
parent 10b5a1e012
commit d6ac34d2fe
2 changed files with 14 additions and 27 deletions

6
.idea/webServers.xml generated
View File

@@ -3,21 +3,21 @@
<component name="WebServers"> <component name="WebServers">
<option name="servers"> <option name="servers">
<webServer id="daf12c1b-6008-42e3-896d-a26fa1e45573" name="home.xai-corp.net" url="http://192.168.2.11"> <webServer id="daf12c1b-6008-42e3-896d-a26fa1e45573" name="home.xai-corp.net" url="http://192.168.2.11">
<fileTransfer host="192.168.2.11" port="22" privateKey="$USER_HOME$/.ssh/id_rsa" accessType="SFTP" username="ansible" keyPair="true"> <fileTransfer accessType="SFTP" sshConfigId="88179942-7033-4d53-a907-4d234e4f0c24" sshConfig="home.xai-corp.net" username="ansible">
<advancedOptions> <advancedOptions>
<advancedOptions dataProtectionLevel="Private" /> <advancedOptions dataProtectionLevel="Private" />
</advancedOptions> </advancedOptions>
</fileTransfer> </fileTransfer>
</webServer> </webServer>
<webServer id="e1bf22a3-9b3a-46cf-b9eb-09005d4c9e40" name="home02.xai-corp.net" url="http://192.168.2.22"> <webServer id="e1bf22a3-9b3a-46cf-b9eb-09005d4c9e40" name="home02.xai-corp.net" url="http://192.168.2.22">
<fileTransfer host="192.168.2.22" port="22" privateKey="$USER_HOME$/.ssh/id_rsa" accessType="SFTP" username="ansible" keyPair="true"> <fileTransfer accessType="SFTP" sshConfigId="a5b66670-445f-4d09-adf1-be21f0206074" sshConfig="home02.xai-corp.net" username="ansible">
<advancedOptions> <advancedOptions>
<advancedOptions dataProtectionLevel="Private" /> <advancedOptions dataProtectionLevel="Private" />
</advancedOptions> </advancedOptions>
</fileTransfer> </fileTransfer>
</webServer> </webServer>
<webServer id="5ea0148a-6c7a-4234-aeb2-def267ab69c8" name="web01.xai-corp.net" url="http://192.168.2.18"> <webServer id="5ea0148a-6c7a-4234-aeb2-def267ab69c8" name="web01.xai-corp.net" url="http://192.168.2.18">
<fileTransfer host="192.168.2.18" port="22" privateKey="$USER_HOME$/.ssh/id_rsa" accessType="SFTP" username="ansible" keyPair="true"> <fileTransfer accessType="SFTP" sshConfigId="a4ebeb2f-1c23-4fa8-a856-2d3c9902b799" sshConfig="web01.xai-corp.net" username="ansible">
<advancedOptions> <advancedOptions>
<advancedOptions dataProtectionLevel="Private" /> <advancedOptions dataProtectionLevel="Private" />
</advancedOptions> </advancedOptions>

View File

@@ -28,12 +28,15 @@ pipeline {
stage('build') { stage('build') {
steps { steps {
dir(WORKDIR) { dir(WORKDIR) {
script { withDockerRegistry(credentialsId: 'b11d7f1a-81ac-4daf-8842-56afc0d2370e', url: 'http://dkregistry.xai-corp.net:5000') {
docker.withRegistry('http://dkregistry.xai-corp.net:5000', 'b11d7f1a-81ac-4daf-8842-56afc0d2370e') { // script {
def customImage = docker.build("dkregistry.xai-corp.net:5000/sslproxy:2.1", "-f ${DOCKERFILE} .") // docker.withRegistry('http://dkregistry.xai-corp.net:5000', 'b11d7f1a-81ac-4daf-8842-56afc0d2370e') {
customImage.push() // def customImage = docker.build("dkregistry.xai-corp.net:5000/sslproxy:2.1", "-f ${DOCKERFILE} .")
} // customImage.push()
} // }
// }
sh "xai build"
}
} }
} }
} }
@@ -42,31 +45,15 @@ pipeline {
steps { steps {
dir(WORKDIR) { dir(WORKDIR) {
withDockerRegistry(credentialsId: 'b11d7f1a-81ac-4daf-8842-56afc0d2370e', url: 'http://dkregistry.xai-corp.net:5000') { withDockerRegistry(credentialsId: 'b11d7f1a-81ac-4daf-8842-56afc0d2370e', url: 'http://dkregistry.xai-corp.net:5000') {
sh """ sh "xai deploy"
export DOCKER_HOST=${DOCKER_HOST}
docker stack deploy --with-registry-auth --prune -c docker-compose-prod.yml sslproxy
(cd ../ && chmod +x ./scaleout.sh && ./scaleout.sh sslproxy_app 30)
"""
} }
} }
} }
}
stage('smoke tests') {
steps {
dir(WORKDIR) {
sleep 10
sh "curl -If https://git.xai-corp.net/"
}
}
post { post {
failure { failure {
dir(WORKDIR) { dir(WORKDIR) {
withDockerRegistry(credentialsId: 'b11d7f1a-81ac-4daf-8842-56afc0d2370e', url: 'http://dkregistry.xai-corp.net:5000') { withDockerRegistry(credentialsId: 'b11d7f1a-81ac-4daf-8842-56afc0d2370e', url: 'http://dkregistry.xai-corp.net:5000') {
sh """ sh "xai rollback"
export DOCKER_HOST=${DOCKER_HOST}
docker service rollback sslproxy_app
"""
} }
} }
} }