diff --git a/Jenkinsfile b/Jenkinsfile index 98f73dd..14fbf43 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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) + } + } + } + } } diff --git a/package.json b/package.json index 94fc202..c65855f 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/wercker.yml b/wercker.yml deleted file mode 100644 index 57b0dec..0000000 --- a/wercker.yml +++ /dev/null @@ -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}