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_TOKEN = credentials('ghcr-login')
|
2024-02-16 02:34:52 +00:00
|
|
|
BLAH2_NAME = "30hours/blah2"
|
|
|
|
BLAH2_API_NAME = "30hours/blah2_api"
|
2024-02-16 00:34:41 +00:00
|
|
|
}
|
|
|
|
|
2024-02-15 12:01:41 +00:00
|
|
|
stages {
|
|
|
|
stage('Checkout') {
|
|
|
|
steps {
|
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2024-02-16 02:34:52 +00:00
|
|
|
echo 'Building the project'
|
|
|
|
sh 'docker build -t $BLAH2_NAME .'
|
|
|
|
sh 'docker build -t $BLAH2_API_NAME --file ./api/Dockerfile ./api'
|
2024-02-15 12:01:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Test') {
|
|
|
|
steps {
|
|
|
|
echo 'Running tests'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Push') {
|
|
|
|
steps {
|
2024-02-16 02:34:52 +00:00
|
|
|
sh 'echo $GHCR_TOKEN_PSW | docker login ghcr.io -u $GHCR_TOKEN_USR --password-stdin'
|
|
|
|
sh 'docker tag $BLAH2_NAME ghcr.io/$BLAH2_NAME'
|
|
|
|
sh 'docker tag $BLAH2_API_NAME ghcr.io/$BLAH2_API_NAME'
|
|
|
|
sh 'docker push ghcr.io/$BLAH2_NAME'
|
|
|
|
sh 'docker push ghcr.io/$BLAH2_API_NAME'
|
|
|
|
sh 'docker logout'
|
2024-02-15 12:01:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|