forked from ozalboher/IntegratorPortal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
35 lines (30 loc) · 817 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
33
34
35
pipeline {
agent any
environment {
DOCKER_USER = credentials('DOCKER_USER')
DOCKER_TOKEN = credentials('DOCKER_TOKEN')
GITHUB_RUN_ID = "${BUILD_NUMBER}"
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Build Docker Image') {
steps {
sh 'docker build -t giladalboher/integratorportal:v1.0.$GITHUB_RUN_ID .'
}
}
stage('Login to Docker Hub') {
steps {
sh 'echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin'
}
}
stage('Docker Push') {
steps {
sh 'docker push giladalboher/integratorportal:v1.0.$GITHUB_RUN_ID'
}
}
}
}