From e9198e29e55249b3a38092baacc7e463e2b5382f Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Tue, 20 Dec 2022 02:24:41 -0800 Subject: [PATCH 1/3] Deduplicate with PWD_GITHUB_CI variable Signed-off-by: Steve Peters --- entrypoint.sh | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 4725f7a..79bcd65 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -45,18 +45,19 @@ git config --global --add safe.directory $GITHUB_WORKSPACE SYSTEM_VERSION=`lsb_release -cs` -SOURCE_DEPENDENCIES="`pwd`/.github/ci/dependencies.yaml" -SOURCE_DEPENDENCIES_VERSIONED="`pwd`/.github/ci-$SYSTEM_VERSION/dependencies.yaml" -SCRIPT_BEFORE_DEP_COMPILATION="`pwd`/.github/ci/before_dep_compilation.sh" -SCRIPT_BEFORE_DEP_COMPILATION_VERSIONED="`pwd`/.github/ci-$SYSTEM_VERSION/before_dep_compilation.sh" -SCRIPT_BEFORE_CMAKE="`pwd`/.github/ci/before_cmake.sh" -SCRIPT_BEFORE_CMAKE_VERSIONED="`pwd`/.github/ci-$SYSTEM_VERSION/before_cmake.sh" -SCRIPT_BETWEEN_CMAKE_MAKE="`pwd`/.github/ci/between_cmake_make.sh" -SCRIPT_BETWEEN_CMAKE_MAKE_VERSIONED="`pwd`/.github/ci-$SYSTEM_VERSION/between_cmake_make.sh" -SCRIPT_AFTER_MAKE="`pwd`/.github/ci/after_make.sh" -SCRIPT_AFTER_MAKE_VERSIONED="`pwd`/.github/ci-$SYSTEM_VERSION/after_make.sh" -SCRIPT_AFTER_MAKE_TEST="`pwd`/.github/ci/after_make_test.sh" -SCRIPT_AFTER_MAKE_TEST_VERSIONED="`pwd`/.github/ci-$SYSTEM_VERSION/after_make_test.sh" +PWD_GITHUB_CI="`pwd`/.github/ci" +SOURCE_DEPENDENCIES="${PWD_GITHUB_CI}/dependencies.yaml" +SOURCE_DEPENDENCIES_VERSIONED="${PWD_GITHUB_CI}-$SYSTEM_VERSION/dependencies.yaml" +SCRIPT_BEFORE_DEP_COMPILATION="${PWD_GITHUB_CI}/before_dep_compilation.sh" +SCRIPT_BEFORE_DEP_COMPILATION_VERSIONED="${PWD_GITHUB_CI}-$SYSTEM_VERSION/before_dep_compilation.sh" +SCRIPT_BEFORE_CMAKE="${PWD_GITHUB_CI}/before_cmake.sh" +SCRIPT_BEFORE_CMAKE_VERSIONED="${PWD_GITHUB_CI}-$SYSTEM_VERSION/before_cmake.sh" +SCRIPT_BETWEEN_CMAKE_MAKE="${PWD_GITHUB_CI}/between_cmake_make.sh" +SCRIPT_BETWEEN_CMAKE_MAKE_VERSIONED="${PWD_GITHUB_CI}-$SYSTEM_VERSION/between_cmake_make.sh" +SCRIPT_AFTER_MAKE="${PWD_GITHUB_CI}/after_make.sh" +SCRIPT_AFTER_MAKE_VERSIONED="${PWD_GITHUB_CI}-$SYSTEM_VERSION/after_make.sh" +SCRIPT_AFTER_MAKE_TEST="${PWD_GITHUB_CI}/after_make_test.sh" +SCRIPT_AFTER_MAKE_TEST_VERSIONED="${PWD_GITHUB_CI}-$SYSTEM_VERSION/after_make_test.sh" # Infer package name from GITHUB_REPOSITORY PACKAGE=$(echo "$GITHUB_REPOSITORY" | sed 's:.*/::') From 771b33f789144b3350a0632d2c9dc998430f94c3 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Tue, 20 Dec 2022 02:25:43 -0800 Subject: [PATCH 2/3] Update gzdev URL Signed-off-by: Steve Peters --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 79bcd65..27cc19b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -70,7 +70,7 @@ if python3 detect_ci_matching_branch.py "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/he GZDEV_TRY_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} fi -git clone https://github.com/osrf/gzdev /tmp/gzdev +git clone https://github.com/gazebo-tooling/gzdev /tmp/gzdev if [ -n "${GZDEV_TRY_BRANCH}" ]; then git -C /tmp/gzdev checkout ${GZDEV_TRY_BRANCH} || true fi From 07cdec57cb6cc560f178e095ddc187b1ef4276da Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Tue, 20 Dec 2022 02:26:11 -0800 Subject: [PATCH 3/3] gzdev repository enable from GZDEV_USE_* files Run `gzdev repository enable osrf {nightly|prerelease}` if the .github/ci folder contains a matching GZDEV_USE_* file. Signed-off-by: Steve Peters --- entrypoint.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 27cc19b..647aca3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -64,6 +64,10 @@ PACKAGE=$(echo "$GITHUB_REPOSITORY" | sed 's:.*/::') wget https://raw.githubusercontent.com/gazebo-tooling/release-tools/master/jenkins-scripts/tools/detect_cmake_major_version.py PACKAGE_MAJOR_VERSION=$(python3 detect_cmake_major_version.py "$GITHUB_WORKSPACE"/CMakeLists.txt) +# Check for GZDEV_USE_* files +GZDEV_USE_NIGHTLY="${PWD_GITHUB_CI}/GZ_DEV_USE_NIGHTLY" +GZDEV_USE_PRERELEASE="${PWD_GITHUB_CI}/GZ_DEV_USE_PRERELEASE" + # Check for ci_matching_branch in gzdev wget https://raw.githubusercontent.com/gazebo-tooling/release-tools/master/jenkins-scripts/tools/detect_ci_matching_branch.py if python3 detect_ci_matching_branch.py "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"; then @@ -78,6 +82,13 @@ pip3 install -r /tmp/gzdev/requirements.txt /tmp/gzdev/gzdev.py \ repository enable --project="${PACKAGE}${PACKAGE_MAJOR_VERSION}" +if [ -f "$GZDEV_USE_NIGHTLY" ] ; then + /tmp/gzdev/gzdev.py repository enable osrf nightly +fi +if [ -f "$GZDEV_USE_PRERELEASE" ] ; then + /tmp/gzdev/gzdev.py repository enable osrf prerelease +fi + apt-get update 2>&1 echo ::endgroup::