Skip to content

Commit

Permalink
Merge pull request #105 from warrensbox/feature/add-snapcraft-yml
Browse files Browse the repository at this point in the history
Feature/add snapcraft yml
  • Loading branch information
warrensbox authored Sep 18, 2020
2 parents 7aae449 + 266b3be commit f993328
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 42 deletions.
41 changes: 26 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,21 @@ Installation for MacOS is the easiest with Homebrew. [If you do not have homebre
brew install warrensbox/tap/tfswitch
```

### Linux
### General Linux

Installation for other linux operation systems.

```sh
curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash
```

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

```sh
sudo snap install tfswitch
```


### Install from source

Alternatively, you can install the binary from source [here](https://github.com/warrensbox/terraform-switcher/releases)
Expand Down Expand Up @@ -160,9 +167,9 @@ cd(){
echo "Installing tfswitch locally"
wget https://raw.githubusercontent.com/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 @@ -171,15 +178,17 @@ If you have limited permission, try:
#!/bin/bash

echo "Installing tfswitch locally"
wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh -b bin-directory
wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh #Get the installer on to your machine

chmod 755 install.sh #Make installer executable

./install.sh -b `pwd`/.bin #Install tfswitch in a location you have permission

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
$CUSTOMBIN/tfswitch -b $CUSTOMBIN/terraform 0.11.7 #or simply tfswitch -b $CUSTOMBIN/terraform 0.11.7

terraform -v #testing version
```
Expand Down Expand Up @@ -210,15 +219,17 @@ jobs:
echo "Installing tfswitch locally"
wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh -b bin-directory
wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh #Get the installer on to your machine
chmod 755 install.sh #Make installer executable
./install.sh -b `pwd`/.bin #Install tfswitch in a location you have permission
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
$CUSTOMBIN/tfswitch -b $CUSTOMBIN/terraform 0.11.7 #or simply tfswitch -b $CUSTOMBIN/terraform 0.11.7
terraform -v #testing version
```
Expand Down
1 change: 0 additions & 1 deletion snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ description: |
Once installed, simply select the version you require from the dropdown and start using terraform.
architectures:
- build-on: arm64
- build-on: amd64
assumes: [snapd2.45]
base: core18

Expand Down
34 changes: 13 additions & 21 deletions www/docs/Continuous-Integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,17 @@
#!/bin/bash

echo "Installing tfswitch locally"
wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh -b bin-directory
wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh #Get the installer on to your machine

./bin-directory/tfswitch
```
If you have limited permission, try:
chmod 755 install.sh #Make installer executable

```sh
#!/bin/bash
./install.sh -b `pwd`/.bin #Install tfswitch in a location you have permission

echo "Installing tfswitch locally"
wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh -b bin-directory
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
$CUSTOMBIN/tfswitch -b $CUSTOMBIN/terraform 0.11.7 #or simply tfswitch -b $CUSTOMBIN/terraform 0.11.7

terraform -v #testing version
```
Expand Down Expand Up @@ -56,15 +46,17 @@ jobs:
echo "Installing tfswitch locally"
wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh -b bin-directory
wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh #Get the installer on to your machine
chmod 755 install.sh #Make installer executable
./install.sh -b `pwd`/.bin #Install tfswitch in a location you have permission
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
$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://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh -b bin-directory
wget https://raw.githubusercontent.com/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://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh -b $HOME/.bin
$HOME/.bin/tfswitch
```

0 comments on commit f993328

Please sign in to comment.