Files
codejava.tech/Jenkinsfile
2026-02-18 11:26:46 +03:00

39 lines
995 B
Groovy

pipeline {
agent any
environment {
DEPLOY_PATH = '/var/www/codejava.tech'
}
stages {
stage('Install Hugo') {
steps {
sh '''
curl -sL https://github.com/gohugoio/hugo/releases/download/v0.145.0/hugo_extended_0.145.0_linux-amd64.tar.gz \
-o hugo.tar.gz
tar -xzf hugo.tar.gz 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!'
}
}
}