Skip to content

Commit a89b36d

Browse files
Karl BishopKarl Bishop
authored andcommitted
Addressed several outstanding issues
1 parent 13223ad commit a89b36d

4 files changed

Lines changed: 82 additions & 50 deletions

File tree

README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,39 @@
11
# IBM Cloud Developer Tools
22

3-
These scripts perform an installation of the IBM Cloud Developer Tools CLI environment. The IDT is a plugin to the IBM Bluemix CLI. Our general target environment is the IBM Cloud, including public, dedicated, and private.
4-
53
[![](https://img.shields.io/badge/bluemix-powered-blue.svg)](https://bluemix.net)
64
![Platform](https://img.shields.io/badge/platform-BASH-lightgrey.svg?style=flat)
75
![Platform](https://img.shields.io/badge/platform-PowerShell-lightgrey.svg?style=flat)
86

7+
These scripts perform an installation of the IBM Cloud Developer Tools CLI environment. The IDT is a collection of tools to aid in IBM Cloud native developement. They currently consist of the 'dev' plugin to the IBM Bluemix CLI, as well as the [IBM Developer Tools extension](https://marketplace.visualstudio.com/items?itemName=IBM.ibm-developer) to the [Visual Studio Code editor](https://code.visualstudio.com/). These tools work for the following environments:
8+
- [IBM **Cloud** Public](https://www.ibm.com/cloud-computing/)
9+
- [IBM **Cloud** Private](https://www.ibm.com/cloud-computing/products/ibm-cloud-private/)
10+
- [IBM **Cloud** Dedicated](https://www.ibm.com/cloud-computing/bluemix/dedicated)
11+
- [IBM MicroService Builder](https://developer.ibm.com/microservice-builder/)
12+
913

10-
The following are platform specific concerns and notes you should be aware of.
1114

1215
## MacOS & Linux Installation
1316

14-
The following command can install the IBM Cloud Developer Tools in a single invocation. Open up a terminal and run the following command:
17+
The following command will install the IBM Cloud Developer Tools in a single invocation. Open up a terminal and run the following command:
1518

1619
```
1720
$ curl -sL https://ibm.biz/idt-installer | bash
1821
```
1922

20-
By default, this installer will use the 'brew' installer on MacOS, if available. If you explicitly do not want to use brew, execute the following command with `--nobrew` option:
23+
By default, this installer will use the 'brew' installer on MacOS, if available. If you explicitly do not want to use brew, execute the following command using the `--nobrew` option:
2124

2225
```
2326
curl -sL https://ibm.biz/idt-installer | bash -s -- --nobrew
2427
```
2528

2629
Once complete, there will be three aliases defined to access the IBM Cloud Developer Tools:
27-
- `idt` : Main command line tool for IBM cloud native development (shortcut to 'bx dev')
28-
- `idt-update` : Update your IDT environment to the latest versions
30+
- `idt` : Main command line tool. Shorthand for standard 'bx dev' command
31+
- `idt-update` : Update your IBM Cloud Developer Tools to the latest versions
2932
- `idt-uninstall` : Uninstall the IBM Cloud Developer Tools
3033

34+
Note: In order to access these aliases, you need to either restart your terminal session,
35+
or reload your bash env (ie `. ~/.bashrc`)
36+
3137
Access the [platform-specific readme](./linux-installer/README.md) for additional details.
3238

3339
This script has only been tested on Ubuntu Linux systems, although it should behave properly on other distros. If you run into any issues, please let us know on [Slack](https://ibm.biz/IBMCloudNativeSlack) or file an issue on our [GitHub repo](https://github.com/ibm-cloud-tools/idt-installer).
@@ -50,5 +56,8 @@ Access the [Widnows-specific readme](./windows-installer/README.md) for addition
5056

5157
## Feedback
5258

53-
We can be reached on [Slack](https://ibm.biz/IBMCloudNativeSlack) or file an issue on our [GitHub repo](https://github.com/ibm-cloud-tools/idt-installer).
59+
We can be reached in the following ways. We encourage and welcome all feedback and suggestions
60+
- [IBM Cloud Tech Slack](https://slack-invite-ibm-cloud-tech.mybluemix.net/): Find us on the `#developer-tools` channel
61+
- [IBM Cloud Developer Tools GitHub repo](https://github.com/IBM-Bluemix/ibm-cloud-developer-tools): Use to file any issues specific to installation of the tools
62+
- [IBM Cloud Ideas portal](http://ibm.biz/cloudideas): Use to view and submit new feature ideas for the IBM Cloud
5463

linux-installer/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Once complete, there will be three aliases defined to access the IDT:
3636

3737
Note: You will need to either restart your terminal session, or reload your bash environment (ie `. ~/.bashrc`) to access these commands.
3838

39+
3940
### Debugging
4041

4142
If you have any issues with the instaler, try running with the `--trace` argument which will produce verbose output to assist us in diagnosing your problem:

linux-installer/idt-installer

Lines changed: 58 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
# Copyright (c) 2017, International Business Machines. All Rights Reserved.
88
#------------------------------------------------------------------------------
99

10-
VERSION="0.8"
10+
VERSION="1.0.1"
1111
PROG="IBM Cloud Developer Tools - Installer"
1212
INSTALLER_URL="https://ibm.biz/idt-installer"
13-
GIT_URL="https://github.com/ibm-cloud-tools/idt-installer"
14-
SLACK_URL="https://ibm.biz/IBMCloudNativeSlack"
13+
GIT_URL="https://github.com/ibm-cloud-tools/ibm-cloud-developer"
14+
SLACK_URL="https://slack-invite-ibm-cloud-tech.mybluemix.net/"
1515
DEFAULT_BMX_URL="https://clis.ng.bluemix.net/install"
1616

1717
if [[ "$IDT_INSTALL_USE_PROD" != false ]]; then
@@ -29,8 +29,9 @@ EXT_PROGS=(
2929
"helm,kubernetes-helm,https://github.com/kubernetes/helm/blob/master/docs/install.md"
3030
)
3131

32-
#-- Bluemix plugins to process
32+
#-- BX plugins to process
3333
PLUGINS=(
34+
"Cloud-Functions"
3435
"container-registry"
3536
"container-service"
3637
"dev"
@@ -59,7 +60,7 @@ function help {
5960
If "uninstall", the IBM Cloud CLI and plugins are removed from the system, including personal metadata.
6061
Note: Pre-req CLIs listed above are NOT uninstalled.
6162
62-
Chat with us on Slack: ${SLACK_URL}, channel #bluemix-dev-services
63+
Chat with us on Slack: ${SLACK_URL}, channel #developer-tools
6364
Submit any issues to : ${GIT_URL}/issues
6465
6566
!!EOF
@@ -113,7 +114,7 @@ function prompt_password {
113114
function uninstall {
114115
if [[ -t 0 ]]; then #-- are we in a terminal?
115116
echo
116-
prompt "Please confirm you want to uninstall IBM Developer Tools (y/N)?"
117+
prompt "Please confirm you want to uninstall IBM Cloud Developer Tools (y/N)?"
117118
if [[ "$REPLY" != [Yy]* ]]; then
118119
log "Uninstall aborted at user request"
119120
return
@@ -122,7 +123,7 @@ function uninstall {
122123
warn "Starting Uninstall..."
123124
log "You may be prompted for 'sudo' password."
124125

125-
log "Removing Bluemix CLI..."
126+
log "Removing IBM Cloud 'bx' CLI..."
126127
if [[ "${PLATFORM}" == "Darwin" && "$USEBREW" == true ]]; then
127128
brew cask uninstall "bluemix-cli"
128129
fi
@@ -171,6 +172,16 @@ function install {
171172
#------------------------------------------------------------------------------
172173
function install_deps {
173174
has_error=false
175+
#-- check for/install brew for macos
176+
if [[ "$PLATFORM" == "Darwin" && "$USEBREW" != false ]]; then
177+
if [[ -z "$(which brew)" && -n "$(which ruby)" ]]; then
178+
warn "'brew' installer not found, attempting to install..."
179+
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
180+
log "'brew' installation completed."
181+
fi
182+
fi
183+
[[ -z "$(which brew)" ]] && USEBREW=false
184+
174185
for item in "${EXT_PROGS[@]}"; do
175186
#-- Parse array item into vars
176187
IFS="," read -r prog_bin prog_brew prog_url <<< "$item"
@@ -182,20 +193,20 @@ function install_deps {
182193
log "You should review any setup requirements for '${prog_bin}' from: ${prog_url}"
183194
elif [[ "$prog_bin" == "kubectl" ]]; then
184195
case $PLATFORM in
185-
"Linux")
186-
curl --progress-bar -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
187-
;;
188-
"Darwin")
189-
curl --progress-bar -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl
190-
;;
191-
*)
192-
warn "Only MacOS and Linux systems are supported by this installer."
193-
warn "For Windows, please follow manual installation instructions at:"
194-
warn "https://github.com/IBM-Bluemix/developer-tools-installer"
195-
error "Unsupported platform: ${PLATFORM}"
196-
;;
197-
esac
198-
chmod +x ./kubectl
196+
"Linux")
197+
curl --progress-bar -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
198+
;;
199+
"Darwin")
200+
curl --progress-bar -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl
201+
;;
202+
*)
203+
warn "Only MacOS and Linux systems are supported by this installer."
204+
warn "For Windows, please follow manual installation instructions at:"
205+
warn "${GIT_URL}"
206+
error "Unsupported platform: ${PLATFORM}"
207+
;;
208+
esac
209+
chmod +x ./kubectl
199210
sudo mv ./kubectl /usr/local/bin/kubectl
200211
log "Review any setup requirements for '${prog_bin}' from: ${prog_url}"
201212
elif [[ "$prog_bin" == "helm" ]]; then
@@ -215,26 +226,26 @@ function install_deps {
215226

216227
#------------------------------------------------------------------------------
217228
function install_bx {
218-
if [[ -z "$(which bluemix)" ]]; then
219-
log "Installing IBM Cloud 'Bluemix' CLI for platform '${PLATFORM}'..."
229+
if [[ -z "$(which bx)" ]]; then
230+
log "Installing IBM Cloud 'bx' CLI for platform '${PLATFORM}'..."
220231
case "$PLATFORM" in
221232
"Darwin")
222233
#-- Only use BREW if using default bluemix URL (not an internal url)
223234
if [[ "$USEBREW" == true && "$IDT_INSTALL_BMX_REPO_NAME" == "Bluemix" ]]; then
224235
brew cask reinstall "caskroom/cask/bluemix-cli"
225236
else
226-
log "Downloading and installing Bluemix CLI from: ${IDT_INSTALL_BMX_URL}/osx"
237+
log "Downloading and installing IBM Cloud 'bx' CLI from: ${IDT_INSTALL_BMX_URL}/osx"
227238
sh <(curl -fsSL ${IDT_INSTALL_BMX_URL}/osx)
228239
fi
229240
;;
230241
"Linux")
231-
log "Downloading and installing Bluemix CLI from: ${IDT_INSTALL_BMX_URL}/linux"
242+
log "Downloading and installing IBM Cloud 'bx' CLI from: ${IDT_INSTALL_BMX_URL}/linux"
232243
sh <(curl -fsSL ${IDT_INSTALL_BMX_URL}/linux)
233244
;;
234245
esac
235-
log "IBM Cloud CLI install finished."
246+
log "IBM Cloud 'bx' CLI install finished."
236247
else #-- Upgrade
237-
log "Updating exisitng IBM Cloud CLI..."
248+
log "Updating exisitng IBM Cloud 'bx' CLI..."
238249
bx update
239250
fi
240251
log "Running 'bx --version'..."
@@ -267,6 +278,7 @@ function install_plugins {
267278
#------------------------------------------------------------------------------
268279
function env_setup {
269280
env_file=""
281+
show_warn=false
270282
if [[ -f ~/.bashrc ]] ; then env_file=~/.bashrc
271283
elif [[ -f ~/.bash_profile ]]; then env_file=~/.bash_profile
272284
elif [[ -f ~/.profile ]] ; then env_file=~/.profile
@@ -277,37 +289,45 @@ function env_setup {
277289
fi
278290
case "$1" in
279291
"add")
280-
if [[ -z "$(grep 'alias idt="bluemix dev"' "$env_file")" ]]; then
292+
if [[ -z "$(grep 'alias idt="bx dev"' "$env_file")" ]]; then
281293
log "Adding 'idt' aliases to: ${env_file}"
282294
cp -f "$env_file" "$env_file".idt_install_bak || error "Add - Failed to backup file: ${env_file}"
283295
echo '#-- Added by the IDT Installer' >> "$env_file"
284-
echo 'alias idt="bluemix dev"' >> "$env_file"
296+
echo 'alias idt="bx dev"' >> "$env_file"
285297
if [[ "$PLATFORM" == "Darwin" && "$USEBREW" == false ]]; then
286298
echo 'alias idt-update="curl -sL' "$INSTALLER_URL" '| bash -s -- --nobrew"' >> "$env_file"
287299
echo 'alias idt-uninstall="curl -sL' "$INSTALLER_URL" '| bash -s -- --nobrew uninstall"' >> "$env_file"
288300
else
289301
echo 'alias idt-update="curl -sL' "$INSTALLER_URL" '| bash"' >> "$env_file"
290302
echo 'alias idt-uninstall="curl -sL' "$INSTALLER_URL" '| bash -s uninstall"' >> "$env_file"
291303
fi
292-
warn "To access the aliases below, you need to either restart your terminal session,"
293-
warn "or reload your bash env (ie '. ${env_file}')"
304+
show_warn=true
294305
else
295306
log "'idt' aliases are already defined in: ${env_file}"
296307
fi
297-
log "The following aliases are defined to access the 'idt' tool:"
298-
log " ${GRN}idt${NRM} : Main command line tool for IBM Cloud Native development"
299-
log " ${GRN}idt-update${NRM} : Update your IDT tools to the latest version"
308+
if [[ -f ~/.bash_profile && -z "$(grep '.bashrc' ~/.bash_profile)" ]]; then
309+
log "Adding '~/.bashrc' loader into '~/.bash_profile'"
310+
echo "# Load .bashrc settings" >> ~/.bash_profile
311+
echo "[ -f ~/.bashrc ] && source ~/.bashrc" >> ~/.bash_profile
312+
fi
313+
log "The following aliases are defined to access the IBM Cloud Developer Tools CLI:"
314+
log " ${GRN}idt${NRM} : Main command line. Shorthand for standard '${CYN}bx dev${NRM}' command"
315+
log " ${GRN}idt-update${NRM} : Update your IBM Cloud Developer Tools to the latest version"
300316
log " ${GRN}idt-uninstall${NRM} : Uninstall the IBM Cloud Developer Tools"
317+
if [[ "$show_warn" == true ]]; then
318+
warn "To access the aliases above, you need to either restart your terminal session,"
319+
warn "or reload your bash env (ie '. ${env_file}')"
320+
fi
301321
;;
302322
"remove")
303-
if [[ -n "$(grep 'alias idt="bluemix dev"' "$env_file")" ]]; then
323+
if [[ -n "$(grep 'alias idt="bx dev"' "$env_file")" ]]; then
304324
log "Removing 'idt' aliases from: ${env_file}"
305325
sed -E -i ".idt_uninstall_bak" \
306326
-e '/^#-- Added by the IDT Installer$/d' \
307-
-e '/^alias idt=\"bluemix dev\"$/d' \
327+
-e '/^alias idt=\"bx dev\"$/d' \
308328
-e '/^alias idt-update=/d' \
309329
-e '/^alias idt-uninstall=/d' \
310-
${env_file}
330+
${env_file}
311331
fi
312332
;;
313333
*) error "Interal error - called with invalid parameter: ${1}";;
@@ -347,15 +367,14 @@ function main {
347367

348368
case "$PLATFORM" in
349369
"Darwin")
350-
[[ -z "$(which brew)" ]] && USEBREW=false
351370
;;
352371
"Linux")
353372
warn "Linux has only been tested on Ubuntu, please let us know if you use this utility on other Distros"
354373
;;
355374
*)
356375
warn "Only MacOS and Linux systems are supported by this installer."
357376
warn "For Windows, please follow manual installation instructions at:"
358-
warn "https://github.com/IBM-Bluemix/developer-tools-installer"
377+
warn "${GIT_URL}"
359378
error "Unsupported platform: ${PLATFORM}"
360379
;;
361380
esac

windows-installer/idt-win-installer.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,24 @@ for ($i=2; $i -lt $pluginlist.length; $i++) {
9696
}
9797
}
9898
# Install plugins.
99+
if( $EXT_PLUGINS.contains("cloud-functions")) {
100+
C:\"Program Files"\IBM\Bluemix\bin\bx.exe plugin install cloud-functions -r Bluemix
101+
}
99102
if( $EXT_PLUGINS.contains("container-registry")) {
100103
C:\"Program Files"\IBM\Bluemix\bin\bx.exe plugin install container-registry -r Bluemix
101104
}
102105
if( $EXT_PLUGINS.contains("container-service")) {
103106
C:\"Program Files"\IBM\Bluemix\bin\bx.exe plugin install container-service -r Bluemix
104107
}
105-
if( $EXT_PLUGINS.contains("IBM-Containers")) {
106-
C:\"Program Files"\IBM\Bluemix\bin\bx.exe plugin install IBM-Containers -r Bluemix
107-
}
108108
if( $EXT_PLUGINS.contains("schematics")) {
109109
C:\"Program Files"\IBM\Bluemix\bin\bx.exe plugin install schematics -r Bluemix
110110
}
111111
if( $EXT_PLUGINS.contains("dev")) {
112112
C:\"Program Files"\IBM\Bluemix\bin\bx.exe plugin install dev -r Bluemix
113113
}
114+
if( $EXT_PLUGINS.contains("sdk-gen")) {
115+
C:\"Program Files"\IBM\Bluemix\bin\bx.exe plugin install sdk-gen -r Bluemix
116+
}
114117

115118
# Request Restart to save changes to PATH.
116119
$restart = Read-Host "A system restart is required. Would you like to restart now (y/n)? (default is n)"

0 commit comments

Comments
 (0)