Skip to content

Commit

Permalink
[4.x] examples removal (helidon-io#9034)
Browse files Browse the repository at this point in the history
* 4.x examples removal

Signed-off-by: Maxim Nesen <[email protected]>

* Batch mode for mvn is on

Signed-off-by: Maxim Nesen <[email protected]>

---------

Signed-off-by: Maxim Nesen <[email protected]>
  • Loading branch information
senivam authored Aug 2, 2024
1 parent d3b6f7b commit 6405b02
Show file tree
Hide file tree
Showing 1,224 changed files with 99 additions and 74,757 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,19 @@ jobs:
run: |
# prime build
mvn ${MAVEN_ARGS} -e \
-Dmaven.test.skip=true \
-DskipTests \
-Ppipeline \
install
mvn ${MAVEN_ARGS} -e \
-f examples/pom.xml \
verify
-Dmaven.test.skip=true \
-DskipTests \
-Ppipeline \
install
- name: Examples checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
repository: helidon-io/helidon-examples.git
ref: dev-4.x
path: helidon-examples
- name: Examples build
run: etc/scripts/build-examples.sh
- name: Test quickstarts native image
run: etc/scripts/test-quickstarts.sh
mp-tck:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ node/
# Helidon CLI
.helidon

# Helidon examples repository
helidon-examples

# Other
*~
user.txt
Expand Down
75 changes: 75 additions & 0 deletions etc/scripts/build-examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash
#
# 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

set -o pipefail || true # trace ERR through pipes
set -o errtrace || true # trace ERR through commands and functions
set -o errexit || true # exit the script if any statement returns a non-true return value

on_error(){
CODE="${?}" && \
set +x && \
printf "[ERROR] Error(code=%s) occurred at %s:%s command: %s\n" \
"${CODE}" "${BASH_SOURCE[0]}" "${LINENO}" "${BASH_COMMAND}"
}
trap on_error ERR

# Path to this script
if [ -h "${0}" ] ; then
SCRIPT_PATH="$(readlink "${0}")"
else
# shellcheck disable=SC155
SCRIPT_PATH="${0}"
fi
readonly SCRIPT_PATH

# Path to the root of the workspace
# shellcheck disable=SC2046
WS_DIR=$(cd $(dirname -- "${SCRIPT_PATH}") ; cd ../.. ; pwd -P)
readonly WS_DIR

# 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 "${WS_DIR}/helidon-examples" ]; then
echo "Cloning examples repository into ${WS_DIR}/helidon-examples"
git clone --branch dev-4.x --single-branch [email protected]:helidon-io/helidon-examples.git "${WS_DIR}/helidon-examples"
fi

version() {
mvn -B -N -f "${1}" -Dexpression=helidon.version help:evaluate | grep -v '\[INFO\]'
}

# Make sure the helidon version from the example repo aligns with this repository
HELIDON_VERSION_IN_THIS_REPO=$(version "${WS_DIR}/pom.xml")
readonly HELIDON_VERSION_IN_THIS_REPO

HELIDON_VERSION_IN_EXAMPLES=$(version "${WS_DIR}/helidon-examples/pom.xml")
readonly HELIDON_VERSION_IN_EXAMPLES

if [ "${HELIDON_VERSION_IN_THIS_REPO}" != "${HELIDON_VERSION_IN_EXAMPLES}" ]; then
printf "The Helidon version in this repository (%s) does not match the Helidon version in %s (%s)\n" \
"${HELIDON_VERSION_IN_THIS_REPO}" \
"${HELIDON_EXAMPLES_PATH}" \
"${HELIDON_VERSION_IN_EXAMPLES}"
exit 78
fi

# shellcheck disable=SC2086
mvn ${MAVEN_ARGS} \
-f "${WS_DIR}/helidon-examples/pom.xml" \
clean install
8 changes: 7 additions & 1 deletion etc/scripts/test-quickstarts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@ mvn ${MAVEN_ARGS} --version

"${GRAALVM_HOME}"/bin/native-image --version;

# If needed we clone the helidon-examples repo into a subdirectory of the helidon repository
if [ ! -d "${WS_DIR}/helidon-examples" ]; then
echo "Cloning examples repository into ${HELIDON_EXAMPLES_PATH}"
git clone --branch dev-4.x --single-branch [email protected]:helidon-io/helidon-examples.git "${WS_DIR}/helidon-examples"
fi

# Build quickstart native-image executable and run jar file
readonly quickstarts="helidon-quickstart-mp helidon-quickstart-se"
for quickstart in ${quickstarts}; do
cd "${WS_DIR}"/examples/quickstarts/"${quickstart}"
cd "${WS_DIR}/helidon-examples/examples/quickstarts/${quickstart}"
# shellcheck disable=SC2086
mvn ${MAVEN_ARGS} -e clean install -Pnative-image -DskipTests
./target/"${quickstart}" -Dexit.on.started=!
Expand Down
45 changes: 0 additions & 45 deletions examples/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions examples/config/README.md

This file was deleted.

16 changes: 0 additions & 16 deletions examples/config/basics/README.md

This file was deleted.

65 changes: 0 additions & 65 deletions examples/config/basics/pom.xml

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6405b02

Please sign in to comment.