forked from getumbrel/llama-gpt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
45 lines (44 loc) · 1.16 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
pipeline {
agent any
environment {
dockerpw = credentials('Dockerhub PW')
versionauth = credentials('VersionAuth')
}
parameters {
choice(
choices: ['build' , 'push'],
description: 'Select "push" to push to repo',
name: 'BUILD_ACTION')
}
stages {
stage('Build') {
steps {
sh (
script: '''
docker login --username=nativeplanet --password=$dockerpw
docker build -t nativeplanet/llama-gpt:latest .
''',
returnStdout: true
)
}
}
stage('Push') {
when {
expression { params.BUILD_ACTION == 'push' }
}
steps {
sh (
script: '''
docker push nativeplanet/llama-gpt:latest
''',
returnStdout: true
)
}
}
}
post {
always {
cleanWs deleteDirs: true, notFailBuild: true
}
}
}