Skip to content

Commit

Permalink
Merge pull request #67 from warrensbox/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
warrensbox committed Mar 5, 2020
2 parents d0fa44b + a48dd4d commit d747848
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 97 deletions.
82 changes: 17 additions & 65 deletions .circleci/config.yml
Expand Up @@ -9,101 +9,53 @@ jobs:

working_directory: /go/src/github.com/warrensbox/terraform-switcher

steps:
- checkout
- run: go get -v -t -d ./...
- run: go vet -tests=false ./...
- run: go test -v ./...
- run: mkdir -p build
- run: go build -v -o build/tfswitch

- persist_to_workspace:
root: build
paths: tfswitch

test-ubuntu:
docker:
- image: "circleci/ubuntu-server"

steps:

- run: ls

- attach_workspace:
at: build

test-alpine:
docker:
- image: "mhart/alpine-node"

steps:
- run: ls

develop-master:
docker:
- image: warrensbox/go-rb-py-aws

steps:
- checkout
- run:
command: |
echo "Placeholder"
# cd docs; bundle install --path vendor/bundler; bundle exec jekyll build -c _config.yml; cd ..
# git config user.email "warren.veerasingam@gmail.com"
# git config user.name "warrensbox"
# git add .
# git commit -m "Release Version"
# git push origin ${RELEASE_VERSION}
command: |
set +e
go get -v -t -d ./...
go vet -tests=false ./...
go test -v ./...
mkdir -p build
go build -v -o build/tfswitch
release:
docker:
- image: warrensbox/go-rb-py-aws
- image: circleci/golang:1.11

working_directory: /go/src/github.com/warrensbox/terraform-switcher

steps:
- checkout
- run:
command: |
set +e
set +e
source version
export RELEASE_VERSION;
RELEASE_VERSION=$RELEASE_VERSION.${CIRCLE_BUILD_NUM}
export RELEASE_VERSION;
echo $RELEASE_VERSION
go get -v -t -d ./...
mkdir -p /home/circleci/bin
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
export PATH="/home/warrensbox/bin:${PATH}"
rm -rf dist
git config user.email "warren.veerasingam@gmail.com"
git config user.name "warrensbox"
git tag -a ${RELEASE_VERSION} -m "Release Version"
git push origin ${RELEASE_VERSION}
curl -L https://git.io/goreleaser | VERSION=v0.76.1 bash
curl -L https://git.io/goreleaser | VERSION=v0.99.0 bash -s -- --rm-dist
cd docs; bundle install --path vendor/bundler; bundle exec jekyll build -c _config.yml; cd ..
workflows:
version: 2

build_and_test:
jobs:
- build
- test-ubuntu:
requires:
- build
- test-alpine:
requires:
- build
- develop-master:
requires:
- test-ubuntu
- test-alpine
filters:
branches:
only:
- master
- release
- release:
requires:
- develop-master
- build
filters:
branches:
only:
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Expand Up @@ -31,3 +31,8 @@ test: $(EXE)
.PHONEY: dep
dep:
dep ensure

.PHONY: docs
docs:
cd docs; bundle install --path vendor/bundler; bundle exec jekyll build -c _config.yml; cd ..

18 changes: 16 additions & 2 deletions README.md
Expand Up @@ -89,12 +89,12 @@ version = "0.11.3"
2. For example, `echo "0.10.5" >> .tfswitchrc` for version 0.10.5 of terraform
3. Run the command `tfswitch` in the same directory as your `.tfswitchrc`

