From 415b083707e5a05d4751b51a144dbbc008087f8e Mon Sep 17 00:00:00 2001 From: Eric Ball Date: Thu, 26 Aug 2021 08:40:42 -0700 Subject: [PATCH 1/3] Test: Add Jenkinsfile with LF Pipeline Library Signed-off-by: Eric Ball --- Jenkinsfile | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000..1034104f56 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright (c) 2021 The Linux Foundation +// +// 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. +// + +loadGlobalLibrary() + +pipeline { + agent { + // This label should match an agent available on the target system + label "centos7-docker-4c-2g" + } + + options { + timestamps() + timeout(360) + } + + environment { + } + + stages { + stage("NodeJS Verify") { + steps { + lfNode() + } + } + } + + post { + always { + // The default logSettingsFile is "jenkins-log-archives-settings". + // If this file isn't present, a different value for logSettingsFile + // will need to be passed to lfInfraShipLogs. + lfInfraShipLogs() + } + } +} + +// This loadGlobalLibrary call is only required if the library is not defined +// in the Jenkins global or job settings. Otherwise, a simple "@Library" call +// will suffice. +def loadGlobalLibrary(branch = "*/node-workflow") { + library(identifier: "pipelines@master", + retriever: legacySCM([ + $class: "GitSCM", + userRemoteConfigs: [[url: "https://github.com/MightyNerdEric/releng-pipelines"]], + branches: [[name: branch]], + doGenerateSubmoduleConfigurations: false, + extensions: [[ + $class: "SubmoduleOption", + recursiveSubmodules: true, + ]]] + ) + ) _ +} From 26c96691481d2f739b688a99c5dfdf3f142b8e0e Mon Sep 17 00:00:00 2001 From: Eric Ball Date: Thu, 26 Aug 2021 08:44:05 -0700 Subject: [PATCH 2/3] Remove empty environment Signed-off-by: Eric Ball --- Jenkinsfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1034104f56..0566d8dd06 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,9 +28,6 @@ pipeline { timeout(360) } - environment { - } - stages { stage("NodeJS Verify") { steps { From 1b3ea2f2f8cdb7fa02c9abc358efbef8c679aac0 Mon Sep 17 00:00:00 2001 From: Eric Ball Date: Thu, 26 Aug 2021 08:52:49 -0700 Subject: [PATCH 3/3] Add node block to agent Signed-off-by: Eric Ball --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0566d8dd06..157dbd60a9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,8 +19,10 @@ loadGlobalLibrary() pipeline { agent { - // This label should match an agent available on the target system - label "centos7-docker-4c-2g" + node { + // This label should match an agent available on the target system + label "centos7-docker-4c-2g" + } } options {