...
 
Commits (2)
......@@ -4,66 +4,5 @@ variables:
DOCKERHUB_REPO_PREFIX: ixdotai
DOCKERHUB_REPO_NAME: blockchain-exporter
stages:
- lint
- build
- release
.tags-template: &tags-definition
tags:
- ix-ai
.build-template: &build-definition
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
stage: build
script:
- 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}
pylint:
image: python:latest
stage: lint
script:
- pip install pylint pygelf prometheus_client requests
- pylint --rcfile=.pylintrc src/*.py
<<: *tags-definition
build:dev:
except:
- master
- tags
before_script:
- export DESTINATION="--destination ${CI_REGISTRY_IMAGE}:dev-${CI_COMMIT_REF_NAME}"
<<: *tags-definition
<<: *build-definition
build:tags:
only:
- tags
before_script:
- export DESTINATION="--destination ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME} --destination=index.docker.io/${DOCKERHUB_REPO_PREFIX}/${DOCKERHUB_REPO_NAME}:${CI_COMMIT_REF_NAME}"
<<: *tags-definition
<<: *build-definition
build:release:
only:
- master
before_script:
- export DESTINATION="--destination ${CI_REGISTRY_IMAGE}:latest --destination=index.docker.io/${DOCKERHUB_REPO_PREFIX}/${DOCKERHUB_REPO_NAME}:latest"
<<: *tags-definition
<<: *build-definition
publish:readme:
stage: release
variables:
README_PATH: ${CI_PROJECT_DIR}/README.md
only:
- master
image:
name: sheogorath/readme-to-dockerhub:latest
entrypoint: ['']
script:
- node /app/index.js
<<: *tags-definition
include:
- remote: https://gitlab.com/ix.ai/ci-templates/raw/master/python-project.yml
......@@ -4,14 +4,17 @@ LABEL maintainer="docker@ix.ai"
ARG PORT=9308
ARG LOGLEVEL=INFO
WORKDIR /app
COPY src/ /app
RUN apk --no-cache upgrade && \
apk --no-cache add python3 gcc musl-dev && \
pip3 install --no-cache-dir prometheus_client pygelf requests
apk add --no-cache python3 gcc musl-dev && \
pip3 install --no-cache-dir prometheus_client pygelf requests && \
apk del --no-cache --purge gcc musl-dev
ENV LOGLEVEL=${LOGLEVEL} PORT=${PORT}
COPY src/blockchain-exporter.py /
EXPOSE ${PORT}
ENTRYPOINT ["python3", "/blockchain-exporter.py"]
ENTRYPOINT ["python3", "/app/blockchain-exporter.py"]
......@@ -21,7 +21,7 @@ logging.basicConfig(
def configure_logging():
""" Configures the logging """
gelf_enabled: False
gelf_enabled = False
if os.environ.get('GELF_HOST'):
GELF = pygelf.GelfUdpHandler(
......
pygelf
prometheus_client
requests