You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

63 lines
1.9 KiB

#!/usr/bin/env groovy
pipeline {
agent {
label "sunos"
}
options {
skipStagesAfterUnstable()
}
environment {
TASK_VERSION = "v2.8.0"
GOCACHE = "${WORKSPACE}/gocache"
GO111MODULE = "on"
GOPATH = "${WORKSPACE}/../gopath"
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Get Task') {
when {
// Only say hello if a "greeting" is requested
expression { !fileExists('./bin/task')}
}
steps {
//sh '/usr/bin/curl -sL https://taskfile.dev/install.sh | /usr/bin/bash'
checkout changelog: false,
poll: false,
scm: [$class: 'GitSCM',
branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'task']],
submoduleCfg: [],
userRemoteConfigs: [[url: 'https://github.com/go-task/task']]
]
// compiling it to ./bin/task
dir('task') {
sh 'git clean -df'
sh "git checkout ${TASK_VERSION}"
sh 'go build -v -o ../bin/task ./cmd/task'
}
}
}
stage('Test'){
steps {
sh './bin/task test'
junit 'reports/**/*.xml'
}
}
stage('Build') {
steps {
sh './bin/task default'
}
post {
success {
archiveArtifacts artifacts: 'artifacts/**', fingerprint: true, onlyIfSuccessful: true
}
}
}
}
}