Commit c18c5d60 authored by Alex Thomae's avatar Alex Thomae

Adds `.pylintrc` to the repository

* Adds the CCXT ARG to the build command
* Renames `build:test` to `build:dev`
* Adds separate build for tags
* Adds badges
* Adds working prometheus example with dns_sd_configs
parent 8aa84ee2
Pipeline #78807862 passed with stages
in 3 minutes and 55 seconds
......@@ -18,21 +18,31 @@ stages:
entrypoint: [""]
stage: build
script:
- echo "Building with CCXT=${CCXT} and with PORT=${PORT}"
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"username\":\"${CI_REGISTRY_USER}\",\"password\":\"${CI_REGISTRY_PASSWORD}\"},\"index.docker.io\":{\"auth\":\"${DOCKERHUB_REGISTRY_AUTH}\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context ${CI_PROJECT_DIR} --dockerfile ${CI_PROJECT_DIR}/Dockerfile --build-arg PORT=${PORT} --destination ${IMAGE_TAG_GITLAB} --destination ${IMAGE_TAG_GITHUB}
- /kaniko/executor --context ${CI_PROJECT_DIR} --dockerfile ${CI_PROJECT_DIR}/Dockerfile --build-arg PORT=${PORT} --build-arg CCXT=${CCXT} --destination ${IMAGE_TAG_GITLAB} --destination ${IMAGE_TAG_GITHUB}
pylint:
image: python:latest
stage: lint
script:
- curl -o .pylintrc https://tool.ix.ai/.pylintrc
- pip install pylint pygelf prometheus_client "ccxt<=${CCXT}" requests
- pylint --rcfile=.pylintrc src/*.py
<<: *tags-definition
build:test:
build:dev:
except:
- master
- tags
before_script:
- export IMAGE_TAG_GITLAB="${CI_REGISTRY_IMAGE}:dev-${CI_COMMIT_REF_NAME}"
- export IMAGE_TAG_GITHUB="index.docker.io/${DOCKERHUB_REPOSITORY}:dev-${CI_COMMIT_REF_NAME}"
<<: *tags-definition
<<: *build-definition
build:tags:
only:
- tags
before_script:
- export IMAGE_TAG_GITLAB="${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}"
- export IMAGE_TAG_GITHUB="index.docker.io/${DOCKERHUB_REPOSITORY}:${CI_COMMIT_REF_NAME}"
......
This diff is collapsed.
FROM registry.gitlab.com/ix.ai/alpine:latest
LABEL MAINTAINER="docker@ix.ai"
FROM alpine:latest
LABEL maintainer="docker@ix.ai"
ARG CCXT=1.18.928
ARG PORT=9308
......
# crypto-exporter
[![Pipeline Status](https://gitlab.com/ix.ai/crypto-exporter/badges/master/pipeline.svg)](https://gitlab.com/ix.ai/crypto-exporter/)
[![Docker Stars](https://img.shields.io/docker/stars/ixdotai/crypto-exporter.svg)](https://hub.docker.com/r/ixdotai/crypto-exporter/)
[![Docker Pulls](https://img.shields.io/docker/pulls/ixdotai/crypto-exporter.svg)](https://hub.docker.com/r/ixdotai/crypto-exporter/)
[![Gitlab Project](https://img.shields.io/badge/GitLab-Project-554488.svg)](https://gitlab.com/ix.ai/crypto-exporter/)
Prometheus exporter, written in python, for different crypto exchanges
## Usage
......@@ -62,6 +68,25 @@ networks:
```
### Prometheus configuration with DNS service discovery
```yml
scrape_configs:
- job_name: 'crypto-exporters'
honor_timestamps: true
scrape_interval: 30s
scrape_timeout: 30s
metrics_path: /metrics
scheme: http
dns_sd_configs:
- names:
- tasks.binance
- tasks.bitfinex
```
Make sure that your prometheus server is able to reach the network set for the crypto-exporter.
**Warning**: some exchanges (notably: gdax/coinbasepro) need more than 30s to scrape
### Supported variables
* `EXCHANGE` (no default - **mandatory**) - see below
* `API_KEY` (no default) - set this to your Exchange API key
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment