mirror of
https://github.com/bitnami/containers.git
synced 2026-10-18 05:59:59 +02:00
Fix sync process (#16)
Signed-off-by: Fran Mulero <fmulero@vmware.com> Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
committed by
GitHub
co-authored by
Bitnami Containers
parent
96b4bb94a9
commit
bf877118cc
@@ -45,6 +45,8 @@ jobs:
|
||||
matrix:
|
||||
flavor: ${{ fromJSON(needs.get-container.outputs.flavors) }}
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pip install git-filter-repo==2.34.0
|
||||
- uses: actions/checkout@v2
|
||||
name: Checkout Repository
|
||||
with:
|
||||
|
||||
+4
-15
@@ -64,12 +64,12 @@ findCommitsToSync() {
|
||||
local max=100 # If we need to sync more than 100 commits there must be something wrong since we run the job on a daily basis
|
||||
# Get all commits IDs on the origin
|
||||
local commits=()
|
||||
while IFS='' read -r line; do commits+=("$line"); done < <(git rev-list "${origin_name}/master" -- .)
|
||||
# Get the revision list in topological order ignoring merge commits
|
||||
while IFS='' read -r line; do commits+=("$line"); done < <(git rev-list --topo-order --no-merges "${origin_name}/master" -- .)
|
||||
for commit in "${commits[@]}"; do
|
||||
if [[ "$commit" != "$last_synced_commit_id" ]] && [[ "$max" -gt "0" ]]; then
|
||||
actual_commit_id="$(plainCommit "${commit}")"
|
||||
if [[ "$commit" != "$SKIP_COMMIT_ID" ]] && [[ ! $commits_to_sync =~ (^|[[:space:]])$actual_commit_id($|[[:space:]]) ]]; then
|
||||
commits_to_sync="${actual_commit_id} ${commits_to_sync}"
|
||||
if [[ "$commit" != "$SKIP_COMMIT_ID" ]]; then
|
||||
commits_to_sync="${commit} ${commits_to_sync}"
|
||||
fi
|
||||
else
|
||||
# We reached the last commit synced
|
||||
@@ -82,16 +82,6 @@ findCommitsToSync() {
|
||||
echo "$commits_to_sync"
|
||||
}
|
||||
|
||||
plainCommit() {
|
||||
local commit="${1:?Missing commit}"
|
||||
local result="$commit"
|
||||
actual_merge_commit_id="$(git log --pretty=%P -n 1 "$commit" | awk '{print $2}')"
|
||||
if [[ -n "$actual_merge_commit_id" ]]; then
|
||||
result="$(plainCommit "${actual_merge_commit_id}")"
|
||||
fi
|
||||
echo "$result"
|
||||
}
|
||||
|
||||
syncCommit() {
|
||||
local -r commit_id="${1:?Missing commit id}"
|
||||
local -r app="${2:?Missing app name}"
|
||||
@@ -178,5 +168,4 @@ syncRepos() {
|
||||
pushChanges
|
||||
}
|
||||
|
||||
pip install git-filter-repo==2.34.0
|
||||
syncRepos
|
||||
Reference in New Issue
Block a user