2024-02-15 12:01:41 +00:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
|
2024-02-16 00:34:41 +00:00
|
|
|
environment {
|
|
|
|
GHCR_REGISTRY = "ghcr.io"
|
|
|
|
GHCR_USERNAME = credentials('30hours')
|
|
|
|
GHCR_TOKEN = credentials('ghcr-login')
|
|
|
|
}
|
|
|
|
|
2024-02-15 12:01:41 +00:00
|
|
|
stages {
|
|
|
|
stage('Checkout') {
|
|
|
|
steps {
|
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2024-02-15 13:17:51 +00:00
|
|
|
script {
|
|
|
|
echo 'Building the project'
|
|
|
|
blah2 = docker.build("30hours/blah2", "--file ./Dockerfile .")
|
2024-02-16 00:34:41 +00:00
|
|
|
blah2_api = docker.build("30hours/blah2", "--file ./api/Dockerfile ./api")
|
2024-02-15 13:17:51 +00:00
|
|
|
}
|
2024-02-15 12:01:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Test') {
|
|
|
|
steps {
|
|
|
|
echo 'Running tests'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Push') {
|
|
|
|
steps {
|
2024-02-16 00:38:08 +00:00
|
|
|
script {
|
|
|
|
echo 'Pushing the application'
|
2024-02-16 00:34:41 +00:00
|
|
|
|
2024-02-16 00:38:08 +00:00
|
|
|
docker.withRegistry("${GHCR_REGISTRY}", "${GHCR_TOKEN}") {
|
|
|
|
blah2.push()
|
|
|
|
blah2_api.push()
|
|
|
|
}
|
2024-02-16 00:34:41 +00:00
|
|
|
}
|
2024-02-15 12:01:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|