You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2019/04/06 16:34:39 UTC
[cloudstack-cloudmonkey] branch master updated: snapcraft: update
with customised go binary building
This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git
The following commit(s) were added to refs/heads/master by this push:
new 9857760 snapcraft: update with customised go binary building
9857760 is described below
commit 9857760815c8af526e10713dcc3a2808408e17ba
Author: Rohit Yadav <ro...@shapeblue.com>
AuthorDate: Sat Apr 6 22:04:12 2019 +0530
snapcraft: update with customised go binary building
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
---
snap/snapcraft.yaml | 34 +++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index c9bc358..b059383 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -1,37 +1,41 @@
name: cloudmonkey
-base: core18
version: git
summary: Apache CloudStack CLI
description: |
An CLI and interactive shell that simplifies configuration and management of
Apache CloudStack, the opensource IAAS cloud computing platform.
-
+license: Apache-2.0
grade: stable
confinement: strict
-license: Apache-2.0
-
apps:
cloudmonkey:
- command: bin/cloudstack-cloudmonkey
+ command: bin/cmk
plugs:
- home
- network
- #- personal-files
-
-#plugs:
-# network:
-# personal-files:
-# read:
-# - $HOME/.cmk
-# write:
-# - $HOME/.cmk
parts:
+ go:
+ source-tag: go1.12.1
cloudmonkey:
- source: .
+ after: [go]
+ source: https://github.com/apache/cloudstack-cloudmonkey
source-type: git
+ source-tag: 6.0.0
plugin: go
go-importpath: github.com/apache/cloudstack-cloudmonkey
build-packages:
- gcc
+ - make
+ - file
+ override-build: |
+ set -eu
+ go version
+ GIT_SHA=$(git rev-parse --short HEAD)
+ DATE=$(date +%FT%T%z)
+ go build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o cmk cmk.go
+ file cmk
+ mkdir -p $SNAPCRAFT_PART_INSTALL/bin
+ mv cmk $SNAPCRAFT_PART_INSTALL/bin/
+ strip --remove-section=.comment --remove-section=.note $SNAPCRAFT_PART_INSTALL/bin/cmk