-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
29 lines (28 loc) · 938 Bytes
/
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
#!groovy
import java.time.Instant
pipeline {
agent any
options { timestamps () }
parameters {
choice(name: 'CACHE', choices: ['', '--no-cache'], description: 'Build context cache')
}
stages {
stage('Build and Publish') {
environment {
DOCKERHUB_CREDS = credentials('kubling-dockerhub')
PYPI_CREDS = credentials('kubling-pypi')
}
steps {
script {
env.NOW_SECONDS = Instant.now().getEpochSecond()
}
sh """
docker build --build-arg TWINE_USERNAME="$PYPI_CREDS_USR" --build-arg TWINE_PASSWORD="$PYPI_CREDS_PSW" \\
-t sqlalchemy-kubling-dialect-builder .
"""
sh """ docker image rm sqlalchemy-kubling-dialect-builder """
sh """ docker system prune -f """
}
}
}
}