...
 
Commits (2)
......@@ -4,67 +4,5 @@ variables:
DOCKERHUB_REPO_PREFIX: ixdotai
DOCKERHUB_REPO_NAME: crypto-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