Skip to content

Commit

Permalink
add Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
WindSekirun (wind.seo) authored Oct 13, 2019
1 parent a88ca6b commit 7b3ff68
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@Library('jenkins-shared-library')_
pipeline {
environment {
registry = "windsekirun/jenkins-android-docker"
registryCredential = 'DockerHub'
}
agent any
stages {
stage ('Start') {
steps {
sendNotifications 'STARTED'
}
}
stage('Environment') {
parallel {
stage('display') {
steps {
sh 'ls -la'
}
}
}
}
stage('Build docker image') {
steps {
sh 'docker build -t $registry:latest --build-arg VCS_REF=`git rev-parse --short HEAD` .'
}
}
stage('Deploy docker image') {
steps {
withDockerRegistry([ credentialsId: registryCredential, url: "" ]) {
sh 'docker push $registry:latest'
}
}
}
stage('Clean docker image') {
steps{
script {
try {
sh "docker rmi $registry"
} catch (Exception e) {
echo err.getMessage()
}
}
}
}
}
post {
always {
sendNotifications currentBuild.result
}
}
}

0 comments on commit 7b3ff68

Please sign in to comment.