set the curl request password from stdin

This commit is contained in:
Rui Lopes
2026-06-24 07:24:24 +00:00
parent 555503c564
commit c2bb10709e
2 changed files with 14 additions and 3 deletions
+5 -2
View File
@@ -23,12 +23,15 @@ popd
# see https://help.sonatype.com/en/apt-repositories.html
apt-get install -y curl
curl \
--silent \
--fail-with-body \
--show-error \
--user 'alice.doe:password' \
--config - \
--header 'Content-Type: multipart/form-data' \
--data-binary @hello-world_1.0.0_amd64.deb \
https://$nexus_domain/repository/apt-hosted/
https://$nexus_domain/repository/apt-hosted/ <<'EOF'
user = "alice.doe:password"
EOF
# import the apt-hosted key.
nexus_apt_hosted_keyring_path="/etc/apt/keyrings/$nexus_domain-apt-hosted.gpg"
+9 -1
View File
@@ -14,7 +14,15 @@ apt-get install -y curl
# see https://help.sonatype.com/display/NXRM3/Raw+Repositories+and+Maven+Sites#RawRepositoriesandMavenSites-UploadingFilestoHostedRawRepositories
expected='this is an adhoc package'
echo "$expected" >package-1.0.0.txt
curl --silent --fail-with-body --show-error --user 'alice.doe:password' --upload-file package-1.0.0.txt https://$nexus_domain/repository/adhoc-package/package-1.0.0.txt
curl \
--silent \
--fail-with-body \
--show-error \
--config - \
--upload-file package-1.0.0.txt \
https://$nexus_domain/repository/adhoc-package/package-1.0.0.txt <<'EOF'
user = "alice.doe:password"
EOF
# download.
actual=$(curl --silent --fail-with-body --show-error https://$nexus_domain/repository/adhoc-package/package-1.0.0.txt)