diff options
| author | Carlos Konstanski <ckonstanski@pippiandcarlos.com> | 2017-10-09 14:55:37 -0600 |
|---|---|---|
| committer | Carlos Konstanski <ckonstanski@pippiandcarlos.com> | 2017-10-09 14:55:37 -0600 |
| commit | 95aaac84fa636496edad7688ff8a998f7b3ad8a6 (patch) | |
| tree | 7d736220bc1aa002c1246fd5f3b20235587e13e0 /jjb | |
| parent | c9dc456fe563ae99f684eb06668f20cc94c059f7 (diff) | |
improving jjb files for jobs to reduce duplication
Diffstat (limited to 'jjb')
| -rw-r--r-- | jjb/yaml/deploy-dev-env.yaml | 30 | ||||
| -rw-r--r-- | jjb/yaml/openbook-core.yaml | 80 | ||||
| -rw-r--r-- | jjb/yaml/openbook-pipeline.yaml | 88 |
3 files changed, 148 insertions, 50 deletions
diff --git a/jjb/yaml/deploy-dev-env.yaml b/jjb/yaml/deploy-dev-env.yaml new file mode 100644 index 0000000..1648c4a --- /dev/null +++ b/jjb/yaml/deploy-dev-env.yaml @@ -0,0 +1,30 @@ +--- +- job: + name: deploy-dev-env + project-type: pipeline + dsl: | + pipeline { + agent { + node { + label "openbook_v4" + } + } + stages { + stage("deploy_dev_env") { + steps { + checkout([ + scm: [ + $class: "GitSCM", + branches: [ + [name: "master"] + ], + userRemoteConfigs: [ + [url: "git@github.com:Talligent/openbook-v4-installer.git"] + ] + ] + ]) + sh(script: "./deploy-dev-env.sh") + } + } + } + } diff --git a/jjb/yaml/openbook-core.yaml b/jjb/yaml/openbook-core.yaml index 210e782..6524dde 100644 --- a/jjb/yaml/openbook-core.yaml +++ b/jjb/yaml/openbook-core.yaml @@ -1,25 +1,59 @@ --- -- scm: - name: openbook-core - scm: - - git: - url: git@github.com:Talligent/openbook-core.git - branches: - - master - - job: - name: openbook-core - display-name: "openbook-core" - project-type: freestyle - description: "Fetches the openbook-core repo (a dependency of other microservices)." - node: openbook_v4 - properties: - - build-discarder: - days-to-keep: 0 - num-to-keep: 1 - artifact-days-to-keep: 0 - artifact-num-to-keep: 0 - triggers: - - github - scm: - - openbook-core + name: openbook-core-pipeline + project-type: pipeline + dsl: | + pipeline { + agent { + node { + label "openbook_v4" + } + } + triggers { + pollSCM 'H/5 * * * *' + } + stages { + stage("checkout") { + steps { + checkout([ + scm: [ + $class: "GitSCM", + branches: [ + [name: "master"] + ], + userRemoteConfigs: [ + [url: "git@github.com:Talligent/openbook-core.git"] + ], + poll: true, + changelog: true + ] + ]) + } + } + stage("admin-api-server") { + steps { + build(job: "admin-api-server-pipeline") + } + } + stage("customer-api-server") { + steps { + build(job: "customer-api-server-pipeline") + } + } + stage("job-scheduler-server") { + steps { + build(job: "job-scheduler-server-pipeline") + } + } + stage("workflow-server") { + steps { + build(job: "workflow-server-pipeline") + } + } + stage("deploy_dev_env") { + steps { + build(job: "deploy-dev-env") + } + } + } + } diff --git a/jjb/yaml/openbook-pipeline.yaml b/jjb/yaml/openbook-pipeline.yaml index c07f14c..3dd632d 100644 --- a/jjb/yaml/openbook-pipeline.yaml +++ b/jjb/yaml/openbook-pipeline.yaml @@ -9,7 +9,13 @@ - "job-scheduler-server" - "workflow-server" jobs: + - "{artifact}-group" + +- job-group: + name: "{artifact}-group" + jobs: - "{artifact}-pipeline" + - "{artifact}-deploy-dev-env" - job-template: name: "{artifact}-pipeline" @@ -21,51 +27,79 @@ label "openbook_v4" }} }} + triggers {{ + pollSCM 'H/5 * * * *' + }} stages {{ stage("gradle") {{ steps {{ - git( - changelog: true, - poll: true, - branch: master, - url: "git@github.com:Talligent/{artifact}.git" - ) + checkout([ + scm: [ + $class: "GitSCM", + branches: [ + [name: "master"] + ], + userRemoteConfigs: [ + [url: "git@github.com:Talligent/{artifact}.git"] + ], + poll: true, + changelog: true + ] + ]) sh(script: "gradle -PbuildNumber=4.1.${{BUILD_NUMBER}} -PbuildMode=buildProd -Dorg.gradle.daemon=false clean shadowJar") stash(includes: "build/libs/*.jar", name: "jar") }} }} - stage("upload_jar") {{ + stage("upload-jar") {{ steps {{ - git( - changelog: true, - poll: false, - branch: master, - url: "git@github.com:Talligent/deployment-scripts.git" - ) + checkout([ + scm: [ + $class: "GitSCM", + branches: [ + [name: "master"] + ], + userRemoteConfigs: [ + [url: "git@github.com:Talligent/deployment-scripts.git"] + ] + ] + ]) unstash(name: "jar") sh(script: "ruby openbook/ruby/upload_jar.rb --webdav-url=${{WEBDAV_URL}} --webdav-username=${{WEBDAV_USERNAME}} --webdav-password=${{WEBDAV_PASSWORD}} --artifact={artifact} --version=4.1.${{BUILD_NUMBER}} --filepath=build/libs/{artifact}.4.1.${{BUILD_NUMBER}}.jar") }} }} - stage("build_docker_containers") {{ + stage("docker-containers") {{ steps {{ - git( - changelog: true, - poll: false, - branch: master, - url: "git@github.com:Talligent/openbook-v4-ci.git" - ) + checkout([ + scm: [ + $class: "GitSCM", + branches: [ + [name: "master"] + ], + userRemoteConfigs: [ + [url: "git@github.com:Talligent/openbook-v4-ci.git"] + ] + ] + ]) sh(script: "./build-docker-containers.sh {artifact}") }} }} + }} + }} + +- job-template: + name: "{artifact}-deploy-dev-env" + project-type: pipeline + dsl: | + pipeline {{ + agent {{ + node {{ + label "openbook_v4" + }} + }} + stages {{ stage("deploy_dev_env") {{ steps {{ - git( - changelog: true, - poll: false, - branch: master, - url: "git@github.com:Talligent/openbook-v4-installer.git" - ) - sh(script: "./deploy-dev-env.sh") + build(job: "deploy-dev-env") }} }} }} |
