Skip to content

Commit e921fa0

Browse files
authored
Merge pull request #5 from kfbishop/master
Added support for new curl|sh bx installer. Removed all Windows refs
2 parents 303163a + f92b60f commit e921fa0

3 files changed

Lines changed: 33 additions & 40 deletions

File tree

File renamed without changes.

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The following command can install the IBM Developer tools in a single invocation
1717
$ curl -sL https://ibm.biz/idt-installer | bash
1818
```
1919

20-
By default, this installer will use the 'brew' installer, if available. If you do not have `brew` available on your system, execute the following command with `--nobrew` option:
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:
2121

2222
```
2323
curl -sL https://ibm.biz/idt-installer | bash -s -- --nobrew
@@ -49,4 +49,17 @@ Access the [Widnows-specific readme](./windows-installer/README.md) for addition
4949

5050
## Feedback
5151

52-
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).
52+
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).
53+
54+
55+
## Internal IBM users
56+
57+
IBM user can utilize this installer pulling the Bluemix cLI and plugins from pre-release internal servers. In order to have the installer utilize internal servers, set the following environment variables (eg in `~/.bashrc`), using the proper actual values:
58+
59+
```
60+
export IDT_INSTALL_BMX_URL="https://clis.<internal_bluemix_staging_url>/install"
61+
export IDT_INSTALL_BMX_REPO_NAME="stage"
62+
export IDT_INSTALL_BMX_REPO_URL="https://plugins.<internal_bluemix_staging_url>"
63+
```
64+
65+
If you need assistance on the proper values, just ask in any of the internal slack channels.

linux-installer/idt-installer

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

10-
VERSION="0.6"
10+
VERSION="0.7"
1111
PROG="IBM Developer Tools - Installer"
1212
INSTALLER_URL="https://ibm.biz/idt-installer"
1313
GIT_URL="https://github.com/ibm-cloud-tools/idt-installer"
1414
SLACK_URL="https://ibm.biz/IBMCloudNativeSlack"
15+
IDT_INSTALL_BMX_URL="${IDT_INSTALL_BMX_URL:=https://clis.ng.bluemix.net/install}"
16+
IDT_INSTALL_BMX_REPO_NAME="${IDT_INSTALL_BMX_REPO_NAME:=Bluemix}"
17+
IDT_INSTALL_BMX_REPO_URL="${IDT_INSTALL_BMX_REPO_URL:=https://plugins.ng.bluemix.net}"
1518

