Skip to content
Snippets Groups Projects
Commit 134eddf0 authored by Moul's avatar Moul
Browse files

[ci] #388: Add image generation build automation

Introduce Dockerfile based on latest Python available
Install silkaj and make it available to the CLI

Manual triggered job to generate the image
Definition as an extensible job for future usages
Rename stage
parent 889f823e
No related branches found
No related tags found
No related merge requests found
stages:
- checks
- tests
- publish
- package
- coverage
variables:
......@@ -76,8 +76,30 @@ tests-3.9:
variables:
PYTHON_VERSION: "3.9"
.container:
stage: package
tags: [docker]
image: docker:latest
services:
- docker:dind
script:
- docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY
- docker build --pull -t "$CI_REGISTRY_IMAGE:$IMAGE_TAG" .
- docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY
- docker tag "$CI_REGISTRY_IMAGE:$IMAGE_TAG" "$CI_REGISTRY_IMAGE:$IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE:$IMAGE_TAG"
- docker tag "$CI_REGISTRY_IMAGE:$IMAGE_TAG" "$CI_REGISTRY_IMAGE:latest"
- docker push "$CI_REGISTRY_IMAGE:latest"
container:
extends: .container
variables:
IMAGE_TAG: "dev"
rules:
- when: manual
pypi_test:
stage: publish
stage: package
rules:
- if: $CI_COMMIT_TAG
when: manual
......@@ -86,7 +108,7 @@ pypi_test:
- poetry publish --build --username $PYPI_TEST_LOGIN --password $PYPI_TEST_PASSWORD --repository pypi_test
pypi:
stage: publish
stage: package
rules:
- if: $CI_COMMIT_TAG
when: manual
......
FROM registry.duniter.org/docker/python3/poetry/3.9:latest
WORKDIR /silkaj
# Install Silkaj
RUN poetry install
# Set up alias to directly get silkaj command
# https://stackoverflow.com/a/3638886
RUN printf '#!/bin/bash\npoetry run silkaj "$@"' > /usr/bin/silkaj && \
chmod +x /usr/bin/silkaj
CMD ["/usr/bin/silkaj"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment