tobiasmanske.de/Jenkinsfile

56 lines
2.0 KiB
Plaintext
Raw Normal View History

2021-03-21 17:53:35 +01:00
@Library("Pages")_
pipeline {
agent any
2021-03-21 15:32:57 +01:00
environment {
WATCHTOWER_TOKEN = credentials("watchtower-token")
}
stages {
stage('Cloning our Git') {
steps {
2021-04-14 21:25:39 +02:00
checkout([$class: 'GitSCM',
branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'SubmoduleOption',
disableSubmodules: false,
parentCredentials: false,
recursiveSubmodules: true,
reference: '',
trackingSubmodules: false]],
submoduleCfg: [],
userRemoteConfigs: [[url: 'https://git.tobiasmanske.de/user/rad4day/public/blog/']]])
}
}
stage('Build HTML') {
steps {
2021-04-14 21:25:39 +02:00
script {
docker.withRegistry('https://registry.chaoswg.org:5000', 'docker-registry-credentials') {
2021-03-25 03:38:38 +01:00
def dockerImage = docker.image('registry.chaoswg.org:5000/alpine-avif-webp:latest')
2021-04-14 21:25:39 +02:00
dockerImage.pull()
}
}
2021-03-25 03:38:38 +01:00
sh 'docker pull klakegg/hugo:alpine'
2021-03-25 03:38:38 +01:00
2021-09-21 23:37:42 +02:00
sh 'docker run --rm -v "$PWD:/src" registry.chaoswg.org:5000/alpine-avif-webp:latest'
2022-01-12 17:12:54 +01:00
sh 'docker run --rm -v "$PWD:/src" klakegg/hugo:alpine --minify'
}
}
stage('Deploying Docker Image') {
steps {
2021-03-21 17:53:35 +01:00
DeployPages("./docs", "tobiasmanske.de:latest")
}
}
stage('Cleaning Up') {
steps{
sh "docker rmi --force tobiasmanske.de:latest"
2021-03-21 15:39:45 +01:00
cleanWs()
}
}
}
}