mirror of
https://github.com/30hours/blah2.git
synced 2024-11-18 12:33:58 +00:00
Add push to jenkins
This commit is contained in:
parent
6e1e7c0c27
commit
76d83721eb
1 changed files with 13 additions and 1 deletions
14
Jenkinsfile
vendored
14
Jenkinsfile
vendored
|
@ -1,6 +1,12 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
|
environment {
|
||||||
|
GHCR_REGISTRY = "ghcr.io"
|
||||||
|
GHCR_USERNAME = credentials('30hours')
|
||||||
|
GHCR_TOKEN = credentials('ghcr-login')
|
||||||
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Checkout') {
|
stage('Checkout') {
|
||||||
steps {
|
steps {
|
||||||
|
@ -12,7 +18,7 @@ pipeline {
|
||||||
script {
|
script {
|
||||||
echo 'Building the project'
|
echo 'Building the project'
|
||||||
blah2 = docker.build("30hours/blah2", "--file ./Dockerfile .")
|
blah2 = docker.build("30hours/blah2", "--file ./Dockerfile .")
|
||||||
blah2_api = docker.build("30hours/blah2", "--file ./api/Dockerfile .")
|
blah2_api = docker.build("30hours/blah2", "--file ./api/Dockerfile ./api")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +30,12 @@ pipeline {
|
||||||
stage('Push') {
|
stage('Push') {
|
||||||
steps {
|
steps {
|
||||||
echo 'Pushing the application'
|
echo 'Pushing the application'
|
||||||
|
|
||||||
|
docker.withRegistry("${GHCR_REGISTRY}", "${GHCR_TOKEN}") {
|
||||||
|
blah2.push()
|
||||||
|
blah2_api.push()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue