update ci

This commit is contained in:
Abel Luck 2023-11-07 15:26:58 +01:00
parent 973e1fd789
commit e175a2e4c7

View file

@ -1,30 +1,26 @@
--- ---
services:
- docker:dind
stages: stages:
- check - check
- build - build
variables:
UNIQUE_IMAGE: registry.gitlab.com/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}:$CI_COMMIT_SHORT_SHA
REF_IMAGE: registry.gitlab.com/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}:$CI_COMMIT_REF_NAME
check: check:
image: python:3.11-bullseye image: python:3.11-bullseye
stage: check stage: check
script: script:
- apt-get update - apt-get update
- apt-get install -y make libolm-dev python3-poetry - apt-get install -y make libolm-dev python3-poetry
- poetry config virtualenvs.create false
- poetry install - poetry install
- make check - make check
variables:
UNIQUE_IMAGE: registry.gitlab.com/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}:$CI_COMMIT_SHORT_SHA
REF_IMAGE: registry.gitlab.com/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}:$CI_COMMIT_REF_NAME
build-test: build-test:
image: docker:git image: docker:latest
stage: build stage: build
script: script:
- echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin registry.gitlab.com - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# speed up build time by pulling the old image # speed up build time by pulling the old image
- docker pull registry.gitlab.com/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}:main - docker pull registry.gitlab.com/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}:main
- docker build -t $UNIQUE_IMAGE . - docker build -t $UNIQUE_IMAGE .
@ -37,7 +33,7 @@ build:
image: docker:git image: docker:git
stage: build stage: build
script: script:
- echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin registry.gitlab.com - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# speed up build time by pulling the old image # speed up build time by pulling the old image
- docker pull registry.gitlab.com/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}:main - docker pull registry.gitlab.com/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}:main
- docker build --no-cache -t $UNIQUE_IMAGE . - docker build --no-cache -t $UNIQUE_IMAGE .