From b07782c19929bcc93957fb25dddd5201e64a7711 Mon Sep 17 00:00:00 2001 From: Peter Mikus Date: Wed, 8 Feb 2023 11:58:47 +0000 Subject: feat(csit): Add terraform jobs Signed-off-by: Peter Mikus Change-Id: I65839bd6399aaf07be7352f52068fbfcb493e82e --- jjb/csit/csit-terraform.yaml | 120 +++++++++++++++++++++ jjb/global-macros.yaml | 21 ++++ .../csit/terraform-aws-eb-version-deploy.sh | 21 ++++ .../csit/terraform-aws-eb-version-upload.sh | 21 ++++ 4 files changed, 183 insertions(+) create mode 100644 jjb/csit/csit-terraform.yaml create mode 100644 jjb/scripts/csit/terraform-aws-eb-version-deploy.sh create mode 100644 jjb/scripts/csit/terraform-aws-eb-version-upload.sh (limited to 'jjb') 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 @@ -368,6 +368,27 @@ 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 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 -- cgit 1.2.3-korg