Navigation Menu

Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Update from Intelsdi-x pluginsync 0.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
nanliu committed Sep 19, 2016
1 parent b782490 commit 170f93e
Show file tree
Hide file tree
Showing 14 changed files with 648 additions and 42 deletions.
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE.md
@@ -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):
21 changes: 21 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -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):
-
43 changes: 41 additions & 2 deletions .gitignore
@@ -1,2 +1,41 @@
snap-plugin-collector-etcd
build
# 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/
17 changes: 17 additions & 0 deletions .pluginsync.yml
@@ -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
11 changes: 11 additions & 0 deletions .sync.yml
@@ -0,0 +1,11 @@
.travis.yml:
env:
global:
- ORG_PATH=/home/travis/gopath/src/github.com/intelsdi-x
- SNAP_PLUGIN_SOURCE=/home/travis/gopath/src/github.com/${TRAVIS_REPO_SLUG}
deploy:
access_key_id: AKIAINMB43VSSPFZISAA
secret_access_key:
secure: UluNXQ7K/i/fDm3aKjcxz6nyObkNq4RrD9NPCG8WipYjHbhgRhso4p0y53JXhL1BB5xcLxhH5HVfVUG4oMyMldOMrmNztCHN6pwlQEe/+I4nWUwLdNWtKNlCE/wDDYGzSpBSrTl2Tj/fh5HtcVbQ7IZkjQiuzyt318usEYAhaiDJ2Y31WUurcj7xKBCrNZ1YynGA9BnGgA43R0QdSE5HWpL2cxBF1whDyO+TcRHc1ZluChsp+1RpD6fIivc1/IDLVHViLUs1u4LWTE/oQbf+uSFN7qvNG7BTaG/1sESbSXlFBtUnmlVRaJiDYOCG4vrt4ggMCBOJlh4G+hRaVHl4mMrA8O3lBgtUAQZhUtX8QzA1p10dvNXm8R4GTT22dtRjAXfx0ago77gBmaOyhmYev4/X40swd8ynJQrBcK7GkoBL1avZ3wehYnyglmrWzNZGeKixP4Ie/2IaRhR8QJ3AOj9yJL+akgfrN5zMyCdbP4FW7p+qOaQF4dq3pRSLAdidbQCHWgAD4jslyWdC3o1caqr+Hx8j+0+AqOqVFnqhiwqsfKpUtc1YwYLlLcMci8HxSOUPGyVkpbTSE3/4DBVcUJwiMEY9USvaTvbjWWSfWY+pJwLP1HeSc2JRBa9gl5l1qSViVH91g9/3e9/sFdmzR6Ote8JrA8kxrgo5tgFk+14=
api_key:
secure: ZCx5aF3BagpWvSQ75MW9W9ufCFzx/xqrs83roZOqPHuwhbVS0Y1XatL1L5vzwjLfB8Wmck9feUq1y4wRCum/D8S8FPGZJDNAr6dlKxC57cHsGznOx+RmG9MGWJ01iAHOK9bi1OsMq7SWTWNsLmbuUYbZf/8kGq7tHQwbe1fDRSRnXRRmPRFG7yYT7w5I2ayA9f444l/uQ5GHTWBQ5BiiUjMkJnGKwFant6BBSA5cZybNFoszO1P9aWa883KMUXtmE/Vy7UU1lXGfH5MU0+ENRvn+p9QZTri/H+GxfmcaeQgXis0v7ZpSUqvkv4hJjj8AK4E1Ypo8HXbfwPdHEBCT8h0F/cAuoB0NzEotRzUFZhX9WKjx6Oig/4TwQVuDhz2RHnxP9GhSezc7iRvyTpv8bmF14p/WspSGsLmLTq5inC+G4QVy9a8fNKpvrbYM/O/hVEur0ujQGz5TVuAalHW9LRaLUWZKsPU92aynPnABUzYQRMcd3ObMLyKVtU6S53MzoFkKxe4ArT1Lfn4zj9cotzRVChosTwIxAtNrjjT2tkDDIEF4CheaSnabQSXH0diwNW2XzPlr2ka2Hp9HbcbhV8Nyq+DnGccQjqePAg4eqXxytjmI46a1cg1PBii2onSGH0QeVaan73zmuMJMf2jJLz7s0O4jvrZyv9XnHvVlYd4=
68 changes: 68 additions & 0 deletions .travis.yml
@@ -0,0 +1,68 @@
# File managed by pluginsync
sudo: false
language: go
go:
- 1.6.3
- 1.7.1
env:
global:
- ORG_PATH=/home/travis/gopath/src/github.com/intelsdi-x
- SNAP_PLUGIN_SOURCE=/home/travis/gopath/src/github.com/${TRAVIS_REPO_SLUG}
matrix:
- 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:
- cd $SNAP_PLUGIN_SOURCE
- make deps
script:
- 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: UluNXQ7K/i/fDm3aKjcxz6nyObkNq4RrD9NPCG8WipYjHbhgRhso4p0y53JXhL1BB5xcLxhH5HVfVUG4oMyMldOMrmNztCHN6pwlQEe/+I4nWUwLdNWtKNlCE/wDDYGzSpBSrTl2Tj/fh5HtcVbQ7IZkjQiuzyt318usEYAhaiDJ2Y31WUurcj7xKBCrNZ1YynGA9BnGgA43R0QdSE5HWpL2cxBF1whDyO+TcRHc1ZluChsp+1RpD6fIivc1/IDLVHViLUs1u4LWTE/oQbf+uSFN7qvNG7BTaG/1sESbSXlFBtUnmlVRaJiDYOCG4vrt4ggMCBOJlh4G+hRaVHl4mMrA8O3lBgtUAQZhUtX8QzA1p10dvNXm8R4GTT22dtRjAXfx0ago77gBmaOyhmYev4/X40swd8ynJQrBcK7GkoBL1avZ3wehYnyglmrWzNZGeKixP4Ie/2IaRhR8QJ3AOj9yJL+akgfrN5zMyCdbP4FW7p+qOaQF4dq3pRSLAdidbQCHWgAD4jslyWdC3o1caqr+Hx8j+0+AqOqVFnqhiwqsfKpUtc1YwYLlLcMci8HxSOUPGyVkpbTSE3/4DBVcUJwiMEY9USvaTvbjWWSfWY+pJwLP1HeSc2JRBa9gl5l1qSViVH91g9/3e9/sFdmzR6Ote8JrA8kxrgo5tgFk+14=
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-etcd
branch: master
condition: $TEST_TYPE = "build" && $TRAVIS_GO_VERSION = "1.7.1"
- provider: s3
access_key_id: AKIAINMB43VSSPFZISAA
secret_access_key:
secure: UluNXQ7K/i/fDm3aKjcxz6nyObkNq4RrD9NPCG8WipYjHbhgRhso4p0y53JXhL1BB5xcLxhH5HVfVUG4oMyMldOMrmNztCHN6pwlQEe/+I4nWUwLdNWtKNlCE/wDDYGzSpBSrTl2Tj/fh5HtcVbQ7IZkjQiuzyt318usEYAhaiDJ2Y31WUurcj7xKBCrNZ1YynGA9BnGgA43R0QdSE5HWpL2cxBF1whDyO+TcRHc1ZluChsp+1RpD6fIivc1/IDLVHViLUs1u4LWTE/oQbf+uSFN7qvNG7BTaG/1sESbSXlFBtUnmlVRaJiDYOCG4vrt4ggMCBOJlh4G+hRaVHl4mMrA8O3lBgtUAQZhUtX8QzA1p10dvNXm8R4GTT22dtRjAXfx0ago77gBmaOyhmYev4/X40swd8ynJQrBcK7GkoBL1avZ3wehYnyglmrWzNZGeKixP4Ie/2IaRhR8QJ3AOj9yJL+akgfrN5zMyCdbP4FW7p+qOaQF4dq3pRSLAdidbQCHWgAD4jslyWdC3o1caqr+Hx8j+0+AqOqVFnqhiwqsfKpUtc1YwYLlLcMci8HxSOUPGyVkpbTSE3/4DBVcUJwiMEY9USvaTvbjWWSfWY+pJwLP1HeSc2JRBa9gl5l1qSViVH91g9/3e9/sFdmzR6Ote8JrA8kxrgo5tgFk+14=
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-etcd
tags: true
condition: $TEST_TYPE = "build" && $TRAVIS_GO_VERSION = "1.7.1"
- provider: releases
api_key:
secure: ZCx5aF3BagpWvSQ75MW9W9ufCFzx/xqrs83roZOqPHuwhbVS0Y1XatL1L5vzwjLfB8Wmck9feUq1y4wRCum/D8S8FPGZJDNAr6dlKxC57cHsGznOx+RmG9MGWJ01iAHOK9bi1OsMq7SWTWNsLmbuUYbZf/8kGq7tHQwbe1fDRSRnXRRmPRFG7yYT7w5I2ayA9f444l/uQ5GHTWBQ5BiiUjMkJnGKwFant6BBSA5cZybNFoszO1P9aWa883KMUXtmE/Vy7UU1lXGfH5MU0+ENRvn+p9QZTri/H+GxfmcaeQgXis0v7ZpSUqvkv4hJjj8AK4E1Ypo8HXbfwPdHEBCT8h0F/cAuoB0NzEotRzUFZhX9WKjx6Oig/4TwQVuDhz2RHnxP9GhSezc7iRvyTpv8bmF14p/WspSGsLmLTq5inC+G4QVy9a8fNKpvrbYM/O/hVEur0ujQGz5TVuAalHW9LRaLUWZKsPU92aynPnABUzYQRMcd3ObMLyKVtU6S53MzoFkKxe4ArT1Lfn4zj9cotzRVChosTwIxAtNrjjT2tkDDIEF4CheaSnabQSXH0diwNW2XzPlr2ka2Hp9HbcbhV8Nyq+DnGccQjqePAg4eqXxytjmI46a1cg1PBii2onSGH0QeVaan73zmuMJMf2jJLz7s0O4jvrZyv9XnHvVlYd4=
file:
- release/snap-plugin-collector-etcd_linux_x86_64
skip_cleanup: true
on:
repo: intelsdi-x/snap-plugin-collector-etcd
tags: true
condition: $TEST_TYPE = "build" && $TRAVIS_GO_VERSION = "1.7.1"
37 changes: 19 additions & 18 deletions CONTRIBUTING.md
@@ -1,4 +1,4 @@
# snap collector plugin - etcd
# snap plugin collector etcd

1. [Contributing Code](#contributing-code)
2. [Contributing Examples](#contributing-examples)
Expand All @@ -10,36 +10,37 @@ This repository has dedicated developers from Intel working on updates. The most
## Contributing Code
**_IMPORTANT_**: We encourage contributions to the project from the community. We ask that you keep the following guidelines in mind when planning your contribution.

* Whether your contribution is for a bug fix or a feature request, **create an [Issue](https://github.com/intelsdi-x/snap-plugin-collector-etcd/issues)** and let us know what you are thinking
* **For bugs**, if you have already found a fix, feel free to submit a Pull Request referencing the Issue you created
* **For feature requests**, we want to improve upon the library incrementally which means small changes at a time. In order ensure your PR can be reviewed in a timely manner, please keep PRs small, e.g. <10 files and <500 lines changed. If you think this is unrealistic, then mention that within the issue and we can discuss it
* Whether your contribution is for a bug fix or a feature request, **create an [Issue](https://github.com/intelsdi-x/snap-plugin-collector-etcd/issues)** and let us know what you are thinking.
* **For bugs**, if you have already found a fix, feel free to submit a Pull Request referencing the Issue you created. Include the `Fixes #` syntax to link it to the issue you're addressing.
* **For feature requests**, we want to improve upon the library incrementally which means small changes at a time. In order to ensure your PR can be reviewed in a timely manner, please keep PRs small, e.g. <10 files and <500 lines changed. If you think this is unrealistic, then mention that within the issue and we can discuss it.

Once you're ready to contribute code back to this repo, start with these steps:

* Fork the appropriate sub-projects that are affected by your change
* Clone the fork to `$GOPATH/src/github.com/intelsdi-x/`
```
$ git clone https://github.com/<yourGithubID>/<project>.git
```
* Create a topic branch for your change and checkout that branch
* Fork the appropriate sub-projects that are affected by your change.
* Clone the fork to `$GOPATH/src/github.com/intelsdi-x/`:

```
$ git clone https://github.com/<yourGithubID>/<project>.git
```
* Create a topic branch for your change and checkout that branch:

```
$ git checkout -b some-topic-branch
```
* Make your changes and run the test suite if one is provided (see below)
* Commit your changes and push them to your fork
* Open a pull request for the appropriate project
* Contributors will review your pull request, suggest changes, and merge it when it’s ready and/or offer feedback
* To report a bug or issue, please open a new issue against this repository
* Make your changes and run the test suite if one is provided.
* Commit your changes and push them to your fork.
* Open a pull request for the appropriate project.
* Contributors will review your pull request, suggest changes, and merge it when it’s ready and/or offer feedback.

If you have questions feel free to contact the [maintainers](https://github.com/intelsdi-x/snap/blob/master/README.md#maintainers).
If you have questions feel free to contact the [maintainers](https://github.com/intelsdi-x/snap/blob/master/README.md#maintainers) by tagging them: @intelsdi-x/plugin-maintainers.

## Contributing Examples
The most immediately helpful way you can benefit this project is by cloning the repository, adding some further examples and submitting a pull request.

Have you written a blog post about how you use [snap](http://github.com/intelsdi-x/snap) and/or this plugin? Send it to us!
Have you written a blog post about how you use [Snap](http://github.com/intelsdi-x/snap) and/or this plugin? Send it to us [on Slack](http://slack.snap-telemetry.io)!

## Contribute Elsewhere
This repository is one of **many** plugins in **snap**, a powerful telemetry framework. See the full project at http://github.com/intelsdi-x/snap
This repository is one of **many** plugins in **Snap**, a powerful telemetry framework. See the full project at http://snap-telemetry.io

## Thank You
And **thank you!** Your contribution, through code and participation, is incredibly important to us.
2 changes: 1 addition & 1 deletion LICENSE
Expand Up @@ -199,4 +199,4 @@
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.
limitations under the License.
32 changes: 31 additions & 1 deletion Makefile
@@ -1,7 +1,37 @@
# File managed by pluginsync
# http://www.apache.org/licenses/LICENSE-2.0.txt
#
#
# Copyright 2015 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.

default:
$(MAKE) deps
$(MAKE) all
deps:
bash -c "godep restore"
bash -c "./scripts/deps.sh"
test:
bash -c "./scripts/test.sh $(TEST_TYPE)"
test-legacy:
bash -c "./scripts/test.sh legacy"
test-small:
bash -c "./scripts/test.sh small"
test-medium:
bash -c "./scripts/test.sh medium"
test-large:
bash -c "./scripts/test.sh large"
check:
$(MAKE) test
all:
bash -c "./scripts/build.sh $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))"
62 changes: 42 additions & 20 deletions scripts/build.sh
@@ -1,27 +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

# Disable CGO for builds
export CGO_ENABLED=0
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
__proj_dir="$(dirname "$__dir")"

# shellcheck source=scripts/common.sh
. "${__dir}/common.sh"

# Clean build bin dir
rm -rf $ROOTFS/*
plugin_name=${__proj_dir##*/}
build_dir="${__proj_dir}/build"
go_build=(go build -ldflags "-w")

# Make dir
mkdir -p $ROOTFS
_info "project path: ${__proj_dir}"
_info "plugin name: ${plugin_name}"

# Disable CGO for builds
export CGO_ENABLED=0

# Build plugin
echo "Source Dir = $SOURCEDIR"
echo "Building Snap Plugin: $PLUGIN"
$BUILDCMD -o $ROOTFS/$PLUGIN
# rebuild binaries:
_debug "removing: ${build_dir:?}/*"
rm -rf "${build_dir:?}/"*

_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

0 comments on commit 170f93e

Please sign in to comment.