Files
codejava.tech/Jenkinsfile
2026-02-18 11:25:21 +03:00

39 lines
999 B
Groovy

pipeline {
agent any
environment {
DEPLOY_PATH = '/var/www/codejava.tech'
}
stages {
stage('Install Hugo') {
steps {
sh '''
wget -q https://github.com/gohugoio/hugo/releases/download/v0.145.0/hugo_extended_0.145.0_linux-amd64.tar.gz
tar -xzf hugo_extended_0.145.0_linux-amd64.tar.gz
mv hugo /usr/local/bin/hugo
'''
}
}
stage('Build') {
steps {
sh 'hugo --minify'
}
}
stage('Deploy') {
steps {
sh '''
rsync -az --delete -e "ssh -o StrictHostKeyChecking=no" \
public/ root@172.17.0.1:${DEPLOY_PATH}/
'''
}
}
}
post {
success {
echo 'Deployment successful! Visit https://codejava.tech'
}
failure {
echo 'Deployment failed!'
}
}
}