github.com/GoogleCloudPlatform/terraformer@v0.8.18/snap/snapcraft.yaml (about) 1 name: terraformer 2 summary: CLI tool. 3 description:| CLI tool to generate terraform files from existing infrastructure (reverse Terraform). 4 5 adopt-info:terraformer 6 7 grade: stable 8 confinement: strict 9 10 architectures: 11 - build-on: amd64 12 - build-on: armhf 13 - build-on: arm64 14 15 apps: 16 terraformer: 17 command: bin/terraformer 18 plugs: 19 - home 20 - network 21 - removable-media 22 23 parts: 24 terraformer: 25 plugin: nil 26 source: https://github.com/GoogleCloudPlatform/terraformer.git 27 source-type: git 28 override-pull: | 29 git clone https://github.com/GoogleCloudPlatform/terraformer.git src/github.com/GoogleCloudPlatform/terraformer 30 cd src/github.com/GoogleCloudPlatform/terraformer 31 last_committed_tag="$(git describe --tags --abbrev=0)" 32 last_committed_tag_ver="$(echo ${last_committed_tag} | sed 's/v//')" 33 last_released_tag="$(snap info $SNAPCRAFT_PROJECT_NAME | awk '$1 == "beta:" { print $2 }')" 34 # If the latest tag from the upstream project has not been released to 35 # beta, build that tag instead of master. 36 if [ "${last_committed_tag_ver}" != "${last_released_tag}" ]; then 37 git fetch 38 git checkout "${last_committed_tag}" 39 fi 40 snapcraftctl set-version "$(git describe --tags | sed 's/v//')" 41 override-build: | 42 export GOPATH=$PWD 43 cd src/github.com/GoogleCloudPlatform/terraformer 44 env CGO_ENABLED=0 GOOS=linux \ 45 go build --ldflags "-s -w \ 46 -X 'github.com/GoogleCloudPlatform/terraformer/version.GitCommit=$(git rev-list -1 HEAD)' \ 47 -X 'github.com/GoogleCloudPlatform/terraformer/version.Version=$(git describe --tags --abbrev=0)'" \ 48 -a -installsuffix cgo -o $SNAPCRAFT_PART_INSTALL/bin/terraformer 49 build-snaps: 50 - go 51 build-packages: 52 - git 53 - sed 54