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

Commit f46334d

Browse files
committed
Merge branch 'patch-1' into 'master'
Redesigns the build process. Fixes startup bug See merge request ix.ai/etherscan-exporter!7
2 parents b5c3451 + 26eabdd commit f46334d

File tree

4 files changed

+14
-70
lines changed

4 files changed

+14
-70
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -4,67 +4,5 @@ variables:
44
DOCKERHUB_REPO_PREFIX: ixdotai
55
DOCKERHUB_REPO_NAME: etherscan-exporter
66

7-
stages:
8-
- lint
9-
- build
10-
- release
11-
12-
.tags-template: &tags-definition
13-
tags:
14-
- ix-ai
15-
16-
.build-template: &build-definition
17-
image:
18-
name: gcr.io/kaniko-project/executor:debug
19-
entrypoint: [""]
20-
stage: build
21-
script:
22-
- echo "Building with PORT=${PORT}"
23-
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"username\":\"${CI_REGISTRY_USER}\",\"password\":\"${CI_REGISTRY_PASSWORD}\"},\"index.docker.io\":{\"auth\":\"${DOCKERHUB_REGISTRY_AUTH}\"}}}" > /kaniko/.docker/config.json
24-
- /kaniko/executor --context ${CI_PROJECT_DIR} --dockerfile ${CI_PROJECT_DIR}/Dockerfile --build-arg PORT=${PORT} ${DESTINATION}
25-
26-
pylint:
27-
image: python:latest
28-
stage: lint
29-
script:
30-
- pip install pylint pygelf prometheus_client requests
31-
- pylint --rcfile=.pylintrc src/*.py
32-
<<: *tags-definition
33-
34-
build:dev:
35-
except:
36-
- master
37-
- tags
38-
before_script:
39-
- export DESTINATION="--destination ${CI_REGISTRY_IMAGE}:dev-${CI_COMMIT_REF_NAME}"
40-
<<: *tags-definition
41-
<<: *build-definition
42-
43-
build:tags:
44-
only:
45-
- tags
46-
before_script:
47-
- export DESTINATION="--destination ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME} --destination=index.docker.io/${DOCKERHUB_REPO_PREFIX}/${DOCKERHUB_REPO_NAME}:${CI_COMMIT_REF_NAME}"
48-
<<: *tags-definition
49-
<<: *build-definition
50-
51-
build:release:
52-
only:
53-
- master
54-
before_script:
55-
- export DESTINATION="--destination ${CI_REGISTRY_IMAGE}:latest --destination=index.docker.io/${DOCKERHUB_REPO_PREFIX}/${DOCKERHUB_REPO_NAME}:latest"
56-
<<: *tags-definition
57-
<<: *build-definition
58-
59-
publish:readme:
60-
stage: release
61-
variables:
62-
README_PATH: ${CI_PROJECT_DIR}/README.md
63-
only:
64-
- master
65-
image:
66-
name: sheogorath/readme-to-dockerhub:latest
67-
entrypoint: ['']
68-
script:
69-
- node /app/index.js
70-
<<: *tags-definition
7+
include:
8+
- remote: https://gitlab.com/ix.ai/ci-templates/raw/master/python-project.yml

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ LABEL maintainer="docker@ix.ai"
44
ARG PORT=9308
55
ARG LOGLEVEL=INFO
66

7+
WORKDIR /app
8+
9+
COPY src/ /app
10+
711
RUN apk --no-cache upgrade && \
8-
apk add --no-cache py3-requests && \
9-
pip3 install --no-cache-dir prometheus_client pygelf
12+
apk add --no-cache python3 gcc musl-dev && \
13+
pip3 install --no-cache-dir prometheus_client pygelf requests && \
14+
apk del --no-cache --purge gcc musl-dev
1015

1116
ENV LOGLEVEL=${LOGLEVEL} PORT=${PORT}
1217

13-
COPY src/etherscan-exporter.py /
14-
1518
EXPOSE ${PORT}
1619

17-
ENTRYPOINT ["python3", "/etherscan-exporter.py"]
20+
ENTRYPOINT ["python3", "/app/etherscan-exporter.py"]

src/etherscan-exporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
def configure_logging():
2424
""" Configures the logging """
25-
gelf_enabled: False
25+
gelf_enabled = False
2626

2727
if os.environ.get('GELF_HOST'):
2828
GELF = pygelf.GelfUdpHandler(

src/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pygelf
2+
prometheus_client
3+
requests

0 commit comments

Comments
 (0)