some templates
This commit is contained in:
39
templates/build
Normal file
39
templates/build
Normal file
@@ -0,0 +1,39 @@
|
||||
def clean () {
|
||||
sh 'rm -rf .[!.]*'
|
||||
sh 'rm -rf ./*'
|
||||
sh 'ls -a'
|
||||
}
|
||||
|
||||
def clone (String repoPath, String folder) {
|
||||
echo 'cloning...'
|
||||
sh "git clone ${repoPath}.git tmp"
|
||||
sh "mkdir -p ${folder}"
|
||||
sh "mv ./tmp/* ./${folder}"
|
||||
sh "mv ./tmp/.[!.]* ./${folder}"
|
||||
}
|
||||
|
||||
def loadScript (String scriptName) {
|
||||
load "${JEN_FILES_TMP_NAME}/${scriptName}/Jenkinsfile"
|
||||
}
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('processing') {
|
||||
steps {
|
||||
clean()
|
||||
clone(JENKINS_SCRIPTS_URL, JEN_FILES_TMP_NAME)
|
||||
loadScript('stats')
|
||||
clone('https://aaprimakov@bitbucket.org/aaprimakov/r-and-m', './')
|
||||
loadScript('install')
|
||||
loadScript('build/dev')
|
||||
loadScript('tests/ts')
|
||||
loadScript('tests/ui')
|
||||
loadScript('publish')
|
||||
loadScript('predeploy')
|
||||
loadScript('clean-all')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
templates/output
Normal file
23
templates/output
Normal file
@@ -0,0 +1,23 @@
|
||||
-- shell
|
||||
mkdir q
|
||||
rm -r -d ./*
|
||||
|
||||
-- copy artifacts
|
||||
**/*
|
||||
|
||||
-- shell
|
||||
ls;
|
||||
mv ./${TARGET_FOLDER}/${DEPLOY_VERSION_VAR} ./
|
||||
BRANCH_NAME=$(cat ${DEPLOY_VERSION_VAR})
|
||||
|
||||
rm ${DEPLOY_VERSION_VAR}
|
||||
|
||||
echo "branch name is: $BRANCH_NAME"
|
||||
mkdir $BRANCH_NAME
|
||||
mv ./${TARGET_FOLDER}/* ./${BRANCH_NAME};
|
||||
rm -r -d ${TARGET_FOLDER};
|
||||
|
||||
ls;
|
||||
|
||||
-- copy
|
||||
// scp -r vars root@46.173.219.236:apps/my
|
||||
3
templates/start.sh
Normal file
3
templates/start.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/env sh
|
||||
|
||||
java -jar jenkins.war --httpPort=8080 &
|
||||
4
templates/vars
Normal file
4
templates/vars
Normal file
@@ -0,0 +1,4 @@
|
||||
DEPLOY_VERSION_VAR=jenkins-deploy-file-folder-name.txt
|
||||
JEN_FILES_TMP_NAME=tmp--jfiles-scripts
|
||||
JENKINS_SCRIPTS_URL=https://aaprimakov@bitbucket.org/jsadvance20201/jenkins
|
||||
TARGET_FOLDER=dist
|
||||
Reference in New Issue
Block a user