Skip to content

Commit f0e316d

Browse files
authored
need the sed in the SL_USERNAME when using CURL
1 parent a5be1c7 commit f0e316d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ci/custom_stemcell/tasks/generate-light-stemcell-bionic.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@ mkdir -p ${output_dir}
2525
echo -e "Compose packages.txt and dev_tools_file_list.txt"
2626
tar zxf stemcell/*.tgz -C stemcell
2727

28+
sl_username=$(echo ${SL_USERNAME} |sed 's/@/%40/g')
29+
#to make working CURL below we need the sed
30+
2831
# Create package.txt from "dpkg -l"
2932
apt-get update
3033
apt-get install -y jq
3134
apt-get install -y sshpass
32-
root_pwd=$(echo `curl -s -g -k https://${SL_USERNAME}:${SL_API_KEY}@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/${stemcell_vm_id}/getSoftwareComponents?objectMask=mask[passwords[password]] | jq '.[0].passwords[0].password'` | sed -e 's/"//g')
33-
private_ip=$(echo `curl -s -g -k https://${SL_USERNAME}:${SL_API_KEY}@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/${stemcell_vm_id}/getObject?objectMask=mask[primaryIpAddress] | jq .primaryBackendIpAddress` | sed -e 's/"//g')
35+
root_pwd=$(echo `curl -s -g -k https://${sl_username}:${SL_API_KEY}@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/${stemcell_vm_id}/getSoftwareComponents?objectMask=mask[passwords[password]] | jq '.[0].passwords[0].password'` | sed -e 's/"//g')
36+
private_ip=$(echo `curl -s -g -k https://${sl_username}:${SL_API_KEY}@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/${stemcell_vm_id}/getObject?objectMask=mask[primaryIpAddress] | jq .primaryBackendIpAddress` | sed -e 's/"//g')
3437
sshpass -p $root_pwd ssh -o StrictHostKeychecking=no root@${private_ip} "dpkg -l" > ${output_dir}/packages.txt
3538
3639
cp stemcell/dev_tools_file_list.txt ${output_dir}

0 commit comments

Comments
 (0)