From 631a31530bb1c02e8e89d746eb3d363e717c44a3 Mon Sep 17 00:00:00 2001 From: mo khan Date: Sun, 11 Aug 2019 19:08:35 -0600 Subject: build image and test in that --- .dockerignore | 7 +++++++ .gitlab-ci.yml | 20 ++++++++++++-------- Dockerfile | 12 ++++++++++++ 3 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a5348b2 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git +target +tmp +node_modules +*.pdf +pkg +*.class diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 01b5a89..08706cc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,30 +1,34 @@ -image: maven +image: alpine:latest stages: + - build - test - release -before_script: - - apt-get update && apt-get install -y locales - - echo "en_US.UTF-8 UTF-8" > /etc/locale.gen - - locale-gen - - export LC_ALL=en_US.UTF-8 +build: + image: docker:stable + stage: build + script: + - docker info + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + - docker build . -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA test: + image: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA stage: test script: - mvn verify doc: + image: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA stage: test script: - mvn javadoc:javadoc publish: + image: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA stage: release script: - - apt-get install -y ruby-full - - gem install bundler:'~> 2.0' - bundle exec rake publish artifacts: paths: diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3dfd537 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM alpine:latest +MAINTAINER mo@mokhan.ca + +RUN apk update && \ + apk upgrade && \ + apk add openjdk8 maven ruby nodejs yarn && \ + gem install bundler:'~> 2.0' --no-document && \ + mkdir -p /code + +WORKDIR /code +COPY . /code +RUN bundle install --jobs $(nproc) && yarn install && mvn install -- cgit v1.2.3