Skip to content

Commit

Permalink
added custom bin option
Browse files Browse the repository at this point in the history
  • Loading branch information
warrensbox committed Sep 18, 2020
1 parent 0b99697 commit 8e5d827
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 26 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ Installation for other linux operation systems.
curl -L https://github.com/raw/warrensbox/terraform-switcher/release/install.sh | bash
```

### Snap for CentOS, Ubuntu, Linux Mint, RHEL, Debian, Fedora
### Snapcraft for CentOS, Ubuntu, Linux Mint, RHEL, Debian, Fedora

```sh
snap install --edge tfswitch
sudo snap install tfswitch
```


Expand Down Expand Up @@ -167,9 +167,9 @@ cd(){
echo "Installing tfswitch locally"
wget https://github.com/raw/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh -b bin-directory
./install.sh -b `pwd`/.bin

./bin-directory/tfswitch
`pwd`/.bin/tfswitch
```

If you have limited permission, try:
Expand All @@ -180,13 +180,13 @@ If you have limited permission, try:
echo "Installing tfswitch locally"
wget https://github.com/raw/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh -b bin-directory
./install.sh -b `pwd`/.bin

CUSTOMBIN=`pwd`/bin #set custom bin path
CUSTOMBIN=`pwd`/.bin #set custom bin path
mkdir $CUSTOMBIN #create custom bin path
export PATH=$PATH:$CUSTOMBIN #Add custom bin path to PATH environment

./bin-directory/tfswitch -b $CUSTOMBIN/terraform 0.11.7
`pwd`/.bin/tfswitch -b $CUSTOMBIN/terraform 0.11.7

terraform -v #testing version
```
Expand Down Expand Up @@ -219,13 +219,13 @@ jobs:
wget https://github.com/raw/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh -b bin-directory
./install.sh -b $HOME/.bin
CUSTOMBIN=$HOME/.bin #set custom bin path
CUSTOMBIN=`pwd`/bin #set custom bin path
mkdir $CUSTOMBIN #create custom bin path
export PATH=$PATH:$CUSTOMBIN #Add custom bin path to PATH environment
./bin-directory/tfswitch -b $CUSTOMBIN/terraform 0.11.7
$CUSTOMBIN/tfswitch -b $CUSTOMBIN/terraform 0.11.7 #or simply tfswitch -b $CUSTOMBIN/terraform 0.11.7
terraform -v #testing version
```
Expand Down
21 changes: 11 additions & 10 deletions www/docs/Continuous-Integration.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
### Jenkins setup
<img src="https://s3.us-east-2.amazonaws.com/kepler-images/warrensbox/tfswitch/jenkins_tfswitch.png" alt="drawing" style="width: 370px;"/>
<img src="https://s3.us-east-2.amazonaws.com/kepler-images/warrensbox/tfswitch/jenkins_tfswitch.png" alt="drawing" style="width: 170px;"/>

```sh
#!/bin/bash

echo "Installing tfswitch locally"
wget https://github.com/raw/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh -b bin-directory
./install.sh -b `pwd`/.bin

./bin-directory/tfswitch
`pwd`/.bin/tfswitch
```

If you have limited permission, try:

```sh
Expand All @@ -19,13 +20,13 @@ If you have limited permission, try:
echo "Installing tfswitch locally"
wget https://github.com/raw/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh -b bin-directory
./install.sh -b `pwd`/.bin

CUSTOMBIN=`pwd`/bin #set custom bin path
CUSTOMBIN=`pwd`/.bin #set custom bin path
mkdir $CUSTOMBIN #create custom bin path
export PATH=$PATH:$CUSTOMBIN #Add custom bin path to PATH environment

./bin-directory/tfswitch -b $CUSTOMBIN/terraform 0.11.7
`pwd`/.bin/tfswitch -b $CUSTOMBIN/terraform 0.11.7

terraform -v #testing version
```
Expand Down Expand Up @@ -58,13 +59,13 @@ jobs:
wget https://github.com/raw/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh -b bin-directory
./install.sh -b $HOME/.bin
CUSTOMBIN=$HOME/.bin #set custom bin path
CUSTOMBIN=`pwd`/bin #set custom bin path
mkdir $CUSTOMBIN #create custom bin path
export PATH=$PATH:$CUSTOMBIN #Add custom bin path to PATH environment
./bin-directory/tfswitch -b $CUSTOMBIN/terraform 0.11.7
$CUSTOMBIN/tfswitch -b $CUSTOMBIN/terraform 0.11.7 #or simply tfswitch -b $CUSTOMBIN/terraform 0.11.7
terraform -v #testing version
```
31 changes: 26 additions & 5 deletions www/docs/Troubleshoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,35 @@ Solution: You probably need to have privileges to install *tfswitch* at /usr/loc
Try the following:
```sh
wget https://github.com/raw/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh -b bin-directory
wget https://github.com/raw/warrensbox/terraform-switcher/release/install.sh #Get the installer on to your machine:
chmod 755 install.sh #Make installer executable
./install.sh -b $HOME/.bin #Install tfswitch in a location you have permission:
$HOME/.bin/tfswitch #test
export PATH=$PATH:$HOME/.bin #Export your .bin into your path
#You should probably add step 4 in your `.bash_profile` in your $HOME directory.
#Next, try:
`tfswitch -b $HOME/.bin/terraform 0.11.7`
#or simply
`tfswitch -b $HOME/.bin/terraform`
./bin-directory/tfswitch
```
Or, use the custom directory option `-b`:
See the custom directory option `-b`:
<img src="https://s3.us-east-2.amazonaws.com/kepler-images/warrensbox/tfswitch/tfswitch-v7.gif" alt="drawing" style="width: 670px;"/>
```sh
wget https://github.com/raw/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh -b $HOME/.bin
$HOME/.bin/tfswitch
```

0 comments on commit 8e5d827

Please sign in to comment.