1### Jenkins setup
2<img src="https://s3.us-east-2.amazonaws.com/kepler-images/warrensbox/tfswitch/jenkins_tfswitch.png" alt="drawing" style="width: 370px;"/>
3
4```sh
5#!/bin/bash
6
7echo "Installing tfswitch locally"
8wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh  #Get the installer on to your machine
9
10chmod 755 install.sh #Make installer executable
11
12./install.sh -b `pwd`/.bin      #Install tfswitch in a location you have permission
13
14CUSTOMBIN=`pwd`/.bin            #set custom bin path
15
16export PATH=$PATH:$CUSTOMBIN    #Add custom bin path to PATH environment
17
18$CUSTOMBIN/tfswitch -b $CUSTOMBIN/terraform 0.11.7 #or simply tfswitch -b $CUSTOMBIN/terraform 0.11.7
19
20terraform -v                    #testing version
21```
22
23### Circle CI setup
24
25<img src="https://s3.us-east-2.amazonaws.com/kepler-images/warrensbox/tfswitch/circleci_tfswitch.png" alt="drawing" style="width: 470px;"/>
26
27
28Example config yaml
29```yaml
30version: 2
31jobs:
32  build:
33    docker:
34      - image: ubuntu
35
36    working_directory: /go/src/github.com/warrensbox/terraform-switcher
37
38    steps:
39      - checkout
40      - run:
41          command: |
42            set +e
43            apt-get update
44            apt-get install -y wget
45            rm -rf /var/lib/apt/lists/*
46
47            echo "Installing tfswitch locally"
48
49            wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh  #Get the installer on to your machine
50
51            chmod 755 install.sh            #Make installer executable
52
53            ./install.sh -b `pwd`/.bin      #Install tfswitch in a location you have permission
54
55            CUSTOMBIN=`pwd`/.bin            #set custom bin path
56
57            export PATH=$PATH:$CUSTOMBIN    #Add custom bin path to PATH environment
58
59            $CUSTOMBIN/tfswitch -b $CUSTOMBIN/terraform 0.11.7 #or simply tfswitch -b $CUSTOMBIN/terraform 0.11.7
60
61            terraform -v                    #testing version
62```