1619
#-- External programs, format is "binary, curl, install url"
1720
EXT_PROGS=(
@@ -172,12 +175,12 @@ function install_deps {
172175
if [[ "$PLATFORM" == "Darwin" && "$USEBREW" == true ]]; then
173176
brew install "$prog_brew"
174177
log "You should review any setup requirements for '${prog_bin}' from: ${prog_url}"
175-
elif [[ "$PLATFORM" != "Windows" && "$prog_bin" == "kubectl" ]]; then
178+
elif [[ "$prog_bin" == "kubectl" ]]; then
176179
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
177180
chmod +x ./kubectl
178181
sudo mv ./kubectl /usr/local/bin/kubectl
179182
log "Review any setup requirements for '${prog_bin}' from: ${prog_url}"
180-
elif [[ "$PLATFORM" != "Windows" && "$prog_bin" == "helm" ]]; then
183+
elif [[ "$prog_bin" == "helm" ]]; then
181184
curl -sL https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
182185
log "Review any setup requirements for '${prog_bin}' from: ${prog_url}"
183186
else
@@ -195,45 +198,21 @@ function install_deps {
195198
#------------------------------------------------------------------------------
196199
function install_bx {
197200
if [[ -z "$(which bluemix)" ]]; then
198-
log "Installing IBM Cloud 'Bluemix' CLI..."
199-
log "Finding latest version of Bluemix CLI for platform '${PLATFORM}'..."
200-
url="http://public.dhe.ibm.com/cloud/bluemix/cli/bluemix-cli/"
201-
#MacOS: Bluemix_CLI_0.4.6.pkg
202-
#Linux: Bluemix_CLI_0.4.6_amd64.tar.gz
203-
#Win: Bluemix_CLI_0.4.6_amd64.exe
201+
log "Installing IBM Cloud 'Bluemix' CLI for platform '${PLATFORM}'..."
204202
case "$PLATFORM" in
205203
"Darwin")
206204
if [[ "$USEBREW" == true ]]; then
207205
brew cask reinstall "caskroom/cask/bluemix-cli"
208206
else
209-
latest=$(curl -s ${url} | grep "Bluemix_CLI_.*\.pkg" | sort | tail -1 | sed 's/^.*\(Bluemix_CLI_.*\.pkg\).*$/\1/')
210-
log "Pulling down instance: ${latest}"
211-
curl --progress-bar "${url}${latest}" > "${TMPDIR}/${latest}"
212-
log "Running installer on: ${latest}"
213-
sudo installer -pkg "${TMPDIR}/${latest}" -target /
207+
log "Downloading and installing Bluemix CLI from: ${IDT_INSTALL_BMX_URL}/osx"
208+
sh <(curl -fsSL ${IDT_INSTALL_BMX_URL}/osx)
214209
fi
215210
;;
216211
"Linux")
217-
latest=$(curl -s ${url} | grep "Bluemix_CLI_[0-9]\.[0-9]\.[0-9]_amd64.tar.gz" | sort | tail -1 | sed 's/^.*\(Bluemix_CLI_.*_amd64\.tar\.gz\).*$/\1/')
218-
log "Pulling down instance: ${latest}"
219-
curl --progress-bar "${url}${latest}" > "${TMPDIR}/${latest}"
220-
log "Running installer on: ${latest}"
221-
cd "${TMPDIR}" || exit
222-
tar xvfz "./${latest}"
223-
sudo Bluemix_CLI/install_bluemix_cli
224-
rm -rf Bluemix_CLI
225-
cd - || exit
226-
;;
227-
"Windows")
228-
latest=$(curl -s ${url} | grep "Bluemix_CLI_[0-9]\.[0-9]\.[0-9]_amd64.exe" | sort | tail -1 | sed 's/^.*\(Bluemix_CLI_.*_amd64\.exe\).*$/\1/')
229-
log "Pulling down instance: ${latest}"
230-
curl --progress-bar "${url}${latest}" > "${TMPDIR}/${latest}"
231-
log "Calling Windows installer..."
232-
"${TMPDIR}/${latest}"
212+
log "Downloading and installing Bluemix CLI from: ${IDT_INSTALL_BMX_URL}/linux"
213+
sh <(curl -fsSL ${IDT_INSTALL_BMX_URL}/linux)
233214
;;
234215
esac
235-
rm -f "${TMPDIR}/${latest}" 2>/dev/null
236-
237216
log "IBM Cloud CLI install finished."
238217
else #-- Upgrade
239218
log "Updating exisitng IBM Cloud CLI..."
@@ -246,15 +225,19 @@ function install_bx {
246225
#------------------------------------------------------------------------------
247226
function install_plugins {
248227
log "Installaing / updating required plugins..."
228+
if [[ -z "$(bx plugin repos | grep ${IDT_INSTALL_BMX_REPO_NAME})" ]]; then
229+
log "Adding repo definition for: ${IDT_INSTALL_BMX_REPO_NAME} >> ${IDT_INSTALL_BMX_REPO_URL}"
230+
bx plugin repo-add "${IDT_INSTALL_BMX_REPO_NAME}" "${IDT_INSTALL_BMX_REPO_URL}"
231+
fi
249232
for plugin in "${PLUGINS[@]}"; do
250233
log "Checking status of plugin: ${plugin}"
251234
read -r p ver <<< "$(bx plugin list | grep "^${plugin} ")"
252235
if [[ -z "$p" ]]; then
253236
log "Installing plugin '$plugin'"
254-
bx plugin install -r Bluemix "$plugin"
237+
bx plugin install -r "${IDT_INSTALL_BMX_REPO_NAME}" "$plugin"
255238
else
256239
log "Attempting to update plugin '$plugin' from version '$ver'"
257-
bx plugin update -r Bluemix "$plugin"
240+
bx plugin update -r "${IDT_INSTALL_BMX_REPO_NAME}" "$plugin"
258241
fi
259242
done
260243
log "Running 'bx plugin list'..."
@@ -350,13 +333,10 @@ function main {
350333
"Linux")
351334
warn "Linux has only been tested on Ubuntu, please let us know if you use this utility on other Distros"
352335
;;
353-
# "Windows")
354-
# warn "Windows has not been tested AT ALL! Please send all errors to author."
355-
# ;;
356336
*)
357337
warn "Only MacOS and Linux systems are supported by this installer."
358338
warn "For Windows, please follow manual installation instructions at:"
359-
warn "https://console.stage1.ng.bluemix.net/docs/cloudnative/dev_cli.html#developercli"
339+
warn "https://github.com/IBM-Bluemix/developer-tools-installer"
360340
error "Unsupported platform: ${PLATFORM}"
361341
;;
362342
esac

0 commit comments

Comments
 (0)