1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/weishengshui-testdriven

В этом репозитории не указан файл с открытой лицензией (LICENSE). При использовании обратитесь к конкретному описанию проекта и его зависимостям в коде.
Клонировать/Скачать
Jenkinsfile 1 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
weishengshui Отправлено 04.08.2018 08:32 aba37ba
#!/usr/bin/env groovy
// 创建输出目录
import java.text.SimpleDateFormat;
import java.util.Date;
def dateToSecondFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
def dateToSecondStr = dateToSecondFormat.format(new Date());
def buildDir = "/data/build/" + dateToSecondStr;
println buildDir;
env.JENKINS_VERSION="2.xxx";
env.currentBuildOutputDir = buildDir;
println env.JENKINS_HOME
// jenkins_home
pipeline {
agent any
stages{
stage("Build") {
steps{
sh 'echo "Build"'
build "testdriven"
sh 'mkdir -p ${currentBuildOutputDir}/testdriven'
sh 'cp ${JENKINS_HOME}/workspace/testdriven/target/testdriven.war ${currentBuildOutputDir}/testdriven'
}
}
stage("Deploy"){
steps{
sh 'echo "Deploy"'
}
}
}
}
// script
/**
node {
stage("Build") {
sh 'echo "Build"'
build "testdriven"
sh 'mkdir -p ${currentBuildOutputDir}/testdriven'
sh 'cp ${JENKINS_HOME}/workspace/testdriven/target/testdriven.war ${currentBuildOutputDir}/testdriven'
}
stage("Deploy"){
sh 'echo "Deploy"'
}
}
**/

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/weishengshui-testdriven.git
git@api.gitlife.ru:oschina-mirror/weishengshui-testdriven.git
oschina-mirror
weishengshui-testdriven
weishengshui-testdriven
master