-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
32 lines (31 loc) · 911 Bytes
/
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
#!/usr/bin/env groovy
pipeline {
agent any
stages {
stage('pipeline start') {
steps {
sh 'echo "pipeline initiated.."'
}
}
stage('build docker image') {
steps {
sh 'git clone https://github.com/bala2289/website-counter.git'
sh 'cd website-counter'
sh builddate=`date +"%m-%d-%y-%H-%M"`
sh 'docker build -t website-counter:$builddate .'
sh 'docker tag website-counter:$builddate bala2289/website-counter:$builddate'
}
}
stage('docker push') {
steps {
sh 'docker login --username -p'
sh 'docker push website-counter'
}
}
post {
always {
echo 'Cleaning up..'
sh 'docker rmi website-counter'
}
}
}