osmith has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/docker-playground/+/30386 )


Change subject: release-tarball-build-dist: move rsync into docker
......................................................................

release-tarball-build-dist: move rsync into docker

Prepare to use ssh inside the docker container to check if tarballs
already exist, see the next patch.

Remove the '' around UserKnownHostsFile as using SSH_COMMAND in the next
patch without rsync fails otherwise with:
  command-line: line 0: Bad configuration option: 'userknownhostsfile

Change-Id: I6dfe5d587d05063c6cf2c9ec683e7b7e499b79c1
---
M release-tarball-build-dist/Dockerfile
M release-tarball-build-dist/jenkins.sh
A release-tarball-build-dist/known_hosts
M release-tarball-build-dist/osmocom-release-tarballs.sh
4 files changed, 13 insertions(+), 10 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/docker-playground 
refs/changes/86/30386/1

diff --git a/release-tarball-build-dist/Dockerfile 
b/release-tarball-build-dist/Dockerfile
index dad9d0a..678efd4 100644
--- a/release-tarball-build-dist/Dockerfile
+++ b/release-tarball-build-dist/Dockerfile
@@ -67,6 +67,7 @@
                make \
                mscgen \
                python3-nwdiag \
+               rsync \
                xsltproc \
                && \
        apt-get clean
diff --git a/release-tarball-build-dist/jenkins.sh 
b/release-tarball-build-dist/jenkins.sh
index 0177da8..d59aa15 100755
--- a/release-tarball-build-dist/jenkins.sh
+++ b/release-tarball-build-dist/jenkins.sh
@@ -8,21 +8,13 @@
 docker run \
        --rm=true \
        -v "$PWD:/build" \
+       -v "$(readlink -f $SSH_AUTH_SOCK)":/ssh-agent \
        -w /osmo-ci \
        -e KEEP_TEMP="$KEEP_TEMP" \
+       -e SSH_AUTH_SOCK=/ssh-agent \
        "$USER/release-tarball-build-dist" sh -e 
/build/osmocom-release-tarballs.sh

 if [ -z "$WORKSPACE" ]; then
        set +x
        echo "NOTE: not running on jenkins, skipping upload"
 fi
-
-cat > "$WORKSPACE/known_hosts" <<EOF
-[ftp.osmocom.org]:48 ssh-rsa 
AAAAB3NzaC1yc2EAAAADAQABAAABAQDDgQ9HntlpWNmh953a2Gc8NysKE4orOatVT1wQkyzhARnfYUerRuwyNr1GqMyBKdSI9amYVBXJIOUFcpV81niA7zQRUs66bpIMkE9/rHxBd81SkorEPOIS84W4vm3SZtuNqa+fADcqe88Hcb0ZdTzjKILuwi19gzrQyME2knHY71EOETe9Yow5RD2hTIpB5ecNxI0LUKDq+Ii8HfBvndPBIr0BWYDugckQ3Bocf+yn/tn2/GZieFEyFpBGF/MnLbAAfUKIdeyFRX7ufaiWWz5yKAfEhtziqdAGZaXNaLG6gkpy3EixOAy6ZXuTAk3b3Y0FUmDjhOHllbPmTOcKMry9
-[ftp.osmocom.org]:48 ecdsa-sha2-nistp256 
AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPdWn1kEousXuKsZ+qJEZTt/NSeASxCrUfNDW3LWtH+d8Ust7ZuKp/vuyG+5pe5pwpPOgFu7TjN+0lVjYJVXH54=
-[ftp.osmocom.org]:48 ssh-ed25519 
AAAAC3NzaC1lZDI1NTE5AAAAIK8iivY70EiR5NiGChV39gRLjNpC8lvu1ZdHtdMw2zuX
-EOF
-
-SSH_COMMAND="ssh -o 'UserKnownHostsFile=$WORKSPACE/known_hosts' -p 48"
-cd _release_tarballs
-rsync -avz --delete -e "$SSH_COMMAND" . relea...@ftp.osmocom.org:web-files/
diff --git a/release-tarball-build-dist/known_hosts 
b/release-tarball-build-dist/known_hosts
new file mode 100644
index 0000000..de29e93
--- /dev/null
+++ b/release-tarball-build-dist/known_hosts
@@ -0,0 +1,3 @@
+[ftp.osmocom.org]:48 ssh-rsa 
AAAAB3NzaC1yc2EAAAADAQABAAABAQDDgQ9HntlpWNmh953a2Gc8NysKE4orOatVT1wQkyzhARnfYUerRuwyNr1GqMyBKdSI9amYVBXJIOUFcpV81niA7zQRUs66bpIMkE9/rHxBd81SkorEPOIS84W4vm3SZtuNqa+fADcqe88Hcb0ZdTzjKILuwi19gzrQyME2knHY71EOETe9Yow5RD2hTIpB5ecNxI0LUKDq+Ii8HfBvndPBIr0BWYDugckQ3Bocf+yn/tn2/GZieFEyFpBGF/MnLbAAfUKIdeyFRX7ufaiWWz5yKAfEhtziqdAGZaXNaLG6gkpy3EixOAy6ZXuTAk3b3Y0FUmDjhOHllbPmTOcKMry9
+[ftp.osmocom.org]:48 ecdsa-sha2-nistp256 
AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPdWn1kEousXuKsZ+qJEZTt/NSeASxCrUfNDW3LWtH+d8Ust7ZuKp/vuyG+5pe5pwpPOgFu7TjN+0lVjYJVXH54=
+[ftp.osmocom.org]:48 ssh-ed25519 
AAAAC3NzaC1lZDI1NTE5AAAAIK8iivY70EiR5NiGChV39gRLjNpC8lvu1ZdHtdMw2zuX
diff --git a/release-tarball-build-dist/osmocom-release-tarballs.sh 
b/release-tarball-build-dist/osmocom-release-tarballs.sh
index 02b81a6..04b8350 100644
--- a/release-tarball-build-dist/osmocom-release-tarballs.sh
+++ b/release-tarball-build-dist/osmocom-release-tarballs.sh
@@ -6,6 +6,7 @@
 # Environment variables:
 # * KEEP_TEMP: do not delete cloned repositories (use for development)
 # * PARALLEL_MAKE: -jN argument for make (default: -j5).
+SSH_COMMAND="ssh -o UserKnownHostsFile=/build/known_hosts -p 48"
 OSMO_GIT_URL="https://git.osmocom.org";
 OSMO_RELEASE_REPOS="
        libasn1c
@@ -315,6 +316,11 @@
        esac
 }

+upload() {
+       cd _release_tarballs
+       rsync -avz --delete -e "$SSH_COMMAND" . 
relea...@ftp.osmocom.org:web-files/
+}
+
 remove_temp_dir
 mkdir -p "$TEMP/repos"
 echo "Temp dir: $TEMP"
@@ -346,4 +352,5 @@
 done

 remove_temp_dir
+upload
 echo "done!"

--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/30386
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I6dfe5d587d05063c6cf2c9ec683e7b7e499b79c1
Gerrit-Change-Number: 30386
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osm...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to