Skip to content
Snippets Groups Projects
Commit 19a88a27 authored by Lucas Fernandes de Oliveira's avatar Lucas Fernandes de Oliveira
Browse files

Added Dockerfile for Apr2019

parent d7d7c671
No related branches found
No related tags found
No related merge requests found
variables:
image_version: '11.33.3'
DOCKER_URL: 'dockerregistry.c3sl.ufpr.br:5000/c3sl/monetdb-ci-service'
stages:
- build
- deploy
build:
stage: build
script:
- docker build -t ${DOCKER_URL}:${image_version} -t ${DOCKER_URL}:latest .
tags:
- docker
- build
deploy:
stage: deploy
script:
- docker push ${DOCKER_URL}:${image_version}
- docker push ${DOCKER_URL}:latest
tags:
- docker
- build
only:
- master
......@@ -44,7 +44,7 @@ RUN yum install -y https://www.monetdb.org/downloads/epel/MonetDB-release-epel.n
RUN yum update -y && \
yum upgrade -y
ARG MonetDBVersion=11.31.7
ARG MonetDBVersion=11.33.3
# Install MonetDB server
RUN yum install -y MonetDB-$MonetDBVersion \
......@@ -89,3 +89,14 @@ RUN su -c 'sh /home/monetdb/init-db.sh' monetdb
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
# CUSTOM
ENV MONETDB_NAME dbmonet
ENV MONETDB_USER dbmonet
ENV MONETDB_PASSWORD dbmonet
WORKDIR /home/monetdb
COPY script.sh /etc/script/script.sh
CMD ["/bin/bash", "/etc/script/script.sh"]
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf &
# the first argument will the database name
condition=true
while $condition ; do
# it will create a database called monetdb
monetdb create $MONETDB_NAME
# $? is the result 0 for sucess 1 for err
try=$?
if [ $try == "0" ]
then
# the test has succeed
condition=false
else
# the test has failed will try again in 5s
sleep 5s
fi
done
monetdb release $MONETDB_NAME
# .monetdb will be read when mclient is called without user and password
echo "user=monetdb" > .monetdb
echo "password=monetdb" >> .monetdb
mclient -d $MONETDB_NAME -s "create user \"$MONETDB_USER\" with password '$MONETDB_PASSWORD' name 'ci' schema \"sys\"";
echo "user=$MONETDB_USER" > .monetdb
echo "password=$MONETDB_PASSWORD" >> .monetdb
wait
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment