summaryrefslogtreecommitdiffstats
path: root/jjb
diff options
context:
space:
mode:
authorPeter Mikus <peter.mikus@protonmail.ch>2023-02-08 11:58:47 +0000
committerPeter Mikus <peter.mikus@protonmail.ch>2023-02-13 10:39:22 +0000
commitb07782c19929bcc93957fb25dddd5201e64a7711 (patch)
tree5ad1d21f9bf0de229a65606e9452f400f778a9b1 /jjb
parentbc8c27babb56a3f446a67508ec3afe87afb86d53 (diff)
feat(csit): Add terraform jobs
Signed-off-by: Peter Mikus <peter.mikus@protonmail.ch> Change-Id: I65839bd6399aaf07be7352f52068fbfcb493e82e
Diffstat (limited to 'jjb')
-rw-r--r--jjb/csit/csit-terraform.yaml120
-rw-r--r--jjb/global-macros.yaml21
-rw-r--r--jjb/scripts/csit/terraform-aws-eb-version-deploy.sh21
-rw-r--r--jjb/scripts/csit/terraform-aws-eb-version-upload.sh21
4 files changed, 183 insertions, 0 deletions
diff --git a/jjb/csit/csit-terraform.yaml b/jjb/csit/csit-terraform.yaml
new file mode 100644
index 000000000..3a50ae4f6
--- /dev/null
+++ b/jjb/csit/csit-terraform.yaml
@@ -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
diff --git a/jjb/global-macros.yaml b/jjb/global-macros.yaml
index ca925ebc0..508a62174 100644
--- a/jjb/global-macros.yaml
+++ b/jjb/global-macros.yaml
@@ -369,6 +369,27 @@
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.
# The job acts as an automatic verify job for CSIT contributions.
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
index 000000000..250280d41
--- /dev/null
+++ b/jjb/scripts/csit/terraform-aws-eb-version-deploy.sh
@@ -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
index 000000000..64bffedc2
--- /dev/null
+++ b/jjb/scripts/csit/terraform-aws-eb-version-upload.sh
@@ -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