-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
27 lines (27 loc) · 856 Bytes
/
Jenkinsfile
File metadata and controls
27 lines (27 loc) · 856 Bytes
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
pipeline {
agent any
environment {
// Define any environment variables needed for the pipeline
IMAGE_NAME = 'recommender-microservice'
CONTAINER_NAME = 'recommender-microservice-container'
DOCKERHUB_CREDENTIALS = credentials('dockerhub_amina')
}
stages {
stage('Dockerize') {
steps {
script {
echo 'Dockerizing...'
sh "docker build -t aminabakkali/${IMAGE_NAME} ."
}
}
}
stage('Login + Push') {
steps {
echo 'Login...'
sh 'echo $DOCKERHUB_CREDENTIALS_PSW | docker login -u $DOCKERHUB_CREDENTIALS_USR --password-stdin'
echo 'Pushing...'
sh "docker push aminabakkali/${IMAGE_NAME}"
}
}
}
}