ci: added ci skipping [ci skip]
This commit is contained in:
parent
dfe63a90fe
commit
37f9763d72
1 changed files with 14 additions and 2 deletions
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
|
@ -17,6 +17,18 @@ pipeline {
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
stage('Checkout') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
echo '==========Checking out=========='
|
||||||
|
if (sh (script: "git log -1 | grep '.*\\[ci skip\\].*'", returnStatus: true)) {
|
||||||
|
error "'[ci skip]' found in git commit message. Aborting."
|
||||||
|
currentBuild.result = 'NOT_BUILT'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage('Dependencies') {
|
stage('Dependencies') {
|
||||||
steps {
|
steps {
|
||||||
echo '==========Installing Dependencies=========='
|
echo '==========Installing Dependencies=========='
|
||||||
|
@ -35,12 +47,12 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
echo '==========Publishing to NPM=========='
|
echo '==========Publishing to NPM=========='
|
||||||
if(env.BRANCH_NAME == 'master') {
|
if (env.BRANCH_NAME == 'master') {
|
||||||
echo '==========Publishing as Development Version=========='
|
echo '==========Publishing as Development Version=========='
|
||||||
sh 'echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc'
|
sh 'echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc'
|
||||||
sh 'yarn version $(node -pe \'require("./package.json").version\')-$(git rev-parse HEAD).$(date +%s)'
|
sh 'yarn version $(node -pe \'require("./package.json").version\')-$(git rev-parse HEAD).$(date +%s)'
|
||||||
sh 'npm publish --tag dev --access public'
|
sh 'npm publish --tag dev --access public'
|
||||||
} else if(env.BRANCH_NAME == 'stable') {
|
} else if (env.BRANCH_NAME == 'stable') {
|
||||||
echo '==========Publishing as Stable Version=========='
|
echo '==========Publishing as Stable Version=========='
|
||||||
sh 'semantic-release'
|
sh 'semantic-release'
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue