Skip to content

Commit

Permalink
Add script to build examples from helidon-examples repository
Browse files Browse the repository at this point in the history
  • Loading branch information
barchetta committed Feb 28, 2024
1 parent c6270b1 commit 1b7056e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions etc/scripts/build-examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash -e
#
# Copyright (c) 2024 Oracle 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.
#

# Build helidon examples, cloning the examples repository if needed

# Path to this script
[ -h "${0}" ] && readonly SCRIPT_PATH="$(readlink "${0}")" || readonly SCRIPT_PATH="${0}"

# Load pipeline environment setup and define WS_DIR
. $(dirname -- "${SCRIPT_PATH}")/includes/pipeline-env.sh "${SCRIPT_PATH}" '../..'

# Setup error handling using default settings (defined in includes/error_handlers.sh)
error_trap_setup

# If needed we clone the helidon-examples repo into a subdirectory of the helidon repository
readonly HELIDON_EXAMPLES_PATH=${WS_DIR}/helidon-examples
if [ ! -d "${HELIDON_EXAMPLES_PATH}" ]; then
git clone [email protected]:helidon-io/helidon-examples.git "${HELIDON_EXAMPLES_PATH}"
cd "${HELIDON_EXAMPLES_PATH}"
git checkout dev-3.x
fi

mvn ${MAVEN_ARGS} -f ${HELIDON_EXAMPLES_PATH}/pom.xml clean install

0 comments on commit 1b7056e

Please sign in to comment.