Commit 5d4f8ceb authored by Bengfort's avatar Bengfort
Browse files

Merge branch 'update-ci' into 'main'

align docker and CI with castellum

See merge request !19
parents 595c581a 7469a38b
Pipeline #10756 passed with stages
in 2 minutes and 52 seconds
image: docker
services:
- docker:dind
stages:
- test
- build
- release
variables:
DEBIAN_FRONTEND: noninteractive
PYTHON_IMAGE: buildpack-deps
PYTHON_IMAGE_DEPENDENCIES: "python3-pip python3-psycopg2"
CONTAINER_TEST_IMAGE: registry.git.mpib-berlin.mpg.de/castellum/castellum_scheduler:$CI_COMMIT_REF_NAME
CONTAINER_RELEASE_IMAGE: registry.git.mpib-berlin.mpg.de/castellum/castellum_scheduler:latest
CONTAINER_IMAGE: registry.git.mpib-berlin.mpg.de/castellum/castellum_scheduler
test-branch:
test:
stage: test
image: $PYTHON_IMAGE
script:
image: buildpack-deps
before_script:
- apt-get update -q && apt-get install -y -qq $PYTHON_IMAGE_DEPENDENCIES
- pip3 install -e .[test]
script:
- flake8
- django-admin makemigrations --dry-run --check --noinput --settings=scheduler.settings.development
- django-admin test --settings=scheduler.settings.development
build:
stage: build
script:
image: docker
services:
- docker:dind
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.git.mpib-berlin.mpg.de
- docker build -t $CONTAINER_TEST_IMAGE .
- docker push $CONTAINER_TEST_IMAGE
- docker image ls
release-image:
stage: release
- docker pull $CONTAINER_IMAGE:latest
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.git.mpib-berlin.mpg.de
- docker pull $CONTAINER_TEST_IMAGE
- docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
- docker push $CONTAINER_RELEASE_IMAGE
only:
- master
- docker build --cache-from $CONTAINER_IMAGE:latest -t $CONTAINER_IMAGE:$CI_COMMIT_REF_NAME .
after_script:
- >
if [ "$CI_COMMIT_REF_NAME" == "main" ]; then
docker tag $CONTAINER_IMAGE:$CI_COMMIT_REF_NAME $CONTAINER_IMAGE:latest
docker push $CONTAINER_IMAGE:latest
fi
- >
if [ -n "$CI_COMMIT_TAG" ]; then
docker tag $CONTAINER_IMAGE:$CI_COMMIT_REF_NAME $CONTAINER_IMAGE:stable
docker push $CONTAINER_IMAGE:$CI_COMMIT_REF_NAME
docker push $CONTAINER_IMAGE:stable
fi
FROM node:14.15.4
FROM node:14.17.3
COPY package.json .
RUN npm install --production
FROM alpine:3.13.1
FROM alpine:3.13.5
ENV PYTHONUNBUFFERED 1
ENV PKGS gettext python3 py3-pip py3-wheel uwsgi uwsgi-python py3-psycopg2 py3-pyldap
......@@ -11,14 +11,15 @@ RUN adduser -D -g '' uwsgi
RUN apk update && apk add $PKGS
COPY scheduler/ code/scheduler/
COPY setup.cfg setup.py uwsgi.ini LICENSE code/
COPY --from=0 node_modules/ code/node_modules/
WORKDIR code/
COPY setup.cfg setup.py uwsgi.ini LICENSE ./
COPY --from=0 node_modules/ node_modules
RUN pip3 install -e . && \
pip3 install django-auth-ldap
COPY scheduler/ scheduler
RUN django-admin collectstatic --no-input --settings=scheduler.settings.development && \
django-admin compilemessages -l de
......
......@@ -8,10 +8,10 @@ license = AGPL-3.0-or-later
include_package_data = True
packages = find:
install_requires =
Django == 3.2.3
django-bootstrap4 == 3.0.1
django-npm == 1.0.0
requests == 2.25.1
Django == 3.2.6
django-bootstrap4 == 3.0.1
django-npm == 1.0.0
requests == 2.26.0
[options.extras_require]
test =
......
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