feat(csit): Add terraform jobs 72/38172/3
authorPeter Mikus <[email protected]>
Wed, 8 Feb 2023 11:58:47 +0000 (11:58 +0000)
committerPeter Mikus <[email protected]>
Mon, 13 Feb 2023 10:39:22 +0000 (10:39 +0000)
Signed-off-by: Peter Mikus <[email protected]>
Change-Id: I65839bd6399aaf07be7352f52068fbfcb493e82e

jjb/csit/csit-terraform.yaml [new file with mode: 0644]
jjb/global-macros.yaml
jjb/scripts/csit/terraform-aws-eb-version-deploy.sh [new file with mode: 0644]
jjb/scripts/csit/terraform-aws-eb-version-upload.sh [new file with mode: 0644]

diff --git a/jjb/csit/csit-terraform.yaml b/jjb/csit/csit-terraform.yaml
new file mode 100644 (file)
index 0000000..3a50ae4
--- /dev/null
@@ -0,0 +1,120 @@
+# Copyright (c) 2023 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+---
+- project:
+    name: csit-provision
+    description: 'CSIT Jenkins jobs.'
+
+    jobs:
+      - 'csit-terraform-aws-eb-version-upload-{os}-{executor-arch}'
+      - 'csit-terraform-aws-eb-version-deploy-{os}-{executor-arch}'
+
+    project: 'csit'
+    branch: 'master'
+    os:
+      - 'ubuntu2204'
+    executor-arch: 'x86_64'
+    build-artifact-num-to-keep: 10
+
+- job-template:
+    name: 'csit-terraform-aws-eb-version-upload-{os}-{executor-arch}'
+
+    project-type: freestyle
+    node: 'builder-{os}-prod-{executor-arch}'
+    concurrent: false
+    latest-only: false
+
+    properties:
+      - lf-infra-properties:
+          build-days-to-keep: "{build-days-to-keep}"
+
+    parameters:
+      - project-parameter:
+          project: '{project}'
+      - gerrit-parameter:
+          branch: '{branch}'
+
+    scm:
+      - gerrit-trigger-scm:
+          credentials-id: 'jenkins-gerrit-credentials'
+          refspec: ''
+          choosing-strategy: 'default'
+
+    wrappers:
+      - fdio-infra-wrappers-non-activity-timeout:
+          build-timeout: '{build-timeout}'
+
+    triggers:
+      - gerrit-trigger-csit-terraform:
+          project: '{project}'
+          branch: '{branch}'
+          trigger-word: 'terraform-cdash-upload'
+          skip-vote: false
+
+    builders:
+      - shell:
+          !include-raw-escape:
+          - ../scripts/setup_executor_env.sh
+      - shell:
+          !include-raw-escape:
+          - ../scripts/csit/terraform-aws-eb-version-upload.sh
+
+    publishers:
+      - fdio-infra-publish
+
+- job-template:
+    name: 'csit-terraform-aws-eb-version-deploy-{os}-{executor-arch}'
+
+    project-type: freestyle
+    node: 'builder-{os}-prod-{executor-arch}'
+    concurrent: false
+    latest-only: false
+
+    properties:
+      - lf-infra-properties:
+          build-days-to-keep: "{build-days-to-keep}"
+
+    parameters:
+      - project-parameter:
+          project: '{project}'
+      - gerrit-parameter:
+          branch: '{branch}'
+
+    scm:
+      - gerrit-trigger-scm:
+          credentials-id: 'jenkins-gerrit-credentials'
+          refspec: ''
+          choosing-strategy: 'default'
+
+    wrappers:
+      - fdio-infra-wrappers-non-activity-timeout:
+          build-timeout: '{build-timeout}'
+
+    triggers:
+      - gerrit-trigger-csit-terraform:
+          project: '{project}'
+          branch: '{branch}'
+          trigger-word: 'terraform-cdash-deploy'
+          skip-vote: false
+
+    builders:
+      - shell:
+          !include-raw-escape:
+          - ../scripts/setup_executor_env.sh
+      - shell:
+          !include-raw-escape:
+          - ../scripts/csit/terraform-aws-eb-version-deploy.sh
+
+    publishers:
+      - fdio-infra-publish
index ca925eb..508a621 100644 (file)
             unstable: '{skip-vote}'
             notbuilt: '{skip-vote}'
 
+- trigger:
+    name: gerrit-trigger-csit-terraform
+    # Manual trigger common for csit-terraform jobs.
+    triggers:
+      - gerrit:
+          server-name: 'Primary'
+          trigger-on:
+            - comment-added-contains-event:
+                comment-contains-value: '{trigger-word}'
+          projects:
+            - project-compare-type: 'ANT'
+              project-pattern: '{project}'
+              branches:
+                - branch-compare-type: 'ANT'
+                  branch-pattern: '**/{branch}'
+          skip-vote:
+            successful: '{skip-vote}'
+            failed: '{skip-vote}'
+            unstable: '{skip-vote}'
+            notbuilt: '{skip-vote}'
+
 - trigger:
     name: gerrit-trigger-csit-vpp-devicetest-full
     # Comes from CSIT, for automatic jobs running device tests with VPP builds.
diff --git a/jjb/scripts/csit/terraform-aws-eb-version-deploy.sh b/jjb/scripts/csit/terraform-aws-eb-version-deploy.sh
new file mode 100644 (file)
index 0000000..250280d
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Copyright (c) 2023 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+echo "---> jjb/scripts/csit/cdash-deploy.sh"
+
+set -exuo pipefail
+
+csit_entry_dir="${WORKSPACE}/resources/libraries/bash/entry"
+source "${csit_entry_dir}/bootstrap_cdash_deploy.sh"
\ No newline at end of file
diff --git a/jjb/scripts/csit/terraform-aws-eb-version-upload.sh b/jjb/scripts/csit/terraform-aws-eb-version-upload.sh
new file mode 100644 (file)
index 0000000..64bffed
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Copyright (c) 2023 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+echo "---> jjb/scripts/csit/cdash-upload.sh"
+
+set -exuo pipefail
+
+csit_entry_dir="${WORKSPACE}/resources/libraries/bash/entry"
+source "${csit_entry_dir}/bootstrap_cdash_upload.sh"
\ No newline at end of file