Commit 5efb78c4 authored by Alex Thomae's avatar Alex Thomae

Merge branch 'ci-template' into 'master'

Fixes startup bug. Switches to standard ix.ai pipeline template

Also improves the image size by removing packages after they are used.

See merge request !11
parents 75a74fc8 6a968d51
Pipeline #101454406 passed with stages
in 1 minute and 55 seconds
......@@ -4,67 +4,5 @@ variables:
DOCKERHUB_REPO_PREFIX: ixdotai
DOCKERHUB_REPO_NAME: coinbase-exporter
stages:
- lint
- build
- publish
.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
- echo "/kaniko/executor --context ${CI_PROJECT_DIR} --dockerfile ${CI_PROJECT_DIR}/Dockerfile ${DESTINATION}"
- /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 -r ${CI_PROJECT_DIR}/src/requirements.txt
- pip install pylint
- pylint --rcfile=.pylintrc src/*.py
<<: *tags-definition
build:dev:
<<: *tags-definition
<<: *build-definition
only:
- master
before_script:
- export DESTINATION="--destination ${CI_REGISTRY_IMAGE}:dev-${CI_COMMIT_REF_NAME}"
- export DESTINATION="${DESTINATION} --destination=index.docker.io/${DOCKERHUB_REPO_PREFIX}/${DOCKERHUB_REPO_NAME}:dev-${CI_COMMIT_REF_NAME}"
publish:release:
<<: *tags-definition
<<: *build-definition
stage: publish
environment:
name: production
url: https://hub.docker.com/r/${DOCKERHUB_REPO_PREFIX}/${DOCKERHUB_REPO_NAME}
only:
- tags
before_script:
- export DESTINATION="--destination ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}"
- export DESTINATION="${DESTINATION} --destination ${CI_REGISTRY_IMAGE}:latest"
- export DESTINATION="${DESTINATION} --destination=index.docker.io/${DOCKERHUB_REPO_PREFIX}/${DOCKERHUB_REPO_NAME}:${CI_COMMIT_REF_NAME}"
- export DESTINATION="${DESTINATION} --destination=index.docker.io/${DOCKERHUB_REPO_PREFIX}/${DOCKERHUB_REPO_NAME}:latest"
publish:readme:
<<: *tags-definition
stage: publish
variables:
README_PATH: ${CI_PROJECT_DIR}/README.md
only:
- master
image:
name: sheogorath/readme-to-dockerhub:latest
entrypoint: ['']
script:
- node /app/index.js
include:
- remote: https://gitlab.com/ix.ai/ci-templates/raw/master/python-project.yml
......@@ -10,8 +10,9 @@ WORKDIR /app
COPY src/ /app
RUN apk --no-cache upgrade && \
apk --no-cache add python3 gcc musl-dev && \
pip3 install --no-cache-dir -r requirements.txt
apk add --no-cache python3 gcc musl-dev && \
pip3 install --no-cache-dir -r requirements.txt && \
apk del --no-cache --purge gcc musl-dev
ENV LOGLEVEL=${LOGLEVEL} FIAT=${FIAT} PORT=${PORT}
......
......@@ -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(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment