forked from warrensbox/terraform-switcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
snapcraft.yaml
45 lines (41 loc) · 1.38 KB
/
snapcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: tfswitch
version: '0.12.04'
summary: A command line tool to switch between different versions of terraform
description: |
The `tfswitch` command line tool lets you switch between different versions of terraform(https://www.terraform.io/).
If you do not have a particular version of terraform installed, `tfswitch` will download the version you desire.
The installation is minimal and easy.
Once installed, simply select the version you require from the dropdown and start using terraform.
architectures:
- build-on: [amd64,arm64]
run-on: [amd64,arm64]
assumes: [snapd2.45]
base: core18
grade: stable
confinement: strict
# plugs: //need snapcraft to make this work
# home-bin:
# interface: personal-files
# read:
# - $HOME/bin
# write:
# - $HOME/bin
apps:
tfswitch:
command: bin/tfswitch
plugs:
- home
- network
- network-bind
# - home-bin //need snapcraft to make this work
parts:
tfswitch:
source: .
plugin: go
go-importpath: github.com/warrensbox/terraform-switcher
build-packages: [gcc, g++, make]
go-buildtags:
- tfswitch
override-build:
VER=$(git ls-remote --tags git://github.com/warrensbox/terraform-switcher | awk '{print $2}'| awk -F"/" '{print $3}' | sort -n -t. -k1,1 -k2,2 -k3,3 | tail -n 2 | head -n1)
go build -v -ldflags "-X main.version=0.10.1010" -o ../install/bin/tfswitch