mirror of
https://github.com/valitydev/swag-organizations.git
synced 2024-11-06 10:05:23 +00:00
Do bundle releases w/ Jenkins (#11)
This commit is contained in:
parent
b211717709
commit
0d3f58178f
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
@ -7,10 +7,12 @@ build('swag-organizations', 'docker-host') {
|
||||
|
||||
def pipeDefault
|
||||
def withWsCache
|
||||
def gitUtils
|
||||
runStage('load pipeline') {
|
||||
env.JENKINS_LIB = "build-utils/jenkins_lib"
|
||||
pipeDefault = load("${env.JENKINS_LIB}/pipeDefault.groovy")
|
||||
withWsCache = load("${env.JENKINS_LIB}/withWsCache.groovy")
|
||||
gitUtils = load("${env.JENKINS_LIB}/gitUtils.groovy")
|
||||
}
|
||||
|
||||
pipeDefault() {
|
||||
@ -25,12 +27,12 @@ build('swag-organizations', 'docker-host') {
|
||||
sh 'make wc_validate'
|
||||
}
|
||||
|
||||
runStage('build') {
|
||||
runStage('bundle') {
|
||||
sh 'make wc_build'
|
||||
}
|
||||
|
||||
// Java
|
||||
runStage('Build client & server') {
|
||||
runStage('build java client & server') {
|
||||
withCredentials([[$class: 'FileBinding', credentialsId: 'java-maven-settings.xml', variable: 'SETTINGS_XML']]) {
|
||||
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.startsWith('epic/')) {
|
||||
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} java.swag.deploy_client'
|
||||
@ -42,5 +44,15 @@ build('swag-organizations', 'docker-host') {
|
||||
}
|
||||
}
|
||||
|
||||
// Release
|
||||
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.startsWith('epic/')) {
|
||||
runStage('publish release bundle') {
|
||||
dir("web_deploy") {
|
||||
gitUtils.push(commitMsg: "Generated from commit: $COMMIT_ID \n\non $BRANCH_NAME in $RBK_REPO_URL\n\nChanges:\n$COMMIT_MSG",
|
||||
files: "*", branch: "release/$BRANCH_NAME", orphan: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "openapi preview-docs",
|
||||
"build": "openapi bundle -o web_deploy/openapi",
|
||||
"build": "openapi bundle -o web_deploy/openapi.yaml && openapi bundle -o web_deploy/openapi.json",
|
||||
"validate": "openapi lint"
|
||||
}
|
||||
}
|
||||
|
43
wercker.yml
43
wercker.yml
@ -1,43 +0,0 @@
|
||||
box: node:14
|
||||
|
||||
build:
|
||||
steps:
|
||||
- npm-install
|
||||
- npm-test
|
||||
- script:
|
||||
name: build docsite
|
||||
code: npm run build -- ${WERCKER_OUTPUT_DIR}
|
||||
|
||||
dev:
|
||||
steps:
|
||||
- npm-install
|
||||
- npm-test
|
||||
- internal/shell
|
||||
|
||||
release-epic:
|
||||
steps:
|
||||
- script:
|
||||
name: prepare release artifacts for epic/* branch
|
||||
code: mkdir -p out && cp ./swagger.{yaml,json} out/
|
||||
- lordlothar99/git-push:
|
||||
gh_oauth: ${GITHUB_API_TOKEN}
|
||||
branch: release/${WERCKER_GIT_BRANCH}
|
||||
basedir: out
|
||||
message: Epic release ${WERCKER_GIT_OWNER}/${WERCKER_GIT_REPOSITORY}@${WERCKER_GIT_COMMIT}
|
||||
|
||||
release-v:
|
||||
steps:
|
||||
- script:
|
||||
name: prepare release artifacts for branch v1, v2, etc.
|
||||
code: mkdir -p out && cp ./swagger.{yaml,json} out/
|
||||
- lordlothar99/git-push:
|
||||
gh_oauth: ${GITHUB_API_TOKEN}
|
||||
branch: release/${WERCKER_GIT_BRANCH}
|
||||
basedir: out
|
||||
message: Release ${WERCKER_GIT_OWNER}/${WERCKER_GIT_REPOSITORY}@${WERCKER_GIT_COMMIT}
|
||||
|
||||
deploy:
|
||||
steps:
|
||||
- lukevivier/gh-pages:
|
||||
repo: rbkmoney/anapi
|
||||
token: ${GITHUB_API_TOKEN}
|
Loading…
Reference in New Issue
Block a user