exit 0
fi
-# NOTE (fdegir): offline installer removes /opt/engine so we prepare venv ourselves for openstack cli
-if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
- sudo /bin/rm -rf /opt/engine/.venv
- virtualenv --python python3 --never-download /opt/engine/.venv
- /bin/cp -f /opt/engine/offline/pip/pip.conf /opt/engine/.venv/
- set +u
- source /opt/engine/.venv/bin/activate
- set -u
- pip install --quiet --upgrade pip
- pip install --quiet -r /opt/engine/offline/git/engine/requirements.txt
- deactivate
-fi
-
+# NOTE (fdegir): install openstack clients
+sudo /bin/rm -rf /tmp/.engine_venv
+virtualenv --python python3 --never-download /tmp/.engine_venv
+# NOTE (fdegir): we need to use pip.conf pointing to local packages
+[[ "$EXECUTION_MODE" == "offline-deployment" ]] && /bin/cp -f /opt/engine/offline/pip/pip.conf /tmp/.engine_venv
set +u
-source /opt/engine/.venv/bin/activate
+source /tmp/.engine_venv/bin/activate
set -u
+pip install --quiet --upgrade pip
+# NOTE (fdegir): we only install what is needed rather than all dependencies
+pip install --quiet openstacksdk python-openstackclient python-heatclient
+# NOTE (fdegir): delete stack
echo "Info: Deleting stack $HEAT_STACK_NAME and keypair $KEYPAIR_NAME"
echo "-------------------------------------------------------------------------"
source /tmp/openrc && /bin/rm -f /tmp/openrc
-openstack stack delete $HEAT_STACK_NAME --wait --yes
+openstack stack delete --wait --yes $HEAT_STACK_NAME
openstack keypair delete $KEYPAIR_NAME
echo "-------------------------------------------------------------------------"
echo "Info: Stack $HEAT_STACK_NAME and keypair $KEYPAIR_NAME have been deleted!"
--- /dev/null
+---
+# ============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-gerrit-herald
+
+ project: eiffel-gerrit-herald
+
+ project-name: eiffel-gerrit-herald
+
+
+ stream:
+ - 'master':
+ branch: 'master'
+ project-build-macro: 'eiffel-build-periodic-macro'
+
+ distro: ubuntu2004
+
+ jobs:
+ - '{project-name}-build-periodic-{distro}-{stream}'
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+---
+# ============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-intelligence-frontend
+
+ project: eiffel-intelligence-frontend
+
+ project-name: eiffel-intelligence-frontend
+
+
+ stream:
+ - 'master':
+ branch: 'master'
+ project-build-macro: 'eiffel-intelligence-frontend-build-periodic-macro'
+
+ distro: ubuntu2004
+
+ jobs:
+ - '{project-name}-build-periodic-{distro}-{stream}'
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+---
+# ============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-intelligence
+
+ project: eiffel-intelligence
+
+ project-name: eiffel-intelligence
+
+
+ stream:
+ - 'master':
+ branch: 'master'
+ project-build-macro: 'eiffel-intelligence-build-periodic-macro'
+
+ distro: ubuntu2004
+
+ jobs:
+ - '{project-name}-build-periodic-{distro}-{stream}'
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+---
+# ============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
+
+
+ stream:
+ - 'master':
+ branch: 'master'
+ project-build-macro: 'eiffel-build-periodic-macro'
+
+ distro: ubuntu2004
+
+ jobs:
+ - '{project-name}-build-periodic-{distro}-{stream}'
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+---
+# ============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-remrem-generate
+
+ project: eiffel-remrem-generate
+
+ project-name: eiffel-remrem-generate
+
+
+ stream:
+ - 'master':
+ branch: 'master'
+ project-build-macro: 'eiffel-remrem-generate-build-periodic-macro'
+
+ distro: ubuntu2004
+
+ jobs:
+ - '{project-name}-build-periodic-{distro}-{stream}'
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+---
+# ============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-remrem-publish
+
+ project: eiffel-remrem-publish
+
+ project-name: eiffel-remrem-publish
+
+
+ stream:
+ - 'master':
+ branch: 'master'
+ project-build-macro: 'eiffel-remrem-publish-build-periodic-macro'
+
+ distro: ubuntu2004
+
+ jobs:
+ - '{project-name}-build-periodic-{distro}-{stream}'
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+---
+# ============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-periodic-{distro}-{stream}'
+
+ node: 'eiffel-build-{distro}'
+
+ disabled: false
+
+ concurrent: false
+
+ properties:
+ - logrotate
+
+ parameters:
+ - project-parameters:
+ project: '{project}'
+ branch: '{branch}'
+ - string:
+ name: GIT_BASE_HTTPS
+ default: https://github.com/eiffel-community
+ description: HTTPS URL of Project Repo on GitHub to clone repo.
+ - string:
+ name: GIT_BASE_SSH
+ default: git@github.com:eiffel-community
+ description: SSH URL of Project Repo on GitHub to clone repo.
+ - choice:
+ name: HARBOR_EIFFEL_PROJECT
+ choices:
+ - eiffel
+ - eiffel-playground
+ description: Project to push container images to. Default is eiffel. eiffel-playground is for development purposes.
+ - choice:
+ name: PODMAN_LOG_LEVEL
+ choices:
+ - error
+ - debug
+ - info
+ - warn
+ - fatal
+ - panic
+ description: Podman log level to use. Default is error.
+ - string:
+ name: NORDIX_REGISTRY
+ default: 'registry.nordix.org'
+ description: Nordix container image registry.
+
+ scm:
+ - git:
+ url: 'https://github.com/eiffel-community/$PROJECT.git'
+ branches:
+ - '*/{branch}'
+ refspec: ''
+ timeout: 15
+ per-build-tag: false
+ skip-tag: true
+ shallow-clone: false
+ use-author: false
+ ignore-notify: false
+ wipe-workspace: true
+ prune: false
+ clean:
+ after: false
+ before: false
+ choosing-strategy: 'default'
+ basedir: '$WORKSPACE'
+
+
+ triggers:
+ - pollscm:
+ cron: "H 0,8,16 * * *"
+
+ wrappers:
+ - build-timeout:
+ timeout: 10
+ - nordixinfra-harbor-creds-wrapper
+ - mask-passwords
+ - openstack:
+ single-use: True
+
+ builders:
+ - '{project-build-macro}'
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+---
+- builder:
+ name: 'eiffel-build-periodic-macro'
+ builders:
+ - shell:
+ !include-raw: ../scripts/eiffel-build-periodic.sh
+
+- builder:
+ name: 'eiffel-intelligence-build-periodic-macro'
+ builders:
+ - shell:
+ !include-raw: ../scripts/eiffel-intelligence-build-periodic.sh
+
+- builder:
+ name: 'eiffel-intelligence-frontend-build-periodic-macro'
+ builders:
+ - shell:
+ !include-raw: ../scripts/eiffel-intelligence-frontend-build-periodic.sh
+
+- builder:
+ name: 'eiffel-remrem-generate-build-periodic-macro'
+ builders:
+ - shell:
+ !include-raw: ../scripts/eiffel-remrem-generate-build-periodic.sh
+
+- builder:
+ name: 'eiffel-remrem-publish-build-periodic-macro'
+ builders:
+ - shell:
+ !include-raw: ../scripts/eiffel-remrem-publish-build-periodic.sh
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+#!/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 root of the git clone
+cd "$WORKSPACE"
+
+# 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_TAG="$NORDIX_REGISTRY/$HARBOR_EIFFEL_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_TAG ."
+
+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_TAG"
+podman logout --log-level "$PODMAN_LOG_LEVEL" "$NORDIX_REGISTRY"
+echo "----------------------------------------------------------------"
+echo "Info : Done!"
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+#!/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 root of the git clone
+cd "$WORKSPACE"
+
+# TODO (fdegir): the versions need to be parameterized
+# they are hardcoded in the script to get the basic builds working
+# the job and script will be updated once the build is working and the versions are confirmed
+# set openjdk and maven versions
+OPENJDK_VERSION="8u265-b01-0ubuntu2~20.04"
+MAVEN_VERSION="3.6.3-1"
+
+# set maven build command
+MAVEN_BUILD_CMD="mvn --quiet --batch-mode package -DskipTests"
+
+# install openjdk and maven
+echo "Info : Installing openjdk and maven"
+echo "----------------------------------------------------------------"
+sudo apt install -y -qq openjdk-8-jdk-headless="$OPENJDK_VERSION" maven="$MAVEN_VERSION"
+echo "----------------------------------------------------------------"
+echo "Info : Building the project with the command"
+echo " $MAVEN_BUILD_CMD"
+echo "----------------------------------------------------------------"
+$MAVEN_BUILD_CMD
+# find the warfile
+PROJECT_WAR_FILE=$(ls target/*.war)
+echo "----------------------------------------------------------------"
+echo "Info : Build successful! Artifact is available as"
+ls -al $PROJECT_WAR_FILE
+echo "----------------------------------------------------------------"
+
+# 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_TAG="$NORDIX_REGISTRY/$HARBOR_EIFFEL_PROJECT/$PROJECT:$IMAGE_TAG"
+
+# set the build command so we can log it to console
+PODMAN_BUILD_CMD="podman build --build-arg URL=$PROJECT_WAR_FILE --file src/main/docker/Dockerfile --log-level $PODMAN_LOG_LEVEL --tag $IMAGE_NAME_TAG ."
+
+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_TAG"
+podman logout --log-level "$PODMAN_LOG_LEVEL" "$NORDIX_REGISTRY"
+echo "----------------------------------------------------------------"
+echo "Info : Done!"
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+#!/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 root of the git clone
+cd "$WORKSPACE"
+
+# TODO (fdegir): the versions need to be parameterized
+# they are hardcoded in the script to get the basic builds working
+# the job and script will be updated once the build is working and the versions are confirmed
+# set openjdk and maven versions
+OPENJDK_VERSION="8u265-b01-0ubuntu2~20.04"
+MAVEN_VERSION="3.6.3-1"
+
+# set maven build command
+MAVEN_BUILD_CMD="mvn --quiet --batch-mode package -DskipTests"
+
+# install openjdk and maven
+echo "Info : Installing openjdk and maven"
+echo "----------------------------------------------------------------"
+sudo apt install -y -qq openjdk-8-jdk-headless="$OPENJDK_VERSION" maven="$MAVEN_VERSION"
+echo "----------------------------------------------------------------"
+echo "Info : Building the project with the command"
+echo " $MAVEN_BUILD_CMD"
+echo "----------------------------------------------------------------"
+$MAVEN_BUILD_CMD
+# find the warfile
+PROJECT_WAR_FILE=$(ls target/*.war)
+echo "----------------------------------------------------------------"
+echo "Info : Build successful! Artifact is available as"
+ls -al $PROJECT_WAR_FILE
+echo "----------------------------------------------------------------"
+
+# 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_TAG="$NORDIX_REGISTRY/$HARBOR_EIFFEL_PROJECT/$PROJECT:$IMAGE_TAG"
+
+# set the build command so we can log it to console
+PODMAN_BUILD_CMD="podman build --build-arg URL=$PROJECT_WAR_FILE --file src/main/docker/Dockerfile --log-level $PODMAN_LOG_LEVEL --tag $IMAGE_NAME_TAG ."
+
+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_TAG"
+podman logout --log-level "$PODMAN_LOG_LEVEL" "$NORDIX_REGISTRY"
+echo "----------------------------------------------------------------"
+echo "Info : Done!"
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+#!/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 root of the git clone
+cd "$WORKSPACE"
+
+# TODO (fdegir): the versions need to be parameterized
+# they are hardcoded in the script to get the basic builds working
+# the job and script will be updated once the build is working and the versions are confirmed
+# set openjdk and maven versions
+OPENJDK_VERSION="8u265-b01-0ubuntu2~20.04"
+MAVEN_VERSION="3.6.3-1"
+
+# set maven build command
+MAVEN_BUILD_CMD="mvn --quiet --batch-mode package -DskipTests"
+
+# install openjdk and maven
+echo "Info : Installing openjdk and maven"
+echo "----------------------------------------------------------------"
+sudo apt install -y -qq openjdk-8-jdk-headless="$OPENJDK_VERSION" maven="$MAVEN_VERSION"
+echo "----------------------------------------------------------------"
+echo "Info : Building the project with the command"
+echo " $MAVEN_BUILD_CMD"
+echo "----------------------------------------------------------------"
+cd service
+$MAVEN_BUILD_CMD
+# find the warfile - we need to be in the folder where the service code is located
+PROJECT_WAR_FILE=$(ls target/*.war)
+echo "----------------------------------------------------------------"
+echo "Info : Build successful! Artifact is available as"
+ls -al $PROJECT_WAR_FILE
+echo "----------------------------------------------------------------"
+
+# 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_TAG="$NORDIX_REGISTRY/$HARBOR_EIFFEL_PROJECT/$PROJECT:$IMAGE_TAG"
+
+# set the build command so we can log it to console
+PODMAN_BUILD_CMD="podman build --build-arg URL=$PROJECT_WAR_FILE --file src/main/docker/Dockerfile --log-level $PODMAN_LOG_LEVEL --tag $IMAGE_NAME_TAG ."
+
+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_TAG"
+podman logout --log-level "$PODMAN_LOG_LEVEL" "$NORDIX_REGISTRY"
+echo "----------------------------------------------------------------"
+echo "Info : Done!"
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+#!/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 root of the git clone
+cd "$WORKSPACE"
+
+# TODO (fdegir): the versions need to be parameterized
+# they are hardcoded in the script to get the basic builds working
+# the job and script will be updated once the build is working and the versions are confirmed
+# set openjdk and maven versions
+OPENJDK_VERSION="8u265-b01-0ubuntu2~20.04"
+MAVEN_VERSION="3.6.3-1"
+
+# set maven build command
+MAVEN_BUILD_CMD="mvn --quiet --batch-mode package -DskipTests"
+
+# install openjdk and maven
+echo "Info : Installing openjdk and maven"
+echo "----------------------------------------------------------------"
+sudo apt install -y -qq openjdk-8-jdk-headless="$OPENJDK_VERSION" maven="$MAVEN_VERSION"
+echo "----------------------------------------------------------------"
+echo "Info : Building the project with the command"
+echo " $MAVEN_BUILD_CMD"
+echo "----------------------------------------------------------------"
+$MAVEN_BUILD_CMD
+# find the warfile - we need to be in the folder where the service code is located
+cd publish-service
+PROJECT_WAR_FILE=$(ls target/*.war)
+echo "----------------------------------------------------------------"
+echo "Info : Build successful! Artifact is available as"
+ls -al $PROJECT_WAR_FILE
+echo "----------------------------------------------------------------"
+
+# 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_TAG="$NORDIX_REGISTRY/$HARBOR_EIFFEL_PROJECT/$PROJECT:$IMAGE_TAG"
+
+# set the build command so we can log it to console
+PODMAN_BUILD_CMD="podman build --build-arg URL=$PROJECT_WAR_FILE --file src/main/docker/Dockerfile --log-level $PODMAN_LOG_LEVEL --tag $IMAGE_NAME_TAG ."
+
+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_TAG"
+podman logout --log-level "$PODMAN_LOG_LEVEL" "$NORDIX_REGISTRY"
+echo "----------------------------------------------------------------"
+echo "Info : Done!"
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+- job-template:
+ name: 'fdio-{project-name}-push-upstream'
+ node: infra-ubuntu1804
+ disabled: false
+ concurrent: false
+
+ properties:
+ - logrotate
+
+ parameters:
+ - string:
+ name: PROJECT
+ default: 'fdio/{project}'
+ description: JJB configured PROJECT parameter to identify a Nordix Gerrit fast data project
+ - nordix-gerrit-parameters
+
+ scm:
+ - git-scm-gerrit:
+ ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
+ branch: $GERRIT_BRANCH
+ refspec: $GERRIT_REFSPEC
+ wipe_workspace: true
+ clean_before: false
+
+ triggers:
+ - nordix-gerrit-push-upstream:
+ project: 'fdio/{project}'
+ branch: '**'
+ files: '**'
+
+ wrappers:
+ - build-timeout:
+ timeout: 10
+ - ssh-agent-credentials:
+ users:
+ - 'infra-upstream-gerrit-ssh-passphrase'
+
+ builders:
+ - shell:
+ !include-raw-escape: ./push-upstream-jobs.sh
--- /dev/null
+- job-template:
+ name: 'fdio-{project-name}-rebase'
+ node: infra-ubuntu1804
+ disabled: false
+ concurrent: false
+
+ properties:
+ - logrotate
+
+ parameters:
+ - fdio-gerrit-parameters
+ - string:
+ name: PROJECT
+ default: '{project}'
+ description: JJB configured PROJECT parameter to identify a Nordix Gerrit fast data project
+ - string:
+ name: NORDIX_REMOTE
+ default: 'ssh://infra@gerrit.nordix.org:29418/fdio/{project}.git'
+ description: The remote to add for Nordix.
+
+ scm:
+ - git-scm:
+ ssh-credentials-id: nordixinfra-lfn-gerrit-ssh
+ branch: 'master'
+ refspec: ''
+ wipe_workspace: false
+ clean_before: true
+
+ triggers:
+ - fdio-gerrit-trigger-change-merged:
+ project: '{project}'
+ branch: '**'
+ files: '**'
+ - timed: "@midnight"
+
+ wrappers:
+ - build-timeout:
+ timeout: 10
+
+ builders:
+ - shell:
+ !include-raw-escape: ../global/rebase-jobs.sh
+
+ publishers:
+ - notify-slack:
+ slack-channel: '#infra'
+ notify-start: false
+ notify-success: false
+ notify-failure: true
+ notify-back-to-normal: true
--- /dev/null
+#!/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=========================================================
+
+#
+# This script will take the single commit form the given Nordix Gerrit review
+# and push it, and all its ancestor commit till $GERRIT_BRANCH, to FDio Gerrit.
+# Pre-requisites for script to run successfully:
+# - The Gerrit username in Nordix needs to match with the Gerrit
+# username in FDio Gerrit
+# - infra public key on build server needs to be added to your users SSH
+# Public Keys in FDio Gerrit
+#
+set -euxo pipefail
+
+cd "$WORKSPACE"
+
+fdio_gerrit_base='gerrit.fd.io:29418'
+nordix_gerrit_rest='https://gerrit.nordix.org'
+
+echo >&2 "Collecting information about what and how to push towards Fast Data Project (FDio)"
+
+# The git hash of the commit in the review this job runs on
+commit_hash="$GERRIT_PATCHSET_REVISION"
+
+# GERRIT_PROJECT is in the form of fdio/<opendev-project>
+fdio_project=$(echo "$GERRIT_PROJECT" | cut -d/ -f2- )
+
+# Nordix Gerrit can map the email address of the user pushed the change to
+# the review to the Gerrit username of the account in Nordix Gerrit. This
+# should match with the Gerrit username in the FDio Gerrit.
+username=$(
+ curl -s -H 'Accept: application/json' \
+ "$nordix_gerrit_rest/accounts/?q=email:$GERRIT_EVENT_ACCOUNT_EMAIL&o=DETAILS" \
+ | tee /dev/stderr | tail -1 | jq -r '.[0].username')
+
+fdio_remote_url="ssh://$username@$fdio_gerrit_base/$fdio_project"
+
+# GERRIT_BRANCH is the _intended_ branch of the commit under review
+# E.g. git push HEAD:refs/for/master => GERRIT_BRANCH='master'
+# GERRIT_TOPIC is the rest of the refspec after GERRIT_BRANCH when the topic
+# is set for the change.
+if [ -z "${GERRIT_TOPIC:-}" ] ; then
+ refspec="$commit_hash:refs/for/$GERRIT_BRANCH"
+else
+ refspec="$commit_hash:refs/for/$GERRIT_BRANCH/$GERRIT_TOPIC"
+fi
+
+echo >&2 "Pushing to FDio Gerrit"
+
+# do not fail if git push fails as in case of no new changes we want to succeed. See below.
+set +o pipefail
+
+git push "$fdio_remote_url" "$refspec" 2>&1 | tee push_result.txt
+push_result=${PIPESTATUS[0]}
+
+# make the job a success if the above git push fails due to no new changes are needed
+# to be created upstream. This will be useful when we switch to automatic triggering
+# of the push-upstream for each patch set and jobs on different commits in a same chain
+# will race with each other to push parts of the chain
+if [ $push_result -ne 0 ]; then
+ grep '(no new changes)' push_result.txt
+fi
--- /dev/null
+---
+# ============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: fdio-vpp-push-upstream
+ project: vpp
+ project-name: vpp
+
+ jobs:
+ - 'fdio-{project-name}-push-upstream'
\ No newline at end of file
--- /dev/null
+---
+# ============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: fdio-vpp-rebase
+ project: vpp
+ project-name: vpp
+
+ jobs:
+ - 'fdio-{project-name}-rebase'
\ No newline at end of file
name: JJB_VERSION
default: 2.9.1
description: OpenStack JJB version to install - matches to LFN JJB version
+ - string:
+ name: NORDIX_REGISTRY
+ default: registry.nordix.org
+ description: Nordix Container Image Registry
# these parameters are used for setting the Gerrit Project on Nordix
- parameter:
default: ssh://$GERRIT_USER@gerrit.o-ran-sc.org:29418
description: SSH URL to Project Repo on ORAN-SC Gerrit to clone repo
+- parameter:
+ name: fdio-gerrit-parameters
+ parameters:
+ - string:
+ name: GERRIT_USER
+ default: nordix
+ description: Non-interactive user to stream Gerrit Events on Fast Data Project Gerrit
+ - string:
+ name: GIT_BASE_HTTPS
+ default: https://gerrit.fd.io/r
+ description: HTTPS URL to Project Repo on Fast Data Project Gerrit to clone repo
+ - string:
+ name: GIT_BASE_SSH
+ default: ssh://$GERRIT_USER@gerrit.fd.io:29418
+ description: SSH URL to Project Repo on Fast Data Project Gerrit to clone repo
+
# Verify job for Geode git tags to make sure there are in agreed format
- builder:
name: 'verify-geode-tag-macro'
silent: true
silent-start: true
+# triggers for Fast Data Project Gerrit
+- trigger:
+ name: fdio-gerrit-trigger-change-merged
+ triggers:
+ - gerrit:
+ server-name: 'FDio Gerrit'
+ trigger-on:
+ - change-merged-event
+ - comment-added-contains-event:
+ comment-contains-value: 'remerge'
+ projects:
+ - project-compare-type: 'ANT'
+ project-pattern: '{project}'
+ branches:
+ - branch-compare-type: 'ANT'
+ branch-pattern: '**/{branch}'
+ file-paths:
+ - compare-type: 'ANT'
+ pattern: '{files}'
+ silent: true
+ silent-start: true
+
# wrappers to use for jobs
- wrapper:
name: nordixinfra-jjb-creds-wrapper
username: JJB_USERNAME
password: JJB_USERTOKEN
+# wrappers to use for jobs
+- wrapper:
+ name: nordixinfra-harbor-creds-wrapper
+ wrappers:
+ - credentials-binding:
+ - username-password-separated:
+ credential-id: nordix-cicd-harbor-credentials
+ username: HARBOR_USERNAME
+ password: HARBOR_PASSWORD
+
# timeout wrapper to use for jobs
- wrapper:
name: build-timeout
stream:
- master:
branch: '{stream}'
- jdk-version: java-8
+ jdk-version: java-11
- casablanca:
branch: '{stream}'
jdk-version: java-8
stream:
- 'master':
branch: '{stream}'
- jdk-version: java-8
+ jdk-version: java-11
- 'casablanca':
branch: '{stream}'
jdk-version: java-8
stream:
- 'master':
branch: '{stream}'
- jdk-version: java-8
+ jdk-version: java-11
- 'casablanca':
branch: '{stream}'
jdk-version: java-8
stream:
- 'master':
branch: '{stream}'
- jdk-version: java-8
+ jdk-version: java-11
- 'casablanca':
branch: '{stream}'
jdk-version: java-8
stream:
- 'master':
branch: '{stream}'
- jdk-version: java-8
+ jdk-version: java-11
- 'casablanca':
branch: '{stream}'
jdk-version: java-8
stream:
- 'master':
branch: '{stream}'
- jdk-version: java-8
+ jdk-version: java-11
- 'casablanca':
branch: '{stream}'
jdk-version: java-8
stream:
- 'master':
branch: '{stream}'
- jdk-version: java-8
+ jdk-version: java-11
- 'casablanca':
branch: '{stream}'
jdk-version: java-8
stream:
- 'master':
branch: '{stream}'
- jdk-version: java-8
+ jdk-version: java-11
- 'casablanca':
branch: '{stream}'
jdk-version: java-8
stream:
- 'master':
branch: '{stream}'
- jdk-version: java-8
+ jdk-version: java-11
- 'casablanca':
branch: '{stream}'
jdk-version: java-8
stream:
- master:
branch: '{stream}'
- jdk-version: java-8
+ jdk-version: java-11
jobs:
- 'onap-{project-name}-{stream}-verify-java'
stream:
- 'master':
branch: '{stream}'
- jdk-version: java-8
+ jdk-version: java-11
- 'casablanca':
branch: '{stream}'
jdk-version: java-8
stream:
- 'master':
branch: '{stream}'
- jdk-version: java-8
+ jdk-version: java-11
- 'casablanca':
branch: '{stream}'
jdk-version: java-8
--- /dev/null
+---
+# ============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: openstack-neutron-dynamic-routing-push-upstream
+ project: openstack/neutron-dynamic-routing
+ project-name: openstack-neutron-dynamic-routing
+
+ jobs:
+ - 'opendev-{project-name}-push-upstream'
--- /dev/null
+---
+# ============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: openstack-neutron-dynamic-routing-rebase
+ project: openstack/neutron-dynamic-routing
+ project-name: openstack-neutron-dynamic-routing
+
+ jobs:
+ - 'opendev-{project-name}-rebase'