local setup
This commit is contained in:
47
Jenkinsfile
vendored
Normal file
47
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
pipeline {
|
||||
agent any
|
||||
environment {
|
||||
DEPLOY_HOST = 'web@38.114.101.142' // или другой хост
|
||||
DEPLOY_PATH = '/srv/www/fymio-site'
|
||||
SSH_CRED_ID = 'web-ssh'
|
||||
HUGO_VERSION = '0.149.0'
|
||||
}
|
||||
triggers {
|
||||
githubPush()
|
||||
}
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
checkout scm
|
||||
sh 'git submodule sync --recursive && git submodule update --init --recursive --remote'
|
||||
}
|
||||
}
|
||||
stage('Setup Hugo') {
|
||||
steps {
|
||||
sh '''
|
||||
mkdir -p tools
|
||||
cd tools
|
||||
curl -L -o hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz
|
||||
tar -xzf hugo.tar.gz
|
||||
chmod +x hugo
|
||||
'''
|
||||
}
|
||||
}
|
||||
stage('Build site') {
|
||||
steps {
|
||||
sh './tools/hugo --minify'
|
||||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
sshagent(credentials: [env.SSH_CRED_ID]) {
|
||||
sh 'bash deploy/deploy.sh $DEPLOY_HOST $DEPLOY_PATH'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success { echo 'Deployed' }
|
||||
failure { echo 'Failed' }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user