jjb: Add dev_review_lttng-www
authorKienan Stewart <kstewart@efficios.com>
Fri, 1 Dec 2023 20:39:38 +0000 (15:39 -0500)
committerKienan Stewart <kstewart@efficios.com>
Fri, 1 Dec 2023 20:39:38 +0000 (15:39 -0500)
Change-Id: I924fdbb835b7767f62aa25bc1eeea94e3b61746c
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
jobs/lttng-www.yaml
scripts/lttng-www/deploy.sh

index 4e18c59090f374ad808af6110199cacc416a366c..be0c7bc7a01c2fa8ce7c6d632f3d3dff2f23abc2 100644 (file)
@@ -1,7 +1,6 @@
-- job:
+- defaults:
     name: lttng-www
     project-type: freestyle
-    defaults: global
     node: amd64-rootnode
 
     description: |
@@ -9,36 +8,96 @@
 
       <p>Job is managed by Jenkins Job Builder.</p>
 
+    scm:
+      - git:
+          url: git@git.efficios.com:lttng-www.git
+          credentials-id: 63a5abb5-9056-47e2-b419-f5946c1b8f08
+          basedir: ./
+          branches:
+            - master
+          skip-tag: true
+
     wrappers:
       - ansicolor
       - timestamps
       - credentials-binding:
+        - file:
+            credential-id: d023f830-9ab0-409f-b977-8cd0e1944dd5
+            variable: HOST_PUBLIC_KEYS
         - ssh-user-private-key:
             credential-id: 63a5abb5-9056-47e2-b419-f5946c1b8f08
             key-file-variable: KEY_FILE_VARIABLE
             username-variable: USER_NAME_VARIABLE
             passphrase-variable: PASSPHRASE_VARIABLE
-        - file:
-            credential-id: d023f830-9ab0-409f-b977-8cd0e1944dd5
-            variable: HOST_PUBLIC_KEYS
+      - inject:
+          properties-content: |
+            DEPLOY_TARGET=deploy:prod
+
     properties:
       - build-discarder:
           num-to-keep: 5
 
-    triggers:
-      - timed: '@daily'
     builders:
       - shell:
           !include-raw: scripts/lttng-www/deploy.sh
 
+- job:
+    name: dev_review_lttng-www
+    defaults: lttng-www
+
     scm:
       - git:
-          url: git@git.efficios.com:lttng-www.git
-          credentials-id: 63a5abb5-9056-47e2-b419-f5946c1b8f08
+          url: ssh://jenkins@review.lttng.org:29418/lttng-www.git
+          credentials-id: f3c907b6-7485-49e1-afe1-4df24fac4ca1
           basedir: ./
-          skip-tag: true
           branches:
-            - master
+            - '$GERRIT_REFSPEC'
+          refspec: 'refs/changes/*:refs/changes/*'
+          skip-tag: true
+
+    properties:
+      - build-discarder:
+          days-to-keep: 1
+      - throttle:
+          option: 'category'
+          categories:
+            - 'gerrit-build'
+
+    triggers:
+      - gerrit:
+          trigger-on:
+            - comment-added-event:
+                approval-category: 'CI-Build'
+                approval-value: 1
+          projects:
+            - project-compare-type: 'PLAIN'
+              project-pattern: 'lttng-www'
+              branches:
+                - branch-compare-type: 'PLAIN'
+                  branch-pattern: 'master'
+
+    wrappers:
+      - ansicolor
+      - timestamps
+      - credentials-binding:
+        - file:
+            credential-id: d023f830-9ab0-409f-b977-8cd0e1944dd5
+            variable: HOST_PUBLIC_KEYS
+        - ssh-user-private-key:
+            credential-id: 63a5abb5-9056-47e2-b419-f5946c1b8f08
+            key-file-variable: KEY_FILE_VARIABLE
+            username-variable: USER_NAME_VARIABLE
+            passphrase-variable: PASSPHRASE_VARIABLE
+      - inject:
+          properties-content: |
+            DEPLOY_TARGET=deploy:preprod
+
+- job:
+    name: lttng-www
+    defaults: lttng-www
+
+    triggers:
+      - timed: '@daily'
 
     publishers:
       - archive:
index 3d73a4d3ca74b528f7351d7a7b409e85cb1ecf8c..2d3fe528f929a18db78f1a232e9b20d277fa4b45 100755 (executable)
@@ -37,6 +37,9 @@ print_header() {
     set -x
 }
 
+# Fail out early if this is not set
+echo "Deploy target: ${DEPLOY_TARGET}"
+
 # Add ssh key for deployment
 cp "$HOST_PUBLIC_KEYS" ~/.ssh/known_hosts
 cp "$KEY_FILE_VARIABLE" ~/.ssh/id_rsa
@@ -88,6 +91,6 @@ else
 fi
 
 print_header "Deploy website"
-bundle exec grunt deploy:prod --network
+bundle exec grunt "${DEPLOY_TARGET}" --network
 
 # EOF
This page took 0.024797 seconds and 4 git commands to generate.