summaryrefslogtreecommitdiff
path: root/jjb/yaml/openbook-pipeline.yaml
blob: 75cf3639ca0bb651a5ea3426c7d65edd22a8cee5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
- project:
    name: "openbook-pipeline"
    artifact:
      - "admin-api-server"
      - "admin-web-ui"
      - "customer-api-server"
      - "customer-web-ui"
      - "job-scheduler-server"
      - "workflow-server"
    jobs:
      - "{artifact}-pipeline"

- job-template:
    name: "{artifact}-pipeline"
    project-type: pipeline
    dsl: |
      pipeline {{
          agent {{
              node {{
                label "openbook_v4"
                customWorkspace "workspace/{artifact}"
              }}
          }}
          stages {{
              stage("gradle") {{
                  steps {{
                      checkout(
                          scm: [
                              $class: "GitSCM",
                              branches: [
                                  [name: "unstable"]
                              ],
                              userRemoteConfigs: [
                                  [url: "git@github.com:Talligent/{artifact}.git"]
                              ]
                          ]
                      )
                      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") {{
                  steps {{
                      checkout(
                          scm: [
                              $class: "GitSCM",
                              branches: [
                                  [name: "master"]
                              ],
                              userRemoteConfigs: [
                                  [url: "git@github.com:Talligent/deployment-scripts.git"]
                              ],
                              extensions: [
                                  [$class: "DisableRemotePoll"]
                              ]
                          ]
                      )
                      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("docker-container") {{
                  steps {{
                      checkout(
                          scm: [
                              $class: "GitSCM",
                              branches: [
                                  [name: "master"]
                              ],
                              userRemoteConfigs: [
                                  [url: "git@github.com:Talligent/openbook-v4-ci.git"]
                              ],
                              extensions: [
                                  [$class: "DisableRemotePoll"]
                              ]
                          ]
                      )
                      sh(script: "./build-docker-containers.sh {artifact}")
                  }}
              }}
          }}
      }}