Commit bb4089d3 authored by bill lin's avatar bill lin

lsdfhsldsl

parent caf73282
pipeline {
agent {
agent {
docker {
image 'maven:3.3.9'
args '-v /root/jenkins/data/mvn/settings.xml:/usr/share/maven/conf/settings.xml -v /root/jenkins/data/mvn/maven-repo:/data/maven-repo -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker -u root:994'
}
}
stages {
stage('BUILD IMAGE') {
steps {
sh '''
docker build -t $registry_address/$image_name:latest .'''
}
}
stage('PUSH IMAGE') {
steps {
sh '''docker login -u deployment -p deployment123 nexus.gsstcloud.com:8093
docker push $registry_address/$image_name:latest
ssh -o "StrictHostKeyChecking no" root@192.168.12.47 date '''
stages {
stage('Build') {
steps {
sh '''
mvn -B -DskipTests clean package
'''
}
}
}
stage('REMOVE LOCAL IMAGE') {
steps {
sh '''docker rmi -f $registry_address/$image_name:latest'''
}
}
stage('Cleanup') {
steps {
cleanWs(deleteDirs: true)
}
}
}
environment {
registry_address = 'nexus.gsstcloud.com:8093/test'
image_name = 'lxnginx'
app_server_sit = '192.168.12.47'
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment