Build docker image and push it to registry
Some checks failed
Amarillo/amarillo-gitea/amarillo-core/pipeline/head There was a failure building this commit
Some checks failed
Amarillo/amarillo-gitea/amarillo-core/pipeline/head There was a failure building this commit
This commit is contained in:
parent
5a2ad2f119
commit
7b53fb1479
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
|
|
@ -8,6 +8,10 @@ pipeline {
|
||||||
environment {
|
environment {
|
||||||
GITEA_CREDS = credentials('AMARILLO-JENKINS-GITEA-USER')
|
GITEA_CREDS = credentials('AMARILLO-JENKINS-GITEA-USER')
|
||||||
TWINE_REPO_URL = "https://git.gerhardt.io/api/packages/amarillo/pypi"
|
TWINE_REPO_URL = "https://git.gerhardt.io/api/packages/amarillo/pypi"
|
||||||
|
REGISTRY_URL = 'git.gerhardt.io'
|
||||||
|
OWNER = 'amarillo'
|
||||||
|
IMAGE_NAME = "amarillo"
|
||||||
|
TAG = 'latest'
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Create virtual environment') {
|
stage('Create virtual environment') {
|
||||||
|
|
@ -31,7 +35,7 @@ pipeline {
|
||||||
echo 'Testing'
|
echo 'Testing'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build') {
|
stage('Build package') {
|
||||||
steps {
|
steps {
|
||||||
echo 'Building package'
|
echo 'Building package'
|
||||||
sh 'python -m build'
|
sh 'python -m build'
|
||||||
|
|
@ -42,6 +46,20 @@ pipeline {
|
||||||
sh 'python -m twine upload --skip-existing --verbose --repository-url $TWINE_REPO_URL --username $GITEA_CREDS_USR --password $GITEA_CREDS_PSW ./dist/*'
|
sh 'python -m twine upload --skip-existing --verbose --repository-url $TWINE_REPO_URL --username $GITEA_CREDS_USR --password $GITEA_CREDS_PSW ./dist/*'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stage('Build docker image') {
|
||||||
|
steps {
|
||||||
|
echo 'Building image'
|
||||||
|
docker.build("${OWNER}/${IMAGE_NAME}:${TAG}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Push image to container registry') {
|
||||||
|
steps {
|
||||||
|
echo 'Pushing image to registry'
|
||||||
|
docker.withRegistry(REGISTRY_URL, GITEA_CREDS){
|
||||||
|
docker.image("${OWNER}/${IMAGE_NAME}:${TAG}").push()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue