From: Fatih Degirmenci Date: Fri, 2 Oct 2020 14:42:49 +0000 (+0000) Subject: Create periodic build job for eiffel-playground project X-Git-Url: https://gerrit.nordix.org/gitweb?a=commitdiff_plain;h=12206babb8669b62c1c63fc70febe3f7a14f9750;p=infra%2Fcicd.git Create periodic build job for eiffel-playground project Change-Id: I89c93489ffbab989abafbf22278df0f21383a639 --- diff --git a/jjb/eiffel/eiffel-playground.yaml b/jjb/eiffel/eiffel-playground.yaml new file mode 100644 index 000000000..d0635bccd --- /dev/null +++ b/jjb/eiffel/eiffel-playground.yaml @@ -0,0 +1,38 @@ +--- +# ============LICENSE_START======================================================= +# Copyright (C) 2020 Nordix 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +- project: + name: eiffel-playground + + project: eiffel-playground + + project-name: eiffel-playground + + project-build-root: './' + + stream: + - 'master': + branch: 'master' + + distro: ubuntu2004 + + jobs: + - '{project-name}-build-{distro}-{stream}-periodic' + +# vim: set ts=2 sw=2 expandtab: diff --git a/jjb/eiffel/global-eiffel-container-build.yaml b/jjb/eiffel/global-eiffel-container-build.yaml new file mode 100644 index 000000000..00f704d4e --- /dev/null +++ b/jjb/eiffel/global-eiffel-container-build.yaml @@ -0,0 +1,58 @@ +--- +# ============LICENSE_START======================================================= +# Copyright (C) 2020 Nordix 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +- job-template: + name: '{project-name}-build-{distro}-{stream}-periodic' + + node: 'eiffel-build-{distro}' + + disabled: false + + concurrent: false + + properties: + - logrotate + + parameters: + - project-parameters: + project: '{project}' + branch: '{branch}' + - eiffel-parameters + + scm: + - git-scm-github: + branch: '$BRANCH' + refspec: '' + wipe_workspace: true + clean_before: false + base_dir: '$WORKSPACE' + + triggers: + - pollscm: + cron: "H 0,8,16 * * *" + + wrappers: + - build-timeout: + timeout: 10 + + builders: + - shell: + !include-raw-escape: ./scripts/eiffel-container-build-tag-push.sh + +# vim: set ts=2 sw=2 expandtab: diff --git a/jjb/eiffel/scripts/eiffel-container-build-tag-push.sh b/jjb/eiffel/scripts/eiffel-container-build-tag-push.sh new file mode 100644 index 000000000..7970084c7 --- /dev/null +++ b/jjb/eiffel/scripts/eiffel-container-build-tag-push.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# ============LICENSE_START======================================================= +# Copyright (C) 2020 The Nordix Foundation. All rights reserved. +# ================================================================================ +# 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +set -o errexit +set -o pipefail +set -o nounset + +# navigate to where Dockerfile is located +cd "$WORKSPACE/$PROJECT_BUILD_ROOT" + +# the image tagged with latest for the timebeing since we are building from the tip of master branch +IMAGE_TAG="latest" + +# set image name +IMAGE_NAME="$NORDIX_REGISTRY/$PROJECT/$PROJECT:$IMAGE_TAG" + +# set the build command so we can log it to console +PODMAN_BUILD_CMD="podman build --log-level $PODMAN_LOG_LEVEL --tag $IMAGE_NAME ." + +echo "Info : Building the container image with the command" +echo " $PODMAN_BUILD_CMD" +echo "----------------------------------------------------------------" +"$PODMAN_BUILD_CMD" +echo "----------------------------------------------------------------" +echo "Info : Build successful! List of container images is" +echo "----------------------------------------------------------------" +podman images --log-level $PODMAN_LOG_LEVEL +echo "----------------------------------------------------------------" +echo "Info : Logging in to registry.nordix.org and pushing the image" +echo "----------------------------------------------------------------" +podman login --log-level "$PODMAN_LOG_LEVEL" "$NORDIX_REGISTRY" --username "$HARBOR_USERNAME" --password "$HARBOR_PASSWORD" +podman push --log-level "$PODMAN_LOG_LEVEL" "$IMAGE_NAME" +podman logout --log-level "$PODMAN_LOG_LEVEL" "$NORDIX_REGISTRY" +echo "----------------------------------------------------------------" +echo "Info : Done!" + +# vim: set ts=2 sw=2 expandtab: