summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2020-07-29 12:24:54 +0200
committerKarel Kočí <cynerd@email.cz>2020-07-29 12:24:54 +0200
commit563c1a29aef559be4742dfc1db1ff26915d11d8f (patch)
treea5799abb8e7ed79204569e80cd6ddb1903b736c4
parentb9b8ee5592865829b26f1d93aeb964c459424973 (diff)
downloadlaminar-cnf-563c1a29aef559be4742dfc1db1ff26915d11d8f.tar.gz
laminar-cnf-563c1a29aef559be4742dfc1db1ff26915d11d8f.tar.bz2
laminar-cnf-563c1a29aef559be4742dfc1db1ff26915d11d8f.zip
Correctly replae scp with sftp
It is not possible to run command on server side trought sftp so reverting to just replacing scp with sftp command in place.
-rwxr-xr-xjobs/turris-updater-conf.run9
-rwxr-xr-xtemplates/alpine.run12
-rwxr-xr-xtemplates/turris.run10
3 files changed, 17 insertions, 14 deletions
diff --git a/jobs/turris-updater-conf.run b/jobs/turris-updater-conf.run
index 509ae52..5ab91e6 100755
--- a/jobs/turris-updater-conf.run
+++ b/jobs/turris-updater-conf.run
@@ -9,8 +9,9 @@ echo_stage "Signing"
signify -S -s ~/openwrt-repo.sec -m pkgs/updater.lua
echo_stage "Deploy"
-sftp -d - upload <<EOF
- !mkdir -p /var/www/repo/turris
- put pkgs/updater.lua /var/www/repo/turris/
- put pkgs/updater.lua.sig /var/www/repo/turris/
+sftp -r pkgs/updater.lua{,.sig} upload:
+ssh upload /bin/sh -e <<EOF
+ mkdir -p "/var/www/repo/turris"
+ mv updater.lua "/var/www/repo/turris/updater.lua"
+ mv updater.lua.sig "/var/www/repo/turris/updater.lua.sig"
EOF
diff --git a/templates/alpine.run b/templates/alpine.run
index 7f35cb7..a65fb84 100755
--- a/templates/alpine.run
+++ b/templates/alpine.run
@@ -68,10 +68,10 @@ uroot cp "$FILES/alpine/abuild.conf" "$ROOT/etc/abuild.conf"
uchroot build 'buildrepo --purge --keep-going personal'
echo_stage "Deploy"
-sftp -b - upload:/var/www/repo <<EOF
- !mkdir -p alpine
- !rm -rf "alpine/$ARCH"
- put -R "$WORKSPACE/packages/personal/$ARCH" "alpine/$ARCH"
- put "$FILES"/alpine/setup.sh alpine/
- put "$FILES"/alpine/setup.sh.gpg alpine/
+ssh upload rm -rf "deploy-alpine"
+sftp -r "$WORKSPACE/packages/personal/$ARCH" upload:"deploy-alpine-$ARCH"
+ssh upload /bin/sh -e "$ARCH" <<"EOF"
+ rm -rf "/var/www/repo/alpine/$1"
+ mv "deploy-alpine-$1" "/var/www/repo/alpine/$1"
EOF
+sftp "$FILES"/alpine/setup.sh{,.gpg} upload:/var/www/repo/alpine/
diff --git a/templates/turris.run b/templates/turris.run
index 46341ea..dfeaf06 100755
--- a/templates/turris.run
+++ b/templates/turris.run
@@ -68,8 +68,10 @@ echo_stage "Generate index and sign"
$make package/index BUILD_KEY=~/openwrt-repo.sec
echo_stage "Deploy"
-sftp -b - upload:/var/www/repo <<EOF
- !mkdir -p "turris/$ANIMAL"
- !rm -rf "turris/$ANIMAL/$BOARD"
- put -R "bin/packages/$ARCH/personal" "turris/$ANIMAL/$BOARD"
+ssh upload rm -rf "deploy-turris-$ANIMAL-$BOARD"
+scp -r "bin/packages/$ARCH/personal" upload:"deploy-turris-$ANIMAL-$BOARD"
+ssh upload /bin/sh -e "$ANIMAL" "$BOARD" <<"EOF"
+ mkdir -p "/var/www/repo/turris/$1"
+ rm -rf "/var/www/repo/turris/$1/$2"
+ mv deploy-turris-$1-$2 "/var/www/repo/turris/$1/$2"
EOF