Skip to content
This repository was archived by the owner on Oct 11, 2023. It is now read-only.

Commit e5f5e81

Browse files
committed
Add CI tests & fix errors
1 parent a570a5d commit e5f5e81

File tree

15 files changed

+418
-157
lines changed

15 files changed

+418
-157
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*.swp
2+
build

.gitlab-ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
# https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
3+
4+
stages:
5+
- commit
6+
- test
7+
- build
8+
9+
# commit
10+
# git-history:
11+
# stage: commit
12+
# script:
13+
# - >
14+
# bash <(curl --fail --location --silent --show-error
15+
# https://git.io/vxIxF)
16+
17+
# lines-length:
18+
# stage: commit
19+
# script:
20+
# - >
21+
# bash <(curl --fail --location --silent --show-error
22+
# https://git.io/vxIxN)
23+
24+
# test
25+
dockerlint:
26+
stage: test
27+
image: vpgrp/linter:docker
28+
allow_failure: true
29+
script:
30+
- find . -type f -name "Dockerfile" | xargs -I{} dockerlint {}
31+
32+
golint:
33+
stage: test
34+
image: vpgrp/linter:golang
35+
allow_failure: true
36+
script:
37+
- go get github.com/GeertJohan/fgt
38+
- find . -type f -name "*\.go" | xargs -I{} fgt golint {}
39+
40+
pylint:
41+
stage: test
42+
image: vpgrp/linter:python
43+
allow_failure: true
44+
script:
45+
- find . -type f -name "*\.py" | xargs -I{} pylint {}
46+
47+
# build
48+
docker:
49+
stage: build
50+
image: docker:latest
51+
allow_failure: true
52+
services:
53+
- docker:dind
54+
variables:
55+
DOCKER_DRIVER: overlay
56+
script:
57+
- docker build -f Dockerfile -t influxdb-relay-builder:latest .
58+
- docker run -v $(pwd):/root/go/src/github.com/vente-privee/influxdb-relay influxdb-relay-builder
59+
60+
go-get:
61+
stage: build
62+
image: vpgrp/golang:latest
63+
allow_failure: true
64+
script:
65+
- go get -u github.com/vente-privee/influxdb-relay
66+
# EOF

.mdlrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rules "~MD029"

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Jun 28 2018 Antoine MILLET <amillet@vente-privee.com>
2+
From https://github.com/influxdata/influxdb-relay
3+
4+
Jun 29 2018 Alexandre BESLIC <abeslic@abronan.com>
5+
* Switch to dep, make the project buildable after go get
6+
7+
Jun 29 2018 Dejan FILIPOVIC <dfilipovic@vente-privee.com>
8+
* Add /status route
9+
10+
Jun 30 2018 Antoine MILLET <amillet@vente-privee.com>
11+
* New README structure
12+
* Add basic tests with golint & pylint
13+
* Add CHANGELOG
14+
* Add CONTRIBUTING guide
15+
* Merge https://github.com/influxdata/influxdb-relay/pull/65
16+
* Merge https://github.com/influxdata/influxdb-relay/pull/52
17+
* Merge https://github.com/influxdata/influxdb-relay/pull/59
18+
* Merge https://github.com/influxdata/influxdb-relay/pull/43
19+
* Merge https://github.com/influxdata/influxdb-relay/pull/57

CONTRIBUTING.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# CONTRIBUTING
2+
3+
You are more than welcome to submit issues and merge requests to this project.
4+
5+
## git branches
6+
7+
Master branch is protected from pushes and may only accept fast-forwarded merge
8+
from develop. Owners and masters are allowed to merge develop in master.
9+
10+
Develop branch is protected from pushes. It is the actual working branch and
11+
any kind of features or bug fixes should be merged to develop first. Owners,
12+
masters and developers are allowed to merge other branches to develop. Masters
13+
are allowed to push if and only if there is a real need (eg when develop branch
14+
has to be rebased).
15+
16+
Anyone can create a new branch for his own needs. The names of the branch
17+
should include the issue number if there is any issue related.
18+
19+
## tests
20+
21+
Your commits must not break any tests.
22+
23+
## commits format
24+
25+
Your commits must pass `git log --check` and messages should be formated
26+
like this
27+
28+
```
29+
Summarize change in 50 characters or less
30+
31+
Provide more detail after the first line. Leave one blank line below the
32+
summary and wrap all lines at 72 characters or less.
33+
34+
If the change fixes an issue, leave another blank line after the final
35+
paragraph and indicate which issue is fixed in the specific format
36+
below.
37+
```
38+
39+
Also do your best to factor commits appropriately, ie not too large with
40+
unrelated things in the same commit, and not too small with the same small
41+
change applied N times in N different commits. If there was some accidental
42+
reformatting or whitespace changes during the course of your commits, please
43+
rebase them away before submitting the MR.
44+
45+
## files
46+
47+
All files must be 80 columns width formatted (actually 79), exception only when
48+
it is really not possible.

Dockerfile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# The MIT License (MIT)
2+
#
3+
# Copyright (c) 2016 Vente-Privée
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in
13+
# all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
# SOFTWARE.
22+
23+
FROM vpgrp/debian:stretch
24+
25+
ENV DEBIAN_FRONTEND="noninteractive" \
26+
TZ="Europe/Amsterdam"
27+
28+
RUN apt-get update -qq && \
29+
apt-get upgrade -qq -y && \
30+
apt-get install -qq -y \
31+
git \
32+
libffi-dev \
33+
make \
34+
mercurial \
35+
python \
36+
python-boto \
37+
rpm \
38+
ruby \
39+
ruby-dev \
40+
wget \
41+
zip
42+
43+
# Install go
44+
ENV GOPATH /root/go
45+
ENV GO_VERSION 1.6.2
46+
ENV GO_ARCH amd64
47+
RUN wget https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz; \
48+
tar -C /usr/local/ -xf /go${GO_VERSION}.linux-${GO_ARCH}.tar.gz ; \
49+
rm /go${GO_VERSION}.linux-${GO_ARCH}.tar.gz
50+
ENV PATH /usr/local/go/bin:$PATH
51+
52+
ENV PROJECT_DIR $GOPATH/src/github.com/vente-privee/influxdb-relay
53+
ENV PATH $GOPATH/bin:$PATH
54+
RUN mkdir -p $PROJECT_DIR
55+
WORKDIR $PROJECT_DIR
56+
57+
VOLUME $PROJECT_DIR
58+
59+
ENTRYPOINT [ "/root/go/src/github.com/vente-privee/influxdb-relay/build.py" ]
60+
# EOF

Dockerfile_build_ubuntu64

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)