Skip to content
This repository was archived by the owner on Feb 16, 2020. It is now read-only.

Commit c4221fd

Browse files
committed
Merge branch 'add-arm' into 'master'
Add arm See merge request ix.ai/etherscan-exporter!9
2 parents aaab451 + 03f0810 commit c4221fd

File tree

7 files changed

+27
-10
lines changed

7 files changed

+27
-10
lines changed

.gitlab-ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
variables:
22
DOCKER_DRIVER: overlay2
3-
PORT: 9308
43
DOCKERHUB_REPO_PREFIX: ixdotai
54
DOCKERHUB_REPO_NAME: etherscan-exporter
5+
ENABLE_ARM64: 'true'
6+
ENABLE_ARMv7: 'true'
67

78
include:
8-
- remote: https://gitlab.com/ix.ai/ci-templates/raw/master/python-project.yml
9+
- project: 'ix.ai/ci-templates'
10+
file: '/python-project.yml'

Dockerfile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
FROM alpine:latest
22
LABEL maintainer="docker@ix.ai"
33

4-
ARG PORT=9308
5-
ARG LOGLEVEL=INFO
6-
74
WORKDIR /app
85

96
COPY src/ /app
107

118
RUN apk --no-cache upgrade && \
12-
apk add --no-cache python3 gcc musl-dev && \
9+
apk --no-cache add python3 gcc musl-dev && \
1310
pip3 install --no-cache-dir -r requirements.txt && \
1411
apk del --no-cache --purge gcc musl-dev
1512

16-
ENV LOGLEVEL=${LOGLEVEL} PORT=${PORT}
17-
18-
EXPOSE ${PORT}
13+
EXPOSE 9308
1914

2015
ENTRYPOINT ["python3", "/app/etherscan-exporter.py"]

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,17 @@ TOKENS='[{"contract":"0x9b70740e708a083c6ff38df52297020f5dfaa5ee","name":"Daneel
3636

3737
The technical information can be found on [etherscan.io](https://etherscan.io/token/0x9b70740e708a083c6ff38df52297020f5dfaa5ee#readContract)
3838

39+
## Tags and Arch
40+
41+
Starting with version v0.3.0, the images are multi-arch, with builds for amd64, arm64 and armv7.
42+
* `vN.N.N` - for example v0.3.0
43+
* `latest` - always pointing to the latest version
44+
* `dev-branch` - the last build on a feature/development branch
45+
* `dev-master` - the last build on the master branch
46+
3947
## Resources:
4048
* GitLab: https://gitlab.com/ix.ai/etherscan-exporter
49+
* GitHub: https://github.com/ix-ai/etherscan-exporter
4150
* Docker Hub: https://hub.docker.com/r/ixdotai/etherscan-exporter
4251

4352
See also [ix.ai/crypto-exporter](https://gitlab.com/ix.ai/crypto-exporter) for more usage examples, including Prometheus configuration

build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
3+
echo "Setting VERSION='${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}' in src/constants.py"
4+
echo "VERSION = '${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}'" >> src/constants.py

src/__init__.py

Whitespace-only changes.

src/constants.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
""" Constants declarations """
4+
5+
VERSION = None

src/etherscan-exporter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import pygelf
1111
from prometheus_client import start_http_server
1212
from prometheus_client.core import REGISTRY, GaugeMetricFamily
13+
import constants
1314

1415
LOG = logging.getLogger(__name__)
1516
logging.basicConfig(
@@ -163,7 +164,8 @@ def collect(self):
163164
if __name__ == '__main__':
164165
configure_logging()
165166
PORT = int(os.environ.get('PORT', 9308))
166-
LOG.info("Starting on port {}".format(PORT))
167+
# pylint: disable=no-member
168+
LOG.info("Starting etherscan-exporter {} on port {}".format(constants.VERSION, PORT))
167169
REGISTRY.register(EtherscanCollector())
168170
start_http_server(PORT)
169171
while True:

0 commit comments

Comments
 (0)