Skip to content

Commit

Permalink
Stop using custom cloning / cleaning for
Browse files Browse the repository at this point in the history
- wikibase
- extensions
  • Loading branch information
toban committed Dec 21, 2021
1 parent fa6a48f commit ada702a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
17 changes: 8 additions & 9 deletions build/build_extension.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,18 @@ FINAL_EXTENSION_PATH=$3
TEMP_GIT_DIR="$(mktemp -d)"
TEMP_TAR_DIR="$(pwd)"/artifacts
EXT_PATH="$TEMP_GIT_DIR/$EXTENSION"

EXTENSION_COMMIT_HASH_FILE="$ROOT/artifacts/build_metadata_${EXTENSION,,}.env"
EXTENSION_COMMIT_HASH_VARIABLE="${EXTENSION^^}_COMMIT_HASH"

mkdir -p "$TEMP_TAR_DIR"

git clone --depth 1 --single-branch --branch "${BRANCH_NAME}" "$ROOT/git_cache/$EXTENSION.git" "$EXT_PATH"

GIT_TRACE=1 git -C "$EXT_PATH" submodule update --init --recursive

bash "$ROOT"/build/write_git_metadata.sh "$EXT_PATH" "$EXTENSION_COMMIT_HASH_FILE" "$EXTENSION_COMMIT_HASH_VARIABLE"
COMMIT_HASH=${!EXTENSION_COMMIT_HASH_VARIABLE}
UPDATE_SUBMODULE=1 bash "$ROOT"/build/clone_repo.sh \
"$COMMIT_HASH" \
"$ROOT/git_cache/$EXTENSION.git" \
"$EXTENSION" \
"$EXT_PATH" \
"${BRANCH_NAME}"

# remove git things from release package
rm "$EXT_PATH"/.git* -rfv
bash "$ROOT"/build/clean_repo.sh "$EXT_PATH"

cp -r "$EXT_PATH" "$FINAL_EXTENSION_PATH"
13 changes: 7 additions & 6 deletions build/build_wikibase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ TEMP_GIT_DIR="$(mktemp -d)"
TEMP_TAR_DIR="$(pwd)"/artifacts
WIKIBASE_PATH="$TEMP_GIT_DIR/Wikibase"

git clone --depth 1 --single-branch --branch "${WIKIBASE_BRANCH_NAME}" "$ROOT/git_cache/Wikibase.git" "$WIKIBASE_PATH"
UPDATE_SUBMODULE=1 bash "$ROOT"/build/clone_repo.sh \
"$WIKIBASE_COMMIT_HASH" \
"$ROOT/git_cache/Wikibase.git" \
WIKIBASE \
"$WIKIBASE_PATH" \
"${WIKIBASE_BRANCH_NAME}"

GIT_TRACE=1 git -C "$WIKIBASE_PATH" submodule update --init --recursive
bash "$ROOT"/build/clean_repo.sh "$WIKIBASE_PATH"

bash "$ROOT"/build/write_git_metadata.sh "$WIKIBASE_PATH" "$ROOT"/artifacts/build_metadata_wikibase.env "WIKIBASE_COMMIT_HASH"

# remove git things from release package
rm "$WIKIBASE_PATH"/.git* -rfv
# remove travis build file
rm "$WIKIBASE_PATH"/.travis.yml -vf

Expand Down

0 comments on commit ada702a

Please sign in to comment.