-
Notifications
You must be signed in to change notification settings - Fork 39
Add shallow option to ecbuild_bundle #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mcakircali
wants to merge
11
commits into
develop
Choose a base branch
from
feature/shallow-clone
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
eda5aba
shallow clone
mcakircali 01b6e79
Merge branch 'develop' of github.com:ecmwf/ecbuild into develop
mcakircali c04134a
add doc for shallow option
mcakircali 39b22d3
skip fetch and pull when shallow
mcakircali d543574
add doc for shallow option to ecbuild_bundle
mcakircali bdacb96
guard commit id for shallow
mcakircali f20d7f2
guard switching for shallow
mcakircali c8811ce
guard pull for shallow
mcakircali d9a0d66
Add test for ecbuild_bundle with shallow option
marcosbento 2914bc9
fix test shallow option
mcakircali 4a25639
add warning for update + shallow
mcakircali File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| ecbuild_add_test( | ||
| TARGET test_ecbuild_bundle_shallow | ||
| TYPE SCRIPT | ||
| COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/run-test.sh | ||
| ENVIRONMENT | ||
| CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} | ||
| CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} | ||
| CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
| set -x | ||
|
|
||
| HERE="$( cd $( dirname "${BASH_SOURCE[0]}" ) && pwd -P )" | ||
|
|
||
| ECBUILD_PATH=${CMAKE_SOURCE_DIR}/bin | ||
| SOURCE_TEST_DIR=${CMAKE_CURRENT_SOURCE_DIR} | ||
| BINARY_TEST_DIR=${CMAKE_CURRENT_BINARY_DIR} | ||
|
|
||
| # Git 2.38.1+ blocks local file:// submodule clones by default. | ||
| # Allow them for the duration of this script only. | ||
| export GIT_CONFIG_COUNT=1 | ||
| export GIT_CONFIG_KEY_0=protocol.file.allow | ||
| export GIT_CONFIG_VALUE_0=always | ||
|
|
||
| # Add ecbuild to path | ||
| export PATH=$ECBUILD_PATH:$PATH | ||
|
|
||
| # ---- cleanup ----------------------------------------- | ||
| rm -rf "${BINARY_TEST_DIR}/workspace" | ||
|
|
||
| # ---- setup umbrella project (with submodules) -------- | ||
| cd "${BINARY_TEST_DIR}" | ||
| bash "${SOURCE_TEST_DIR}/setup-umbrella-project.sh" \ | ||
| "${BINARY_TEST_DIR}/workspace/projects" | ||
|
|
||
| # ---- setup umbrella bundle --------------------------- | ||
| cd "${BINARY_TEST_DIR}" | ||
| bash "${SOURCE_TEST_DIR}/setup-umbrella-bundle.sh" \ | ||
| "${BINARY_TEST_DIR}/workspace/bundle" \ | ||
| "${BINARY_TEST_DIR}/workspace/projects/umbrella" | ||
|
|
||
| # ---- configure umbrella bundle ----------------------- | ||
| cd ${BINARY_TEST_DIR}/workspace | ||
| mkdir build | ||
| cd build | ||
| ecbuild --prefix=$(pwd)/install -- ../bundle | ||
|
|
||
| # ---- check shallowness (umbrella) -------------------- | ||
| cd ${BINARY_TEST_DIR}/workspace/bundle/umbrella | ||
|
|
||
| if [[ "$(git rev-parse --is-shallow-repository)" == "true" ]]; then | ||
| echo "Submodule is shallow: PASS" | ||
| exit 0 | ||
| else | ||
| echo "Submodule is not shallow: FAIL" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # ---- check shallowness (umbrella submodules) --------- | ||
| for sub in alpha beta gamma; do | ||
| cd "${BINARY_TEST_DIR}/workspace/bundle/umbrella/${sub}" | ||
|
|
||
| if [[ "$(git rev-parse --is-shallow-repository)" == "true" ]]; then | ||
| echo "Submodule $sub is shallow: PASS" | ||
| else | ||
| echo "Submodule $sub is not shallow: FAIL" | ||
| exit 1 | ||
| fi | ||
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
| set -u | ||
| set -o pipefail | ||
|
|
||
| # ───────────────────────────────────────────── | ||
| # Configuration | ||
| # ───────────────────────────────────────────── | ||
| BASE_DIR="${1:-$(pwd)/bundle}" | ||
| UMBRELLA_DIR="${2:-$(pwd)/projects/umbrella}" | ||
|
|
||
| echo "==> Creating bundle workspace at: $BASE_DIR" | ||
| mkdir -p "$BASE_DIR" | ||
| cd "$BASE_DIR" | ||
|
|
||
| # ───────────────────────────────────────────── | ||
| # Create the umbrella bundle | ||
| # ───────────────────────────────────────────── | ||
|
|
||
| UMBRELLA_GIT="file://$(dirname "${UMBRELLA_DIR}")/../bare-repos/$(basename "${UMBRELLA_DIR}").git" | ||
|
|
||
| cat > CMakeLists.txt <<EOF | ||
|
|
||
| cmake_minimum_required(VERSION 3.18 FATAL_ERROR) | ||
|
|
||
| find_package( ecbuild 3.12 REQUIRED HINTS ${CMAKE_SOURCE_DIR} ) | ||
|
|
||
| project( umbrella-bundle LANGUAGES NONE ) | ||
|
|
||
| ecbuild_bundle_initialize() | ||
|
|
||
| ecbuild_bundle( | ||
| PROJECT umbrella | ||
| GIT "${UMBRELLA_GIT}" | ||
| BRANCH main | ||
| RECURSIVE | ||
| SHALLOW | ||
| ) | ||
|
|
||
| ecbuild_bundle_finalize() | ||
|
|
||
| EOF | ||
|
|
||
| cat > VERSION <<EOF | ||
| 0.0.1 | ||
| EOF |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.