feat: CI file and docker image
This commit is contained in:
@ -1,7 +1,9 @@
|
|||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
- build
|
- build
|
||||||
|
- deploy
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- local: .gitlab/ci/test.gitlab-ci.yml
|
- local: .gitlab/ci/test.gitlab-ci.yml
|
||||||
- local: .gitlab/ci/build.gitlab-ci.yml
|
- local: .gitlab/ci/build.gitlab-ci.yml
|
||||||
|
- local: .gitlab/ci/deploy.gitlab-ci.yml
|
7
.gitlab/ci/deploy.gitlab-ci.yml
Normal file
7
.gitlab/ci/deploy.gitlab-ci.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
build:
|
||||||
|
stage: build
|
||||||
|
image: docker:stable
|
||||||
|
script:
|
||||||
|
- docker login -u $CI_DEPLOY_USER -p $CI_DEPLOY_PASSWORD $CI_REGISTRY
|
||||||
|
|
||||||
|
|
9
scripts/build_image.sh
Normal file
9
scripts/build_image.sh
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
VERSION="$(python get_replication_version.py)"
|
||||||
|
|
||||||
|
echo "Building docker image with version ${VERSION}"
|
||||||
|
docker build --no-cache --build-arg version=${VERSION} -t registry.gitlab.com/slumber/multi-user/multi-user-server:0.1.0 ./docker_server
|
||||||
|
|
||||||
|
echo "Pushing to gitlab registry ${VERSION}"
|
||||||
|
docker push registry.gitlab.com/slumber/multi-user/multi-user-server:0.1.0
|
23
scripts/docker_server/Dockerfile
Normal file
23
scripts/docker_server/Dockerfile
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Download base image debian jessie
|
||||||
|
FROM python:slim
|
||||||
|
|
||||||
|
# Infos
|
||||||
|
LABEL maintainer="Swann Martinez"
|
||||||
|
LABEL version="0.1.0"
|
||||||
|
LABEL description="Blender multi-user addon \
|
||||||
|
dedicated server image."
|
||||||
|
|
||||||
|
ARG version=0.0.21a15
|
||||||
|
|
||||||
|
# Argument
|
||||||
|
ENV password='admin'
|
||||||
|
ENV port=5555
|
||||||
|
ENV timeout=3000
|
||||||
|
ENV log_level=INFO
|
||||||
|
ENV log_file="multiuser_server.log"
|
||||||
|
|
||||||
|
#Install replication
|
||||||
|
RUN pip install replication==$version
|
||||||
|
|
||||||
|
# Run the server with parameters
|
||||||
|
CMD replication.serve -pwd ${password} -p ${port} -t ${timeout} -l ${log_level} -lf ${log_file}
|
4
scripts/get_replication_version.py
Normal file
4
scripts/get_replication_version.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import re
|
||||||
|
|
||||||
|
init_py = open("../multi_user/__init__.py").read()
|
||||||
|
print(re.search("\d+\.\d+\.\d+\w\d+|\d+\.\d+\.\d+", init_py).group(0))
|
Reference in New Issue
Block a user