This repository has been archived by the owner on Jan 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
49 lines (42 loc) · 2.05 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
def label = "jenkins-node-${UUID.randomUUID().toString()}"
podTemplate(label: label, containers: [
containerTemplate(name: 'maven', image: '086658912680.dkr.ecr.eu-west-1.amazonaws.com/cvs/maven-builder:latest', ttyEnabled: true, command: 'cat'),])
{
node(label) {
container('maven'){
withFolderProperties{
LBRANCH="${env.BRANCH}".toLowerCase()
}
APP_ID=""
stage('checkout') {
checkout scm
}
stage('Get IPA from AWS S3') {
withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'jenkins-iam', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
sh "aws s3 cp s3://dvsa-cvs-mobile-artefacts/files/${LBRANCH}.txt ${LBRANCH}.txt"
}
}
stage('install ipa in browserstack') {
sh "wget -O CVSMobile.ipa `cat ${LBRANCH}.txt`"
withCredentials([usernameColonPassword(credentialsId: 'browserstack-uploader', variable: 'BROWSERSTACK_CREDS')]) {
APP_ID=sh(script: 'curl -u $BROWSERSTACK_CREDS -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@CVSMobile.ipa" | jq ".app_url"',returnStdout: true).trim()
}
}
stage ("test") {
browserstack('browserstack') {
sh "mvn --batch-mode clean install -PCI-Browserstack -DBROWSERSTACK_APP_ID=${APP_ID} -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
}
}
stage("create report"){
publishHTML (target: [ allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'target/site/serenity',
reportFiles: 'index.html',
reportName: 'DVSA CVS Mobile Automation',
reportTitles: 'DVSA CVS Mobile Automation'
])
}
}
}
}