Ορισμένοι έλεγχοι ανέφεραν σφάλματα
Hellug/www/pipeline/head Something is wrong with the build of this commit
78 γραμμές
1,6 KiB
Groovy
78 γραμμές
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
|
|
command:
|
|
- sleep
|
|
args:
|
|
- 1d
|
|
- name: tea
|
|
image: 'tgerczei/tea'
|
|
command:
|
|
- sleep
|
|
args:
|
|
- 1d
|
|
'''
|
|
defaultContainer 'hugo'
|
|
}
|
|
}
|
|
|
|
options {
|
|
skipDefaultCheckout()
|
|
}
|
|
|
|
stages {
|
|
stage('Grab Code') {
|
|
steps {
|
|
container('hugo')
|
|
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('gitea-js-hellug-bot-token')
|
|
}
|
|
|
|
steps {
|
|
container('tea')
|
|
sh 'go get code.gitea.io/tea && go install code.gitea.io/tea'
|
|
sh "tea login add -n ${GITEA_LOGIN}"
|
|
sh 'tea r create -t ${BUILD_TAG} --tag ${BUILD_NUMBER} -a site.tar.gz'
|
|
}
|
|
}
|
|
}
|
|
}
|