Commit aaba06ff authored by Philip ABBET's avatar Philip ABBET
Browse files

Initial commit

parents
Pipeline #8141 passed with stage
in 6 minutes and 13 seconds
stages:
- build
- deploy
variables:
DOCKER_REGISTRY: docker.idiap.ch
before_script:
- docker info
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN docker.idiap.ch
build:
stage: build
only:
- /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
variables:
CONTAINER_NAME: $DOCKER_REGISTRY/$CI_PROJECT_PATH:$CI_BUILD_REF_NAME
script:
- CONTAINER_NAME=${CONTAINER_NAME/:v/:};
- docker build --rm=true --no-cache=true -t $CONTAINER_NAME .
- docker images $CONTAINER_NAME
tags:
- docker-build
# Deploys 'push*' tags, using an existing 'vX.Y.Z' tag on the same commit
deploy_version:
stage: deploy
only:
- /^push/ # Only for tags starting with 'push'
script:
- ALL_TAGS=`git tag --contains $CI_BUILD_REF`
- for TAG in $ALL_TAGS;
do
if [[ $TAG =~ ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+([abc][[:digit:]]*)?$ ]]; then
CONTAINER_NAME=$DOCKER_REGISTRY/$CI_PROJECT_PATH:$TAG;
break;
fi;
done
- CONTAINER_NAME=${CONTAINER_NAME/:v/:}
- docker push $CONTAINER_NAME
environment:
name: registry
tags:
- docker-build
###############################################################################
# #
# Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# This file is part of the beat.env.db.examples module of the BEAT platform. #
# #
# Commercial License Usage #
# Licensees holding valid commercial BEAT licenses may use this file in #
# accordance with the terms contained in a written agreement between you #
# and Idiap. For further information contact tto@idiap.ch #
# #
# Alternatively, this file may be used under the terms of the GNU Affero #
# Public License version 3 as published by the Free Software and appearing #
# in the file LICENSE.AGPL included in the packaging of this file. #
# The BEAT platform is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY #
# or FITNESS FOR A PARTICULAR PURPOSE. #
# #
# You should have received a copy of the GNU Affero Public License along #
# with the BEAT platform. If not, see http://www.gnu.org/licenses/. #
# #
###############################################################################
FROM debian:8.4
MAINTAINER Philip Abbet <philip.abbet@idiap.ch>
RUN set -ex \
# Install the needed packages
&& build_deps=' \
git \
python-dev \
python-pip \
' \
&& runtime_deps=' \
python-gevent \
python-numpy \
python-pkg-resources \
python-requests \
python-zmq \
pkg-config \
' \
&& apt-get update \
&& apt-get install -y $build_deps \
&& apt-get install -y $runtime_deps \
&& pip install --upgrade setuptools \
&& pip install markerlib \
# Install the beat packages
&& pip install -e git+https://gitlab.idiap.ch/beat/beat.backend.python.git@v1.1.0#egg=beat.backend.python \
# Cleanup
&& apt-get purge -y --auto-remove $build_deps \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& adduser --no-create-home --disabled-password --disabled-login --gecos "" -q beat-nobody
# Customisation of the environment
ADD environment.json /etc/beat/
# BEAT example databases environment
This package contains docker instructions for building a container for the
example databases of the BEAT platform.
## Usage
To test the creation of a container on your machine, run the following command:
```sh
$ docker build --rm=true -t docker.idiap.ch/beat/beat.env.db.examples:latest .
```
## Integration with Gitlab CI
By default, nothing is done on the CI when commits are pushed to the Gitlab
repository.
To trigger the build of a docker image, push a tag of the form *vX.Y.Z*. This
will create an image with the name *docker.idiap.ch/beat/beat.env.db.examples:X.Y.Z*.
To trigger the upload of the image to the *docker.idiap.ch* registry, you can push
a special tag (see below). Note that the commit you are tagging **must** also have
a *vX.Y.Z* tag, and that this build must have successfully passed.
The special tag must start with *push* (examples: *push*, *push_thisversion*).
This will upload the image with the name *docker.idiap.ch/beat/beat.env.db.examples:X.Y.Z*
{
"name": "Example databases",
"version": "1.0.0",
"databases": [
"integers_db/1",
"simple/1"
]
}
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