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

Commit 9a7fc57

Browse files
committed
Adds docker hub image
1 parent b703e25 commit 9a7fc57

File tree

4 files changed

+548
-15
lines changed

4 files changed

+548
-15
lines changed

.gitlab-ci.yml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
variables:
22
DOCKER_DRIVER: overlay2
33
PORT: 9308
4+
DOCKERHUB_REPO_PREFIX: ixdotai
5+
DOCKERHUB_REPO_NAME: etherscan-exporter
46

57
stages:
68
- lint
79
- build
10+
- release
811

912
.tags-template: &tags-definition
1013
tags:
@@ -16,31 +19,52 @@ stages:
1619
entrypoint: [""]
1720
stage: build
1821
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}
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}
2125

2226
pylint:
2327
image: python:latest
2428
stage: lint
2529
script:
26-
- curl -o .pylintrc https://tool.ix.ai/.pylintrc
2730
- pip install pylint pygelf prometheus_client requests
2831
- pylint --rcfile=.pylintrc src/*.py
2932
<<: *tags-definition
3033

31-
build:test:
34+
build:dev:
3235
except:
3336
- master
37+
- tags
3438
before_script:
35-
- export IMAGE_TAG="${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}"
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}"
3648
<<: *tags-definition
3749
<<: *build-definition
3850

3951
build:release:
4052
only:
4153
- master
42-
- latest
4354
before_script:
44-
- export IMAGE_TAG="${CI_REGISTRY_IMAGE}:latest"
55+
- export DESTINATION="--destination ${CI_REGISTRY_IMAGE}:latest --destination=index.docker.io/${DOCKERHUB_REPO_PREFIX}/${DOCKERHUB_REPO_NAME}:latest"
4556
<<: *tags-definition
4657
<<: *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

0 commit comments

Comments
 (0)