make sure curl fails on errors
This commit is contained in:
parent
92489ef7ad
commit
518b7fc148
|
|
@ -23,6 +23,8 @@ popd
|
||||||
# see https://help.sonatype.com/repomanager3/formats/apt-repositories
|
# see https://help.sonatype.com/repomanager3/formats/apt-repositories
|
||||||
apt-get install -y curl
|
apt-get install -y curl
|
||||||
curl \
|
curl \
|
||||||
|
--fail \
|
||||||
|
--show-error \
|
||||||
--user 'alice.doe:password' \
|
--user 'alice.doe:password' \
|
||||||
--header 'Content-Type: multipart/form-data' \
|
--header 'Content-Type: multipart/form-data' \
|
||||||
--data-binary @hello-world_1.0.0_amd64.deb \
|
--data-binary @hello-world_1.0.0_amd64.deb \
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ mkdir -p tmp/use-npm-repository && cd tmp/use-npm-repository
|
||||||
|
|
||||||
# install node LTS.
|
# install node LTS.
|
||||||
# see https://github.com/nodesource/distributions#debinstall
|
# see https://github.com/nodesource/distributions#debinstall
|
||||||
curl -sL https://deb.nodesource.com/setup_14.x | bash
|
curl -sL --fail --show-error https://deb.nodesource.com/setup_14.x | bash
|
||||||
apt-get install -y nodejs
|
apt-get install -y nodejs
|
||||||
node --version
|
node --version
|
||||||
npm --version
|
npm --version
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ apt-get install -y curl
|
||||||
# see https://help.sonatype.com/display/NXRM3/Raw+Repositories+and+Maven+Sites#RawRepositoriesandMavenSites-UploadingFilestoHostedRawRepositories
|
# see https://help.sonatype.com/display/NXRM3/Raw+Repositories+and+Maven+Sites#RawRepositoriesandMavenSites-UploadingFilestoHostedRawRepositories
|
||||||
expected='this is an adhoc package'
|
expected='this is an adhoc package'
|
||||||
echo "$expected" >package-1.0.0.txt
|
echo "$expected" >package-1.0.0.txt
|
||||||
curl --silent --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 --show-error --user 'alice.doe:password' --upload-file package-1.0.0.txt https://$nexus_domain/repository/adhoc-package/package-1.0.0.txt
|
||||||
|
|
||||||
# download.
|
# download.
|
||||||
actual=$(curl --silent https://$nexus_domain/repository/adhoc-package/package-1.0.0.txt)
|
actual=$(curl --silent --fail --show-error https://$nexus_domain/repository/adhoc-package/package-1.0.0.txt)
|
||||||
[ "$actual" = "$expected" ] || (echo 'upload adhoc package test failed' && false)
|
[ "$actual" = "$expected" ] || (echo 'upload adhoc package test failed' && false)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue