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

Commit 83efbc8

Browse files
committed
Merge branch 'migrate-kaniko' into 'master'
Migrates build to kaniko See merge request ix.ai/etherscan-exporter!2
2 parents 74436e8 + e06e114 commit 83efbc8

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed

.gitlab-ci.yml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,46 @@
11
variables:
22
DOCKER_DRIVER: overlay2
3-
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
43
PORT: 9308
54

65
stages:
76
- lint
87
- build
98

10-
services:
11-
- docker:dind
9+
.tags-template: &tags-definition
10+
tags:
11+
- ix-ai
12+
13+
.build-template: &build-definition
14+
image:
15+
name: gcr.io/kaniko-project/executor:debug
16+
entrypoint: [""]
17+
stage: build
18+
script:
19+
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"username\":\"${CI_REGISTRY_USER}\",\"password\":\"${CI_REGISTRY_PASSWORD}\"}}}" > /kaniko/.docker/config.json
20+
- /kaniko/executor --context ${CI_PROJECT_DIR} --dockerfile ${CI_PROJECT_DIR}/Dockerfile --build-arg PORT=${PORT} --destination ${IMAGE_TAG}
1221

1322
pylint:
1423
image: python:latest
1524
stage: lint
1625
script:
1726
- curl -o .pylintrc https://tool.ix.ai/.pylintrc
18-
- pip install prometheus_client pylint requests pygelf
27+
- pip install prometheus_client pylint coinbase pygelf
1928
- pylint --rcfile=.pylintrc src/*.py
29+
<<: *tags-definition
2030

21-
build:
22-
image: docker:latest
23-
stage: build
31+
build:test:
32+
except:
33+
- master
34+
before_script:
35+
- export IMAGE_TAG="${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}"
36+
<<: *tags-definition
37+
<<: *build-definition
38+
39+
build:release:
2440
only:
25-
- /^latest$/
26-
- tags
27-
- /(.*)-dev$/
28-
script:
29-
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
30-
- docker build -f Dockerfile -t ${IMAGE_TAG} --build-arg PORT="${PORT}" .
31-
- docker push ${IMAGE_TAG}
41+
- master
42+
- latest
43+
before_script:
44+
- export IMAGE_TAG="${CI_REGISTRY_IMAGE}:latest"
45+
<<: *tags-definition
46+
<<: *build-definition

src/etherscan-exporter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def configure_logging():
3030
port=int(os.environ.get('GELF_PORT', 12201)),
3131
debug=True,
3232
include_extra_fields=True,
33+
_ix_id=os.path.splitext(sys.modules['__main__'].__file__)[0],
3334
)
3435
LOG.addHandler(GELF)
3536
gelf_enabled = True

0 commit comments

Comments
 (0)