www/Jenkinsfile
infl00p f354c93954
Κάποιοι έλεγχοι απέτυχαν
Hellug/www/pipeline/head There was a failure building this commit
Pipeline support - fix
2021-09-14 16:46:56 +03:00

81 γραμμές
1,6 KiB
Groovy

pipeline {
agent {
kubernetes {
yaml '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: jnlp
image: 'jenkins/inbound-agent'
args: ['\$(JENKINS_SECRET)', '\$(JENKINS_NAME)']
- name: hugo
image: klakegg/hugo:debian
command:
- sleep
args:
- 1d
- name: tea
image: 'alpine'
command:
- sleep
args:
- 1d
'''
defaultContainer 'hugo'
}
}
options {
skipDefaultCheckout()
}
stages {
stage('Grab Code') {
steps {
checkout scm
}
}
stage('Test Hugo syntax') {
steps {
container('hugo') {
sh 'hugo --quiet'
}
}
}
stage('Build the Site') {
steps {
container('hugo') {
sh 'hugo'
}
}
}
stage('Create Package') {
steps {
container('hugo') {
sh "tar zcvf site.tar.gz ./public/"
}
}
}
stage('Upload Release') {
environment {
GITEA_LOGIN = 'js-hellug-bot'
GITEA_SERVER_URL = 'https://dev.hellug.gr'
GITEA_SERVER_TOKEN = credentials('hellug-jenkins')
}
steps {
container('tea') {
sh 'apk update && apk add tea'
sh "tea login add -n ${GITEA_LOGIN}"
sh "tea r create -t ${BUILD_TAG} --tag ${BUILD_NUMBER} -a site.tar.gz"
}
}
}
}
}