1+ pipeline {
2+ agent none
3+ parameters {
4+ choice(name : ' CBL_EDITION' , choices : [' enterprise' , ' community' ], description : ' Couchbase Lite Edition' )
5+ string(name : ' CBL_VERSION' , defaultValue : ' 4.0.0' , description : ' Couchbase Lite Version' )
6+ string(name : ' CBL_BUILD' , defaultValue : ' ' , description : ' Couchbase Lite Build Number' )
7+ string(name : ' CBL_DATASET_VERSION' , defaultValue : ' 4.0' , description : " The dataset version to use (e.g. 3.2 or 4.0)" )
8+ string(name : ' SGW_VERSION' , defaultValue : ' ' , description : " The version of Sync Gateway to download" )
9+ }
10+ stages {
11+ stage(' Init' ) {
12+ steps {
13+ script {
14+ if (params. CBL_VERSION == ' ' ) { error " CBL_VERSION is required" }
15+ if (params. CBL_BUILD == ' ' ) { error " CBL_BUILD is required" }
16+ if (params. SGW_VERSION == ' ' ) { error " SGW_VERSION is required" }
17+ currentBuild. displayName = " ${ params.CBL_VERSION} -${ params.CBL_BUILD} -${ CBL_EDITION} (#${ currentBuild.number} )"
18+ currentBuild. description = " Dataset: ${ params.CBL_DATASET_VERSION} "
19+ }
20+ }
21+ }
22+ stage(' Run Test' ) {
23+ agent { label ' mac-mini-new' }
24+ environment {
25+ KEYCHAIN_PASSWORD = credentials(' mobile-qe-keychain' )
26+ }
27+ steps {
28+ // Unlock keychain:
29+ sh ' security unlock-keychain -p ${KEYCHAIN_PASSWORD} ~/Library/Keychains/login.keychain-db'
30+ echo " Run iOS Test"
31+ timeout(time : 60 , unit : ' MINUTES' ) {
32+ sh """
33+ export PATH="/opt/homebrew/opt/python@3.10/bin:/opt/homebrew/bin:/usr/local/bin:\$ PATH"
34+ export AWS_PROFILE=mobile-for-now
35+ jenkins/pipelines/QE/ios/test.sh ${ params.CBL_EDITION} ${ params.CBL_VERSION} ${ params.CBL_BUILD} ${ params.CBL_DATASET_VERSION} ${ params.SGW_VERSION} ~/.ssh/jborden.pem
36+ """
37+
38+ }
39+ }
40+ post {
41+ always {
42+ echo " Teardown iOS Test"
43+ timeout(time : 5 , unit : ' MINUTES' ) {
44+ sh """
45+ export PATH="/opt/homebrew/opt/python@3.10/bin:/opt/homebrew/bin:/usr/local/bin:\$ PATH"
46+ export AWS_PROFILE=mobile-for-now
47+ jenkins/pipelines/QE/ios/teardown.sh
48+ """
49+ }
50+ }
51+ }
52+ }
53+ }
54+ post {
55+ failure {
56+ mail bcc : ' ' , body : " Project: <a href='${ env.BUILD_URL} '>${ env.JOB_NAME} </a> has failed!" , cc : ' ' , charset : ' UTF-8' , from : ' jenkins@couchbase.com' , mimeType : ' text/html' , replyTo : ' no-reply@couchbase.com' , subject : " ${ env.JOB_NAME} failed" , to : " vipul.bhardwaj@couchbase.com" ;
57+ }
58+ }
59+ }
0 commit comments