Skip to content

Commit 4c81ace

Browse files
KVS85Vitaly Pryakhin
andauthored
Feature/download rclone (#627)
* Initial commit * Add Windows implementation * Fix leftovers * fix typo --------- Co-authored-by: Vitaly Pryakhin <[email protected]>
1 parent a0d8df4 commit 4c81ace

11 files changed

+141
-48
lines changed

helper.fish

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,23 @@ if test ! -d work ; mkdir work ; end
444444
if test -z "$ARANGODB_DOCS_BRANCH" ; set -gx ARANGODB_DOCS_BRANCH "main"
445445
else ; set -gx ARANGODB_DOCS_BRANCH $ARANGODB_DOCS_BRANCH ; end
446446
447+
function findRcloneGoVersion
448+
set -l f "$WORKDIR/work/ArangoDB/VERSIONS"
449+
set -xg RCLONE_GO_VERSION "1.22.12"
450+
451+
test -f $f
452+
and begin
453+
set -l v (fgrep RCLONE_GO_VERSION $f | awk '{print $2}' | tr -d '"' | tr -d "'")
454+
455+
if test "$v" != ""
456+
set -xg RCLONE_GO_VERSION "$v"
457+
end
458+
end
459+
end
460+
447461
function findRcloneVersion
448462
set -l f "$WORKDIR/work/ArangoDB/VERSIONS"
449-
set -xg RCLONE_VERSION "1.59.0"
463+
set -xg RCLONE_VERSION "1.65.2"
450464
451465
test -f $f
452466
and begin
@@ -455,11 +469,17 @@ function findRcloneVersion
455469
if test "$v" != ""
456470
set -xg RCLONE_VERSION "$v"
457471
end
458-
459-
setupSourceInfo "Rclone" "$RCLONE_VERSION"
460472
end
461473
end
462474
475+
function findRcloneRelease
476+
findRcloneGoVersion
477+
and findRcloneVersion
478+
479+
set -xg RCLONE_RELEASE "golang-"$RCLONE_GO_VERSION"_"$RCLONE_VERSION
480+
setupSourceInfo "Rclone" "$RCLONE_RELEASE"
481+
end
482+
463483
function findUseRclone
464484
set -l f "$WORKDIR/work/ArangoDB/VERSIONS"
465485
@@ -475,15 +495,17 @@ function findUseRclone
475495
if test "$v" = ""
476496
#echo "$f: no USE_RCLONE specified, using false"
477497
set -gx USE_RCLONE "false"
498+
return 1
478499
else
479500
#echo "Using rclone '$v' from '$f'"
480501
set -gx USE_RCLONE "$v"
502+
return 0
481503
end
482504
end
483505
484506
if test -z "$USE_RCLONE" ; findUseRclone ; end
485507
486-
function copyRclone
508+
function prepareDownloadRclone
487509
findUseRclone
488510
489511
if test "$USE_RCLONE" = "false"
@@ -512,7 +534,7 @@ function copyRclone
512534
end
513535
end
514536
515-
findRcloneVersion
537+
findRcloneRelease
516538
517539
echo Copying rclone from rclone/v$RCLONE_VERSION/rclone-arangodb-$os-$arch to $WORKDIR/work/$THIRDPARTY_SBIN/rclone-arangodb ...
518540
mkdir -p $WORKDIR/work/$THIRDPARTY_SBIN

helper.linux.fish

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ function buildEnterprisePackage
682682
and buildStaticArangoDB
683683
and downloadStarter
684684
and downloadSyncer
685-
and copyRclone "linux"
685+
and downloadRclone
686686
and buildPackage $packages
687687

688688
if test $status -ne 0
@@ -871,7 +871,7 @@ function makeTestPackageLinux
871871
and set -xg NOSTRIP 1
872872
and buildStaticArangoDB
873873
and downloadStarter
874-
and if test "$ENTERPRISEEDITION" = "On"; downloadSyncer; and copyRclone "linux"; end
874+
and if test "$ENTERPRISEEDITION" = "On"; downloadSyncer; and downloadRclone; end
875875
and buildTarGzServerLinuxTestPackage
876876

877877
if test $status -ne 0
@@ -1241,7 +1241,7 @@ function buildDockerAny
12411241
and downloadStarter
12421242
and if test "$ENTERPRISEEDITION" = "On"
12431243
downloadSyncer
1244-
copyRclone "linux"
1244+
downloadRclone
12451245
end
12461246
and buildDockerImage $IMAGE_NAME1
12471247
and if test "$IMAGE_NAME1" != "$IMAGE_NAME2"
@@ -1579,7 +1579,7 @@ function pullUbuntuPackagingImage2 ; docker pull $UBUNTUPACKAGINGIMAGE2 ; end
15791579

15801580
function buildAlpineUtilsImage
15811581
pushd $WORKDIR
1582-
and cp -a scripts/{checkoutArangoDB,checkoutEnterprise,clearWorkDir,downloadStarter,downloadSyncer,runTests,runFullTests,switchBranches,recursiveChown}.fish containers/buildUtils.docker/scripts
1582+
and cp -a scripts/{checkoutArangoDB,checkoutEnterprise,clearWorkDir,downloadStarter,downloadSyncer,downloadRclone,runTests,runFullTests,switchBranches,recursiveChown}.fish containers/buildUtils.docker/scripts
15831583
and cd $WORKDIR/containers/buildUtils.docker
15841584
and eval "docker build $IMAGE_ARGS --pull -t $ALPINEUTILSIMAGE ."
15851585
or begin ; popd ; return 1 ; end
@@ -2081,9 +2081,16 @@ function downloadSyncer
20812081
end
20822082
end
20832083

2084+
function downloadRclone
2085+
findUseRclone
2086+
and mkdir -p $WORKDIR/work/$THIRDPARTY_SBIN
2087+
and runInContainer $ALPINEUTILSIMAGE $SCRIPTSDIR/downloadRclone.fish $INNERWORKDIR/$THIRDPARTY_SBIN $argv
2088+
and convertSItoJSON
2089+
end
2090+
20842091
function downloadAuxBinariesToBuildBin
20852092
if test "$ENTERPRISEEDITION" = "On"
2086-
copyRclone linux
2093+
downloadRclone
20872094
and cp work/ArangoDB/build/install/usr/sbin/rclone-arangodb work/ArangoDB/build/bin/
20882095
and downloadSyncer
20892096
and if test "$ARANGODB_VERSION_MAJOR" -eq 3; and test "$ARANGODB_VERSION_MINOR" -lt 12

helper.mac.fish

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,13 @@ function downloadSyncer
494494
and convertSItoJSON
495495
end
496496

497+
function downloadRclone
498+
findUseRclone
499+
and mkdir -p $WORKDIR/work/$THIRDPARTY_SBIN
500+
and runLocal $SCRIPTSDIR/downloadRclone.fish $INNERWORKDIR/$THIRDPARTY_SBIN $argv
501+
and convertSItoJSON
502+
end
503+
497504
function setupComponents
498505
cleanupThirdParty
499506
if test "$ARANGODB_VERSION_MAJOR" -eq 3; and test "$ARANGODB_VERSION_MINOR" -le 10
@@ -504,7 +511,7 @@ function setupComponents
504511
end
505512
and downloadSyncer
506513
if test "$USE_RCLONE" = "true"
507-
copyRclone "macos"
514+
downloadRclone
508515
end
509516
end
510517
else

0 commit comments

Comments
 (0)