-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathJenkinsfile
41 lines (41 loc) · 1.13 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@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:$(cat VERSION) --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg VERSION=`cat VERSION` .'
}
}
stage('Deploy docker image') {
steps {
withDockerRegistry([ credentialsId: registryCredential, url: "" ]) {
sh 'docker push $registry:$(cat VERSION)'
}
}
}
}
post {
always {
sendNotifications currentBuild.result
}
}
}