Commit 40e697f7 authored by Carl Mai's avatar Carl Mai
Browse files

add ci

parent ce87f1ed
.gitlab-ci
Dockerfile
README.md
LICENSE
image: docker:latest
# mostly taken from: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
variables:
DOCKER_REPOSITORY: git-st.inf.tu-dresden.de:4567
CONTAINER_RELEASE_IMAGE: $DOCKER_REPOSITORY/stgroup/ttc18:latest
CONTAINER_TEST_IMAGE: $DOCKER_REPOSITORY/stgroup/ttc18:$CI_COMMIT_REF_NAME
stages:
- build
- test
- release
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $DOCKER_REPOSITORY
build:
stage: build
tags:
- dockered
script:
- docker build --pull -t $CONTAINER_TEST_IMAGE .
- docker push $CONTAINER_TEST_IMAGE
test_benchmark:
stage: test
tags:
- dockered
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker run $CONTAINER_TEST_IMAGE /ttc18/gradlew benchmarkFull -Pscenario=0,small 2>&1 | tee benchmarkFull.log
- ! grep "BUILD FAILED" benchmarkFull.log
test_unit_tests:
stage: test
tags:
- dockered
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker run $CONTAINER_TEST_IMAGE /ttc18/gradlew test
release-image:
stage: release
tags:
- dockered
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
- docker push $CONTAINER_RELEASE_IMAGE
only:
- master
# glpk also from https://github.com/dmccloskey/glpk/blob/master/Dockerfile
# Set the base image to Ubuntu
FROM ubuntu:latest
# Switch to root for install
USER root
RUN apt-get update -y && apt-get install -y \
openjdk-8-jdk \
libglpk-java \
glpk-utils \
--no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV HOME /home/user
RUN useradd --create-home --home-dir $HOME user \
&& chmod -R u+rwx $HOME \
&& chown -R user:user $HOME
# now prepare ttc18 folder
RUN mkdir /ttc18
RUN chown user:user -R /ttc18
USER user
WORKDIR /ttc18
# start optimization: first download
# see also here https://github.com/heroku/docker-gradle/blob/master/Dockerfile
ADD gradlew .
ADD gradle gradle
ADD gradle.properties .
ADD gradle gradle
ADD settings.gradle .
# following is not used as it needs too much maintenance
# ADD jastadd-mquat-solver-ilp/build.gradle jastadd-mquat-solver-ilp/build.gradle
# ADD jastadd-mquat-solver/build.gradle jastadd-mquat-solver/build.gradle
# ADD jastadd-mquat-base/build.gradle jastadd-mquat-base/build.gradle
# ADD jastadd-mquat-base/jastadd_modules jastadd-mquat-base/jastadd_modules
# ADD jastadd-mquat-solver-aco/build.gradle jastadd-mquat-solver-aco/build.gradle
# ADD jastadd-mquat-solver-emfer/build.gradle jastadd-mquat-solver-emfer/build.gradle
# ADD jastadd-mquat-solver-simple/build.gradle jastadd-mquat-solver-simple/build.gradle
# ADD jastadd-mquat-benchmark/build.gradle jastadd-mquat-benchmark/build.gradle
RUN ./gradlew --no-daemon --stacktrace build; true
RUN ./gradlew --no-daemon --stacktrace dependencies; true
# end optimization: first download
ADD . .
USER root
RUN chown user:user -R /ttc18
USER user
RUN echo "glpkPath = /usr/lib/x86_64-linux-gnu/jni" > gradle.properties
RUN sed -i '/jastadd-mquat-solver-emfer/d' settings.gradle
#RUN sed -i '/jastadd-mquat-solver-emfer/d' jastadd-mquat-benchmark/build.gradle
#RUN sed -i '/EMFeRSolver/d' jastadd-mquat-benchmark/src/main/java/de/tudresden/inf/st/mquat/benchmark/SolverFactory.java
RUN echo "test.enabled = false" > ./jastadd-mquat-solver-emfer/build.gradle
#RUN echo "test.enabled = false" > ./jastadd-mquat-solver-random/build.gradle
RUN sed -i 's/MINUTES/SECONDS/g' jastadd-mquat-benchmark/src/main/resources/scenarios.json
# then build
RUN ./gradlew --no-daemon assemble
RUN ./gradlew --no-daemon compileTestJava
RUN ./gradlew --no-daemon compileJava
#RUN ./gradlew test
#RUN ./gradlew benchmarkFull -Pscenario=0,small
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