File tree Expand file tree Collapse file tree 6 files changed +28
-4
lines changed
share/github-backup-utils Expand file tree Collapse file tree 6 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 37
37
janky-token : ' ${{ secrets.API_AUTH_TOKEN }}'
38
38
job-name : ' ${{ matrix.jankyJobName }}'
39
39
branch-name : ' ${{ env.SOURCE_BRANCH }}'
40
+ force : ' false'
40
41
# enterprise2 target branch is same as target branch for PR (either master or enterprise-[0-9]*.[0-9]*-release)
41
42
envVars : " JANKY_ENV_BACKUP_UTILS_BRANCH=${{ env.SOURCE_BRANCH }},JANKY_ENV_ENTERPRISE2_BRANCH=${{ env.TARGET_BRANCH }}"
42
43
63
64
janky-token : ' ${{ secrets.API_AUTH_TOKEN }}'
64
65
job-name : ' ${{ matrix.jankyJobName }}'
65
66
branch-name : ' ${{ env.SOURCE_BRANCH }}'
67
+ force : ' false'
66
68
# enterprise2 target branch is same as target branch for PR (either master or enterprise-[0-9]*.[0-9]*-release)
67
69
envVars : " JANKY_ENV_BACKUP_UTILS_BRANCH=${{ env.SOURCE_BRANCH }},JANKY_ENV_ENTERPRISE2_BRANCH=${{ env.TARGET_BRANCH }}"
Original file line number Diff line number Diff line change @@ -462,6 +462,24 @@ ghe_parse_remote_version() {
462
462
export GHE_VERSION_MAJOR GHE_VERSION_MINOR GHE_VERSION_PATCH
463
463
}
464
464
465
+ # In 3.11 we started to install 2 different version parallel(s)
466
+ # moreutils parallel and GNU parallel. When gnu parallel is installed,
467
+ # it renames moreutils parallel to parallel.moreutils
468
+ # set $PARALLEL_CMD envvar to be used in place of parallel commands
469
+ ghe_remote_parallel () {
470
+ if [ -z " $GHE_REMOTE_VERSION " ]; then
471
+ echo " Error: ghe_remote_version_required needs to be invoked before ghe_remote_parallel" 1>&2
472
+ exit 1
473
+ fi
474
+
475
+ if [ " $GHE_VERSION_MINOR " -lt 11 ]; then
476
+ PARALLEL_CMD=" parallel"
477
+ else
478
+ PARALLEL_CMD=" parallel.moreutils"
479
+ fi
480
+ export PARALLEL_CMD
481
+ }
482
+
465
483
# Parses the <host> part out of a "<host>:<port>" or just "<host>" string.
466
484
# This is used primarily to break hostspecs with non-standard ports down for
467
485
# rsync commands.
Original file line number Diff line number Diff line change 35
35
36
36
# Perform a host-check and establish GHE_REMOTE_XXX variables.
37
37
ghe_remote_version_required " $GHE_HOSTNAME "
38
+ ghe_remote_parallel
38
39
39
40
# Split host:port into parts
40
41
port=$( ssh_port_part " $GHE_HOSTNAME " )
@@ -156,7 +157,7 @@ if $CLUSTER; then
156
157
ghe-ssh " $GHE_HOSTNAME " -- /bin/bash >&3 << EOF
157
158
split -l 1000 $remote_routes_list $remote_tempdir /chunk
158
159
chunks=\$ (find $remote_tempdir / -name chunk\*)
159
- parallel -i /bin/sh -c "cat {} | github-env ./bin/dpages-cluster-restore-finalize" -- \$ chunks
160
+ $PARALLEL_CMD -i /bin/sh -c "cat {} | github-env ./bin/dpages-cluster-restore-finalize" -- \$ chunks
160
161
EOF
161
162
increment-progress-total-count 1
162
163
bm_end " $( basename $0 ) - Finalizing routes"
Original file line number Diff line number Diff line change 36
36
37
37
# Perform a host-check and establish GHE_REMOTE_XXX variables.
38
38
ghe_remote_version_required " $GHE_HOSTNAME "
39
+ ghe_remote_parallel
39
40
40
41
# Generate SSH config for forwarding
41
42
# Split host:port into parts
@@ -210,7 +211,7 @@ if $CLUSTER; then
210
211
ghe-ssh " $GHE_HOSTNAME " -- /bin/bash >&3 << EOF
211
212
split -l 1000 $remote_to_restore $remote_tempdir /chunk
212
213
chunks=\$ (find $remote_tempdir / -name chunk\*)
213
- parallel -i /bin/sh -c "cat {} | github-env ./bin/dgit-cluster-restore-finalize 2>>$remote_warnings " -- \$ chunks
214
+ $PARALLEL_CMD -i /bin/sh -c "cat {} | github-env ./bin/dgit-cluster-restore-finalize 2>>$remote_warnings " -- \$ chunks
214
215
EOF
215
216
increment-progress-total-count 1
216
217
bm_end " $( basename $0 ) - Finalizing routes"
Original file line number Diff line number Diff line change 35
35
36
36
# Perform a host-check and establish GHE_REMOTE_XXX variables.
37
37
ghe_remote_version_required " $GHE_HOSTNAME "
38
+ ghe_remote_parallel
38
39
39
40
# Generate SSH config for forwarding
40
41
# Split host:port into parts
@@ -159,7 +160,7 @@ if $CLUSTER; then
159
160
ghe-ssh " $GHE_HOSTNAME " -- /bin/bash >&3 << EOF
160
161
split -l 1000 $remote_to_restore $remote_tempdir /chunk
161
162
chunks=\$ (find $remote_tempdir / -name chunk\*)
162
- parallel -i /bin/sh -c "cat {} | github-env ./bin/gist-cluster-restore-finalize 2>>$remote_warnings " -- \$ chunks
163
+ $PARALLEL_CMD -i /bin/sh -c "cat {} | github-env ./bin/gist-cluster-restore-finalize 2>>$remote_warnings " -- \$ chunks
163
164
EOF
164
165
increment-progress-total-count 1
165
166
bm_end " $( basename $0 ) - Finalizing routes"
Original file line number Diff line number Diff line change 39
39
40
40
# Perform a host-check and establish GHE_REMOTE_XXX variables.
41
41
ghe_remote_version_required " $GHE_HOSTNAME "
42
+ ghe_remote_parallel
42
43
43
44
# Split host:port into parts
44
45
port=$( ssh_port_part " $GHE_HOSTNAME " )
@@ -171,7 +172,7 @@ if $CLUSTER; then
171
172
ghe-ssh " $GHE_HOSTNAME " -- /bin/bash >&3 << EOF
172
173
split -l 1000 $remote_routes_list $remote_tempdir /chunk
173
174
chunks=\$ (find $remote_tempdir / -name chunk\*)
174
- parallel -i /bin/sh -c "cat {} | github-env ./bin/storage-cluster-restore-finalize" -- \$ chunks
175
+ $PARALLEL_CMD -i /bin/sh -c "cat {} | github-env ./bin/storage-cluster-restore-finalize" -- \$ chunks
175
176
EOF
176
177
increment-progress-total-count 1
177
178
bm_end " $( basename $0 ) - Finalizing routes"
You can’t perform that action at this time.
0 commit comments