*instead of a `.tfswitchrc` file, a `.terraform-version` file may be used for compatibility with [`tfenv`](https://github.com/tfutils/tfenv#terraform-version-file) and other tools which use it*
*Instead of a `.tfswitchrc` file, a `.terraform-version` file may be used for compatibility with [`tfenv`](https://github.com/tfutils/tfenv#terraform-version-file) and other tools which use it*

**Automatically switch with bash**

Add the following to the end of your `~/.bashrc` file:
(Use either `.tfswitchrc` or `.tfswitch.toml`)
(Use either `.tfswitchrc` or `.tfswitch.toml` or `.terraform-version`)

```
cdtfswitch(){
Expand Down Expand Up @@ -138,6 +138,20 @@ cd(){
}
```

### Jenkins setup
<img src="https://s3.us-east-2.amazonaws.com/kepler-images/warrensbox/tfswitch/jenkins_tfswitch.png" alt="drawing" style="width: 170px;"/>

```
#!/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
./bin-directory/tfswitch
```

## Additional Info

See how to *upgrade*, *uninstall*, *troubleshoot* here: [More info](https://warrensbox.github.io/terraform-switcher/additional)
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/additional.html
Expand Up @@ -23,7 +23,7 @@
{"description":"Manage terraform versions - the tfswitch command line tool lets you switch between different versions of terraform","@type":"WebPage","url":"/additional.html","publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"/assets/img/logo.png"}},"headline":"tfswitch","@context":"http://schema.org"}</script>
<!-- End Jekyll SEO tag -->

<link rel="stylesheet" href="/assets/css/style.css?v=45af5d166a97ba6db56ba31181768391887b4abd">
<link rel="stylesheet" href="/assets/css/style.css?v=0b7be9932efc2fc12b75f7de015e535bb13fda26">
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<![endif]-->
Expand Down
19 changes: 17 additions & 2 deletions docs/_site/index.html
Expand Up @@ -23,7 +23,7 @@
{"name":"tfswitch","description":"Manage terraform versions - the tfswitch command line tool lets you switch between different versions of terraform","@type":"WebSite","url":"/","publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"/assets/img/logo.png"}},"headline":"Terraform Switcher","@context":"http://schema.org"}</script>
<!-- End Jekyll SEO tag -->

<link rel="stylesheet" href="/assets/css/style.css?v=45af5d166a97ba6db56ba31181768391887b4abd">
<link rel="stylesheet" href="/assets/css/style.css?v=0b7be9932efc2fc12b75f7de015e535bb13fda26">
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<![endif]-->
Expand Down Expand Up @@ -162,10 +162,12 @@ <h3 id="use-tfswitchrc-file">Use .tfswitchrc file</h3>
<li>Run the command <code class="highlighter-rouge">tfswitch</code> in the same directory as your <code class="highlighter-rouge">.tfswitchrc</code>.</li>
</ol>

<p><em>Instead of a <code class="highlighter-rouge">.tfswitchrc</code> file, a <code class="highlighter-rouge">.terraform-version</code> file may be used for compatibility with <a href="https://github.com/tfutils/tfenv#terraform-version-file"><code class="highlighter-rouge">tfenv</code></a> and other tools which use it</em></p>

<p><strong>Automatically switch with bash</strong></p>

<p>Add the following to the end of your <code class="highlighter-rouge">~/.bashrc</code> file:
(Use either <code class="highlighter-rouge">.tfswitchrc</code> or <code class="highlighter-rouge">.tfswitch.toml</code>)</p>
(Use either <code class="highlighter-rouge">.tfswitchrc</code> or <code class="highlighter-rouge">.tfswitch.toml</code> or <code class="highlighter-rouge">.terraform-version</code>)</p>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cdtfswitch(){
builtin cd "$@";
Expand Down Expand Up @@ -207,6 +209,19 @@ <h3 id="use-tfswitchrc-file">Use .tfswitchrc file</h3>
}
</code></pre></div></div>

<h3 id="jenkins-setup">Jenkins setup</h3>
<p><img src="https://s3.us-east-2.amazonaws.com/kepler-images/warrensbox/tfswitch/jenkins_tfswitch.png" alt="drawing" style="width: 170px;" /></p>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash </span>

<span class="nb">echo</span> <span class="s2">"Installing tfswitch locally"</span>
wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
./install.sh <span class="nt">-b</span> bin-directory

./bin-directory/tfswitch
</code></pre></div></div>

<hr />

<h2 id="issues">Issues</h2>
Expand Down
17 changes: 16 additions & 1 deletion docs/_site/index.md
Expand Up @@ -82,11 +82,12 @@ version = "0.11.3"
2. For example, `echo "0.10.5" >> .tfswitchrc` for version 0.10.5 of terraform.
3. Run the command `tfswitch` in the same directory as your `.tfswitchrc`.

*Instead of a `.tfswitchrc` file, a `.terraform-version` file may be used for compatibility with [`tfenv`](https://github.com/tfutils/tfenv#terraform-version-file) and other tools which use it*

**Automatically switch with bash**

Add the following to the end of your `~/.bashrc` file:
(Use either `.tfswitchrc` or `.tfswitch.toml`)
(Use either `.tfswitchrc` or `.tfswitch.toml` or `.terraform-version`)

```
cdtfswitch(){
Expand Down Expand Up @@ -130,6 +131,20 @@ cd(){
}
```

### Jenkins setup
<img src="https://s3.us-east-2.amazonaws.com/kepler-images/warrensbox/tfswitch/jenkins_tfswitch.png" alt="drawing" style="width: 170px;"/>

```
#!/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
./bin-directory/tfswitch
```

<hr>

## Issues
Expand Down
17 changes: 16 additions & 1 deletion docs/index.md
Expand Up @@ -82,11 +82,12 @@ version = "0.11.3"
2. For example, `echo "0.10.5" >> .tfswitchrc` for version 0.10.5 of terraform.
3. Run the command `tfswitch` in the same directory as your `.tfswitchrc`.

*Instead of a `.tfswitchrc` file, a `.terraform-version` file may be used for compatibility with [`tfenv`](https://github.com/tfutils/tfenv#terraform-version-file) and other tools which use it*

**Automatically switch with bash**

Add the following to the end of your `~/.bashrc` file:
(Use either `.tfswitchrc` or `.tfswitch.toml`)
(Use either `.tfswitchrc` or `.tfswitch.toml` or `.terraform-version`)

```
cdtfswitch(){
Expand Down Expand Up @@ -130,6 +131,20 @@ cd(){
}
```

### Jenkins setup
<img src="https://s3.us-east-2.amazonaws.com/kepler-images/warrensbox/tfswitch/jenkins_tfswitch.png" alt="drawing" style="width: 170px;"/>

```
#!/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
./bin-directory/tfswitch
```

<hr>

## Issues
Expand Down

0 comments on commit d747848

Please sign in to comment.