-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathci.jenkinsfile
70 lines (61 loc) · 2.13 KB
/
ci.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
@Library('pipeline-library@master')
import com.genesys.jenkins.CI
timeout(150) {
node('dev_v2') {
ECR_REPO = "490606849374.dkr.ecr.us-east-1.amazonaws.com/ai-platform"
ECR_REGISTRY_ID = "490606849374"
ECR_REGION = "us-east-1"
env.BUILD_STATUS = 'SUCCESS'
stage('test'){
sh """
echo 'test'
"""
}
stage('Clean Checkout') {
retry(3){
checkout scm
COMMIT_ID = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim()
BRANCH = sh(returnStdout: true, script: "git branch -r --contains ${COMMIT_ID}").trim().split('/')[-1]
COMMIT_TAG = sh(returnStdout: true, script: "(git describe --exact-match ${COMMIT_ID}) 2> /dev/null || git show-ref --tags -d | grep ^${COMMIT_ID} | sed -e 's,.* refs/tags/,,' -e 's/\\^{}//' | xargs || echo ''").trim()
if(BRANCH.equals("master")) {
NICKNAME = 'main'
} else {
NICKNAME = 'PR'
}
sh "echo ${NICKNAME}"
sh """
rm -rf allure-results
mkdir allure-results
"""
withCredentials([usernamePassword(credentialsId: params.CREDENTIALSID, usernameVariable: 'user', passwordVariable: 'password')]) {
sh """
rm -rf pip.conf
echo '[global]' >> pip.conf
echo 'extra-index-url = https://$user:[email protected]/purecloud/api/pypi/inin-pypi/simple' >> pip.conf
"""
}
}
}
stage('Build package and publish to artifactory') {
sh """
curl https://sh.rustup.rs -sSf | sh -s -- -y
"""
sh """
source $HOME/.cargo/env
virtualenv -p python3.7 venv --clear
. venv/bin/activate
pip install setuptools_rust==0.8.4
cd python
python setup.py bdist_wheel upload -r inin-pypi
"""
sh """
source $HOME/.cargo/env
virtualenv -p python3.8 venv --clear
. venv/bin/activate
pip install setuptools_rust==0.8.4
cd python
python setup.py bdist_wheel upload -r inin-pypi
"""
}
}
}