From 82a82c49906ca71f1a0375addeda797d4316bf98 Mon Sep 17 00:00:00 2001 From: s3lph <1375407-s3lph@users.noreply.gitlab.com> Date: Sat, 16 Jul 2022 19:29:30 +0200 Subject: [PATCH] Use Python 3.9, build docker image with kaniko instead of mapped docker socket --- .gitlab-ci.yml | 39 ++++++++++++++++++++++++++++++--------- CHANGELOG.md | 3 ++- package/docker/Dockerfile | 2 +- 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7d19372..f8d64ae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,19 +29,40 @@ codestyle: -build_docker: +build_docker_tag: stage: build + image: + name: gcr.io/kaniko-project/executor + entrypoint: [""] script: - - docker build -t "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA" -f package/docker/Dockerfile . - - docker tag "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA" "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_REF_NAME" - - if [[ -n "$CI_COMMIT_TAG" ]]; then docker tag "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA" "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_TAG"; fi - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD registry.gitlab.com - - docker push "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA" - - docker push "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_REF_NAME" - - if [[ -n "$CI_COMMIT_TAG" ]]; then docker push "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_TAG"; fi + - mkdir -p /kaniko/.docker + - echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json + - >- + /kaniko/executor + --context . + --dockerfile package/docker/Dockerfile + --destination "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA" + --destination "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_REF_NAME" + --destination "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_TAG" + only: + - tags + +build_docker_staging: + stage: build + image: + name: gcr.io/kaniko-project/executor + entrypoint: [""] + script: + - mkdir -p /kaniko/.docker + - echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json + - >- + /kaniko/executor + --context . + --dockerfile package/docker/Dockerfile + --destination "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA" + --destination "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_REF_NAME" only: - staging - - tags build_wheel: stage: build diff --git a/CHANGELOG.md b/CHANGELOG.md index 54ae939..892b56b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,11 +3,12 @@ ## Version 0.2.10 -Feature release +Feature release, Python 3.9 ### Changes +- Use Python 3.9 by default - Feature: Let users transfer funds to another account diff --git a/package/docker/Dockerfile b/package/docker/Dockerfile index fb2166d..19c503a 100644 --- a/package/docker/Dockerfile +++ b/package/docker/Dockerfile @@ -1,5 +1,5 @@ -FROM python:3.7-alpine +FROM python:3.9-alpine ADD . / RUN mkdir -p /var/matemat/db /var/matemat/upload \