-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile_CI
52 lines (51 loc) · 1.33 KB
/
Jenkinsfile_CI
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
42
43
44
45
46
47
48
49
50
51
52
pipeline {
agent any
stages {
stage('clone') {
steps {
echo 'Hello World'
}
}
stage('Clone Project') {
steps {
git url: 'https://github.com/nagavenkateshgowru/UdacityCapstone.git'
}
}
stage('PyLint Test') {
steps {
sh 'pwd'
sh 'ls'
sh 'which python'
sh 'env'
sh 'pylint ./app/app.py'
}
}
stage('Test Flask APP') {
steps {
sh 'pwd'
sh 'env'
sh 'export PYTHONPATH=$WORKSPACE'
sh 'env'
sh 'python ./test/test.py'
}
}
stage('Build Image') {
steps {
sh 'echo ${USER}'
sh 'docker build -t test:0.${BUILD_ID} .'
}
}
stage('Push Image') {
steps {
sh 'docker tag test:0.${BUILD_ID} nagavenkateshg/udacitycapstone:0.${BUILD_ID}'
sh 'docker push nagavenkateshg/udacitycapstone:0.${BUILD_ID}'
}
}
stage('Invoking some other Jenkins job') {
steps {
echo "Building my-other-job-name"
build job: 'UdacityCD', parameters: [string(name: 'IMAGE_NAME', value: 'nagavenkateshg/udacitycapstone:0.' + String.valueOf(BUILD_ID))]
}
}
}
}