-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
1,060 additions
and
227 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,76 @@ | ||
--- | ||
version: 2.1 | ||
|
||
orbs: | ||
prometheus: prometheus/[email protected] | ||
|
||
jobs: | ||
test: | ||
docker: | ||
- image: circleci/golang:1.12 | ||
|
||
steps: | ||
- prometheus/setup_environment | ||
- run: make style build | ||
- prometheus/store_artifact: | ||
file: locust_exporter | ||
|
||
publish_master: | ||
description: Build and publish container images from the master branch. | ||
docker: | ||
- image: circleci/golang:1.12 | ||
steps: | ||
- prometheus/setup_build_environment | ||
- prometheus/publish_images: | ||
login_variable: REGISTRY_USER | ||
organization: containersol | ||
password_variable: REGISTRY_PASS | ||
registry: docker.io | ||
|
||
publish_release: | ||
description: Build and publish binaries and container images for a given release tag. | ||
docker: | ||
- image: circleci/golang:1.12 | ||
steps: | ||
- prometheus/setup_build_environment | ||
- run: promu crossbuild tarballs | ||
- run: promu checksum .tarballs | ||
- run: promu release .tarballs | ||
- store_artifacts: | ||
destination: releases | ||
path: .tarballs | ||
- prometheus/publish_release_images: | ||
login_variable: REGISTRY_USER | ||
organization: containersol | ||
password_variable: REGISTRY_PASS | ||
registry: docker.io | ||
|
||
workflows: | ||
version: 2 | ||
locust_exporter: | ||
jobs: | ||
- test: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- prometheus/build: | ||
name: build | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- publish_master: | ||
requires: | ||
- test | ||
- build | ||
filters: | ||
branches: | ||
only: master | ||
- publish_release: | ||
requires: | ||
- test | ||
- build | ||
filters: | ||
tags: | ||
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/ | ||
branches: | ||
ignore: /.*/ |
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,89 +1,3 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# IPython Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# dotenv | ||
.env | ||
|
||
# virtualenv | ||
venv/ | ||
ENV/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
locust_exporter | ||
main | ||
.idea |
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,23 @@ | ||
verbose: true | ||
go: | ||
version: 1.12 | ||
cgo: false | ||
repository: | ||
path: github.com/ContainerSolutions/locust_exporter | ||
build: | ||
flags: -a -tags netgo | ||
ldflags: | | ||
-s | ||
-X {{repoPath}}/version.Version={{.Version}} | ||
-X {{repoPath}}/version.Revision={{.Revision}} | ||
-X {{repoPath}}/version.Branch={{.Branch}} | ||
-X {{repoPath}}/version.BuildUser={{user}}@{{host}} | ||
-X {{repoPath}}/version.BuildDate={{date "20060102-15:04:05"}} | ||
tarball: | ||
prefix: . | ||
files: | ||
- LICENSE | ||
crossbuild: | ||
platforms: | ||
- linux/amd64 | ||
- linux/386 |
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
# CHANGELOG | ||
|
||
## 0.2.0 / 2019-09-06 | ||
|
||
Initial release of Go version | ||
|
||
## 0.1.0 / 2019-09-04 | ||
|
||
Initial release of Python version |
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,7 +1,11 @@ | ||
FROM python:3-alpine | ||
|
||
WORKDIR /usr/src/app | ||
COPY requirements.txt ./ | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
FROM golang:alpine AS builder | ||
RUN apk update && apk add --no-cache git | ||
WORKDIR $GOPATH/src/ContainerSolutions/locust_exporter/ | ||
COPY . . | ||
CMD ["python", "./locust_exporter.py"] | ||
RUN GO111MODULE=on go mod download | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -installsuffix cgo -ldflags="-w -s" -o /go/bin/locust_exporter | ||
|
||
FROM scratch | ||
COPY --from=builder /go/bin/locust_exporter /go/bin/locust_exporter | ||
ENTRYPOINT ["/go/bin/locust_exporter"] |
Oops, something went wrong.