Do bundle releases w/ Jenkins (#11)

This commit is contained in:
Andrew Mayorov 2020-11-19 14:52:27 +03:00 committed by GitHub
parent b211717709
commit 0d3f58178f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 46 deletions

16
Jenkinsfile vendored
View File

@ -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)
}
}
}
}
}

View File

@ -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"
}
}

View File

@ -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}