Skip to content

Commit

Permalink
anonymous curl works better, auth fails
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-jameson committed Oct 9, 2024
1 parent bbdd80f commit 002d4f6
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions scripts/cf-check.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
#!/bin/sh
set -e
if command -v cf /dev/null 2>&1; then
if command -v cfx /dev/null 2>&1; then
echo The command cf is available
else
# using curl, i want to download from our nexus host at https://tdp-nexus.dev.raftlabs.tech with
# path /#browse/browse:tdp-bin:cloudfoundry-cli to download this file: "cloudfoundry-cli/cf7-cli_7.7.13_linux_x86-64.tgz"
# using the credentials $NEXUS_USER and $NEXUS_PASS
# and then extract the file and move it to /usr/local/bin/cf
# and then make it executable
NEXUS_ARCHIVE="cf7-cli_7.7.13_linux_x86-64.tgz"
NEXUS_URL="https://tdp-nexus.dev.raftlabs.tech/repository/tdp-bin/cloudfoundry-cli/$NEXUS_ARCHIVE"
#curl -u $NEXUS_USER:$NEXUS_PASS $NEXUS_URL -o $NEXUS_ARCHIVE
curl $NEXUS_URL -o $NEXUS_ARCHIVE
tar xzf $NEXUS_ARCHIVE #&& rm -f $NEXUS_ARCHIVE
mv ./cf /usr/local/bin/
chmod +x /usr/local/bin/cf

apt-get update
apt-get install wget gnupg2 apt-transport-https
# apt-get update
# apt-get install wget gnupg2 apt-transport-https

wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
# wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -

echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
# echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list

apt-get update
apt-get install cf7-cli
# apt-get update
# apt-get install cf7-cli

fi

0 comments on commit 002d4f6

Please sign in to comment.