-
Notifications
You must be signed in to change notification settings - Fork 28
/
Jenkinsfile
51 lines (48 loc) · 1.41 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
50
51
/* groovylint-disable-next-line CompileStatic */
pipeline {
agent {
node {
label 'built-in'
}
}
environment {
PASSWORD = credentials('OPENSSL_PASSWORD')
USER_CREDENTIALS = credentials('github')
GIT_COMMIT_HASH = sh(script: "git log -n 1 --pretty=format:'%H'", returnStdout: true)
}
stages {
stage('Main') {
steps {
script {
/* groovylint-disable-next-line GStringExpressionWithinString, LineLength */
sh 'curl -L "https://raw.githubusercontent.com/PixysOS/official_devices/${GIT_COMMIT_HASH}/.github/scripts.tar.gz" --output scripts.tar.gz'
sh 'openssl enc -d -aes256 -salt -pbkdf2 -in scripts.tar.gz -pass env:PASSWORD | tar xz'
sh 'bash runner.sh'
}
}
}
}
post {
cleanup {
script {
if (getContext(hudson.FilePath)) {
cleanWs()
}
}
}
success {
script {
if (getContext(hudson.FilePath)) {
sh 'python3 update_api.py SUCCESS'
}
}
}
failure {
script {
if (getContext(hudson.FilePath)) {
sh 'python3 update_api.py FAILURE'
}
}
}
}
}