This repository has been archived by the owner on Nov 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from nanliu/pluginsync
Update from Intelsdi-x pluginsync 0.1.5
- Loading branch information
Showing
15 changed files
with
635 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!-- | ||
Thanks for filing an issue! Before hitting the button, give this a read. | ||
If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead. | ||
If you suspect your issue is a bug, please add as much context as you can using the template below. If it is not a bug, remove any sections you don't need and explain how we can help. | ||
As a basic rule, if you cannot provide enough information to continue addressing the issue within 7 days, a maintainer will close it. We will, however, reopen it if you later provide the information. Thanks again. | ||
--> | ||
|
||
**Snap version** (use `snapctl -v`): | ||
|
||
**Environment**: | ||
- **Cloud provider or hardware configuration**: | ||
- **OS** (e.g. from /etc/os-release): | ||
- **Kernel** (e.g. `uname -a`): | ||
- **Relevant tools** (e.g. plugins used with Snap): | ||
- **Others** (e.g. deploying with Ansible): | ||
|
||
|
||
**What happened**: | ||
|
||
|
||
**What you expected to happen**: | ||
|
||
|
||
**Steps to reproduce it** (as minimally and precisely as possible): | ||
|
||
1. | ||
2. | ||
3. | ||
|
||
|
||
**Anything else do we need to know** (e.g. issue happens only occasionally): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- | ||
If this is a bug fix, make sure your description includes "fixes #xxxx", or | ||
"closes #xxxx" | ||
Please provide the following information: | ||
--> | ||
Fixes # | ||
|
||
Summary of changes: | ||
- | ||
- | ||
- | ||
|
||
How to verify it: | ||
- | ||
|
||
Testing done: | ||
- | ||
|
||
A picture of a snapping turtle (not required but encouraged): | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# File managed by pluginsync | ||
# | ||
# NOTE: please commit OS/Editor specific settings in your .gitignore_global | ||
# .idea | ||
# .DS_Store | ||
# | ||
# Compiled Object files, Static and Dynamic libs (Shared Objects) | ||
*.o | ||
*.a | ||
*.so | ||
|
||
# Folders | ||
_obj | ||
_test | ||
|
||
# Architecture specific extensions/prefixes | ||
*.[568vq] | ||
[568vq].out | ||
|
||
*.cgo1.go | ||
*.cgo2.c | ||
_cgo_defun.c | ||
_cgo_gotypes.go | ||
_cgo_export.* | ||
|
||
_testmain.go | ||
|
||
*.exe | ||
*.test | ||
*.prof | ||
|
||
# Output of the go coverage tool | ||
*.out | ||
profile.cov | ||
|
||
# we don't vendor godep _workspace | ||
**/Godeps/_workspace/** | ||
vendor/ | ||
|
||
# ignore build artifacts | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
pluginsync_config: '0.1.5' | ||
managed_files: | ||
- .github | ||
- .github/ISSUE_TEMPLATE.md | ||
- .github/PULL_REQUEST_TEMPLATE.md | ||
- .gitignore | ||
- .pluginsync.yml | ||
- .travis.yml | ||
- CONTRIBUTING.md | ||
- LICENSE | ||
- Makefile | ||
- scripts | ||
- scripts/build.sh | ||
- scripts/common.sh | ||
- scripts/deps.sh | ||
- scripts/pre_deploy.sh | ||
- scripts/test.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.travis.yml: | ||
deploy: | ||
access_key_id: AKIAINMB43VSSPFZISAA | ||
secret_access_key: | ||
secure: ujIUxXac0/bXKPpcVKpoq0dWTRY4f2fTrZoaoMXwRt3JLK62BKAKvfqwAXa0OQhmLBLGblTsNWx4OgIV6iNiaQdZcqU6QkFNOHxWidq/GPlimRXfghZf0YU384kz0WOVTPWCgzTszKmjUve55dPCL8nsNKJI+TYsIAAmknld/hO+10tFjE0lMPb9MKz22J2rByWZoiXS7j254kfXBnWQZ/A4GR6gXoxFqUB8ESt5XVKcU3UoeYhDlSL62NcnmC6VRaFvGSw1ZHHbg0gv9z+bSxtZRARNWUKqeNraLBReJlHXi1NenWNKln2sIoV7o0W8WJCQMv5TVuPH94KHi5VG8ndlm35bQpjCcoZ2bx3CAkO+eFqnp73P9XG+MYFwPyst/PTKc0p4RrF6H0Lwnn9PHxTKnjMaK7YvBnCaeAJPSdNAPO0/VBwXCXKTg9xUFnmf1N3oZvI11WAfoGOrM32govVWR32cSp61K306hsUK2HQTFCsbqAAMRefyIo4t66C9+fv5hlj2Ajv7b865YkNGrNi+YevxVQtVgyrtazuqMYykFq+lLRGLkLp65K22Uf4WMuicAtJTi3Z57NRAtsUS/6zS6HX7Ww9mpdAE5RU/TeC7NKdMxQD3ZIBwg/jKFGGNPT4K3+3MWyNdyxxE/oPAWe3C6gHBBu5Cf2no7zhdB24= | ||
api_key: | ||
secure: cRaum5asJpZsKaOq0wPWGNMuQipJ8ga20pRK19ZwvYXfSXZnEl8fEJFlYNZQp5Ni93cqzW45x4j7qxv+LXDMkOQckKKKFRbfJQseHtCg8XSgG8OTURwwsICMK4GOXmARBKOBvXRzbiMrjVDhQCN5HXJcHnd6W98FkQymQ52xIlBkSknlpPkRiJC++GLksbZZ788wShTmuJHQMhnmBVmz41W5nc8fi+eNtPvkj98aMd2WSjbICv5ogZ3k0/Yztgeh9XDPqFlX+r2kYpy+8uLNhy9wBw4B1alXLAbgF1ml0bWVjEsIUGnYjRXAkxMr3+Rwdo/afhKgeav9kvjKd7Ihh3+lKEDYE6P6ToMkXjHvhzve87NFKNfogaGjRYDbZNxgLss/HkCW+9ghJjAwppT5oFfwxYC184YgpOcnEwH7gHWFcauDeKdGRUvt+TncbOigokUStcBVTHsoQnmECaXUw6XK2QRNx1H4xLhark2YQI9LbYfqgYtX1GS1JBzwB11MrANwS2e0+5GKqdJ/I5A9qA/8q24a5pr2fB6Z9/zV74gpTR7JTMcJTCoRVCm2QRYTSaoA83dR+jTDkDDTN4sgx9EK4YgkqoIdDUH4CsKQXcf+k4hlRwIzMymS5K3wTm7+ZF7Muy1XjoF9nlQR2EwMW7U2rWt/+PfWVZvMC8mlKn4= | ||
scripts/deps.sh: | ||
packages: | ||
- github.com/smartystreets/goconvey # NOTE: this should be moved to godep/glide | ||
- github.com/stretchr/testify/mock | ||
- github.com/gorilla/mux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,69 @@ | ||
sudo: required | ||
# File managed by pluginsync | ||
sudo: false | ||
language: go | ||
go: | ||
- 1.5.4 | ||
- 1.6.2 | ||
before_install: | ||
- go get github.com/tools/godep | ||
- if [ ! -d $SNAP_PLUGIN_SOURCE ]; then mkdir -p $HOME/gopath/src/github.com/intelsdi-x; ln -s $TRAVIS_BUILD_DIR $SNAP_PLUGIN_SOURCE; fi # CI for forks not from intelsdi-x | ||
- 1.6.3 | ||
- 1.7.1 | ||
env: | ||
global: | ||
- SNAP_PLUGIN_SOURCE=/home/travis/gopath/src/github.com/intelsdi-x/snap-plugin-collector-cinder | ||
- ORG_PATH=/home/travis/gopath/src/github.com/intelsdi-x | ||
- SNAP_PLUGIN_SOURCE=/home/travis/gopath/src/github.com/${TRAVIS_REPO_SLUG} | ||
matrix: | ||
- TEST=unit | ||
- TEST_TYPE=small | ||
- TEST_TYPE=build | ||
matrix: | ||
exclude: | ||
- go: 1.6.3 | ||
env: TEST_TYPE=build | ||
before_install: | ||
- "[[ -d $SNAP_PLUGIN_SOURCE ]] || mkdir -p $ORG_PATH && ln -s $TRAVIS_BUILD_DIR $SNAP_PLUGIN_SOURCE" | ||
install: | ||
- export TMPDIR=$HOME/tmp | ||
- mkdir -p $TMPDIR | ||
- cd $SNAP_PLUGIN_SOURCE # change dir into source | ||
- cd $SNAP_PLUGIN_SOURCE | ||
- make deps | ||
script: | ||
- make check TEST=$TEST 2>&1 # Run test suite | ||
- make check 2>&1 | ||
notifications: | ||
email: false | ||
slack: | ||
secure: VkbZLIc2RH8yf3PtIAxUNPdAu3rQQ7yQx0GcK124JhbEnZGaHyK615V0rbG7HcVmYKGPdB0cXqZiLBDKGqGKb2zR1NepOe1nF03jxGSpPq8jIFeEXSJGEYGL34ScDzZZGuG6qwbjFcXiW5lqn6t8igzp7v2+URYBaZo5ktCS2xY= | ||
before_deploy: | ||
- "./scripts/pre_deploy.sh" | ||
deploy: | ||
- provider: s3 | ||
access_key_id: AKIAINMB43VSSPFZISAA | ||
secret_access_key: | ||
secure: ujIUxXac0/bXKPpcVKpoq0dWTRY4f2fTrZoaoMXwRt3JLK62BKAKvfqwAXa0OQhmLBLGblTsNWx4OgIV6iNiaQdZcqU6QkFNOHxWidq/GPlimRXfghZf0YU384kz0WOVTPWCgzTszKmjUve55dPCL8nsNKJI+TYsIAAmknld/hO+10tFjE0lMPb9MKz22J2rByWZoiXS7j254kfXBnWQZ/A4GR6gXoxFqUB8ESt5XVKcU3UoeYhDlSL62NcnmC6VRaFvGSw1ZHHbg0gv9z+bSxtZRARNWUKqeNraLBReJlHXi1NenWNKln2sIoV7o0W8WJCQMv5TVuPH94KHi5VG8ndlm35bQpjCcoZ2bx3CAkO+eFqnp73P9XG+MYFwPyst/PTKc0p4RrF6H0Lwnn9PHxTKnjMaK7YvBnCaeAJPSdNAPO0/VBwXCXKTg9xUFnmf1N3oZvI11WAfoGOrM32govVWR32cSp61K306hsUK2HQTFCsbqAAMRefyIo4t66C9+fv5hlj2Ajv7b865YkNGrNi+YevxVQtVgyrtazuqMYykFq+lLRGLkLp65K22Uf4WMuicAtJTi3Z57NRAtsUS/6zS6HX7Ww9mpdAE5RU/TeC7NKdMxQD3ZIBwg/jKFGGNPT4K3+3MWyNdyxxE/oPAWe3C6gHBBu5Cf2no7zhdB24= | ||
bucket: snap.ci.snap-telemetry.io | ||
region: us-west-2 | ||
skip_cleanup: true | ||
local-dir: s3 | ||
upload-dir: plugins | ||
acl: public_read | ||
on: | ||
repo: intelsdi-x/snap-plugin-collector-cinder | ||
branch: master | ||
condition: $TEST_TYPE = "build" && $TRAVIS_GO_VERSION = "1.7.1" | ||
- provider: s3 | ||
access_key_id: AKIAINMB43VSSPFZISAA | ||
secret_access_key: | ||
secure: ujIUxXac0/bXKPpcVKpoq0dWTRY4f2fTrZoaoMXwRt3JLK62BKAKvfqwAXa0OQhmLBLGblTsNWx4OgIV6iNiaQdZcqU6QkFNOHxWidq/GPlimRXfghZf0YU384kz0WOVTPWCgzTszKmjUve55dPCL8nsNKJI+TYsIAAmknld/hO+10tFjE0lMPb9MKz22J2rByWZoiXS7j254kfXBnWQZ/A4GR6gXoxFqUB8ESt5XVKcU3UoeYhDlSL62NcnmC6VRaFvGSw1ZHHbg0gv9z+bSxtZRARNWUKqeNraLBReJlHXi1NenWNKln2sIoV7o0W8WJCQMv5TVuPH94KHi5VG8ndlm35bQpjCcoZ2bx3CAkO+eFqnp73P9XG+MYFwPyst/PTKc0p4RrF6H0Lwnn9PHxTKnjMaK7YvBnCaeAJPSdNAPO0/VBwXCXKTg9xUFnmf1N3oZvI11WAfoGOrM32govVWR32cSp61K306hsUK2HQTFCsbqAAMRefyIo4t66C9+fv5hlj2Ajv7b865YkNGrNi+YevxVQtVgyrtazuqMYykFq+lLRGLkLp65K22Uf4WMuicAtJTi3Z57NRAtsUS/6zS6HX7Ww9mpdAE5RU/TeC7NKdMxQD3ZIBwg/jKFGGNPT4K3+3MWyNdyxxE/oPAWe3C6gHBBu5Cf2no7zhdB24= | ||
bucket: snap.ci.snap-telemetry.io | ||
region: us-west-2 | ||
skip_cleanup: true | ||
local-dir: s3 | ||
upload-dir: plugins | ||
acl: public_read | ||
on: | ||
repo: intelsdi-x/snap-plugin-collector-cinder | ||
tags: true | ||
condition: $TEST_TYPE = "build" && $TRAVIS_GO_VERSION = "1.7.1" | ||
- provider: releases | ||
api_key: | ||
secure: cRaum5asJpZsKaOq0wPWGNMuQipJ8ga20pRK19ZwvYXfSXZnEl8fEJFlYNZQp5Ni93cqzW45x4j7qxv+LXDMkOQckKKKFRbfJQseHtCg8XSgG8OTURwwsICMK4GOXmARBKOBvXRzbiMrjVDhQCN5HXJcHnd6W98FkQymQ52xIlBkSknlpPkRiJC++GLksbZZ788wShTmuJHQMhnmBVmz41W5nc8fi+eNtPvkj98aMd2WSjbICv5ogZ3k0/Yztgeh9XDPqFlX+r2kYpy+8uLNhy9wBw4B1alXLAbgF1ml0bWVjEsIUGnYjRXAkxMr3+Rwdo/afhKgeav9kvjKd7Ihh3+lKEDYE6P6ToMkXjHvhzve87NFKNfogaGjRYDbZNxgLss/HkCW+9ghJjAwppT5oFfwxYC184YgpOcnEwH7gHWFcauDeKdGRUvt+TncbOigokUStcBVTHsoQnmECaXUw6XK2QRNx1H4xLhark2YQI9LbYfqgYtX1GS1JBzwB11MrANwS2e0+5GKqdJ/I5A9qA/8q24a5pr2fB6Z9/zV74gpTR7JTMcJTCoRVCm2QRYTSaoA83dR+jTDkDDTN4sgx9EK4YgkqoIdDUH4CsKQXcf+k4hlRwIzMymS5K3wTm7+ZF7Muy1XjoF9nlQR2EwMW7U2rWt/+PfWVZvMC8mlKn4= | ||
file: | ||
- release/snap-plugin-collector-cinder_linux_x86_64 | ||
skip_cleanup: true | ||
on: | ||
repo: intelsdi-x/snap-plugin-collector-cinder | ||
tags: true | ||
condition: $TEST_TYPE = "build" && $TRAVIS_GO_VERSION = "1.7.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// +build unit | ||
// +build small | ||
|
||
/* | ||
http://www.apache.org/licenses/LICENSE-2.0.txt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,49 @@ | ||
#!/bin/bash -e | ||
#!/bin/bash | ||
# File managed by pluginsync | ||
|
||
GITVERSION=`git describe --always` | ||
SOURCEDIR=$1 | ||
BUILDDIR=$SOURCEDIR/build | ||
PLUGIN=`echo $SOURCEDIR | grep -oh "snap-.*"` | ||
ROOTFS=$BUILDDIR/rootfs | ||
BUILDCMD='go build -a -ldflags "-w"' | ||
# http://www.apache.org/licenses/LICENSE-2.0.txt | ||
# | ||
# | ||
# Copyright 2016 Intel Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
echo | ||
echo "**** Snap Plugin Build ****" | ||
echo | ||
set -e | ||
set -u | ||
set -o pipefail | ||
|
||
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
__proj_dir="$(dirname "$__dir")" | ||
|
||
# shellcheck source=scripts/common.sh | ||
. "${__dir}/common.sh" | ||
|
||
plugin_name=${__proj_dir##*/} | ||
build_dir="${__proj_dir}/build" | ||
go_build=(go build -ldflags "-w") | ||
|
||
_info "project path: ${__proj_dir}" | ||
_info "plugin name: ${plugin_name}" | ||
|
||
# Disable CGO for builds | ||
export CGO_ENABLED=0 | ||
|
||
# Clean build bin dir | ||
rm -rf $ROOTFS/* | ||
|
||
# Make dir | ||
mkdir -p $ROOTFS | ||
# rebuild binaries: | ||
_debug "removing: ${build_dir:?}/*" | ||
rm -rf "${build_dir:?}/"* | ||
|
||
# Build plugin | ||
echo "Source Dir = $SOURCEDIR" | ||
echo "Building Snap Plugin: $PLUGIN" | ||
$BUILDCMD -o $ROOTFS/$PLUGIN | ||
_info "building plugin: ${plugin_name}" | ||
export GOOS=linux | ||
export GOARCH=amd64 | ||
mkdir -p "${build_dir}/${GOOS}/x86_64" | ||
"${go_build[@]}" -o "${build_dir}/${GOOS}/x86_64/${plugin_name}" . || exit 1 |
Oops, something went wrong.