-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
47 lines (42 loc) · 1.28 KB
/
Jenkinsfile
File metadata and controls
47 lines (42 loc) · 1.28 KB
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
pipeline {
agent { label 'ubuntu' }
environment {
IMAGE_NAME = "python-selenium-test"
}
stages {
stage('Clone Repo') {
steps {
// git url: 'https://github.com/GangadharUppin/python_selenium_git_code.git', branch: 'master'
deleteDir() // clean workspace
checkout scm
}
}
stage('Build Docker Image') {
steps {
sh '''
docker build -t ${IMAGE_NAME} -f integrate_ci_cd/Dockerfile .
'''
}
}
stage('Run Tests Using Docker (on EC2 host)') {
steps {
sh '''
#!/bin/bash
docker run --rm -v /dev/shm:/dev/shm ${IMAGE_NAME} pytest tests -vm sanity
'''
}
}
}
post {
always {
//archiveArtifacts artifacts: 'screenshots/*.png', allowEmptyArchive: true
emailext (
subject: "Test Email - ${env.JOB_NAME} #${env.BUILD_NUMBER}",
body: "<p>This is a test email from Jenkinsfile</p>",
mimeType: 'text/html',
to: "akhilagangadharuppin@gmail.com",
attachLog: true
)
}
}
}