Commit 631a315

mo khan <mo@mokhan.ca>
2019-08-12 01:08:35
build image and test in that
1 parent c81dad4
.dockerignore
@@ -0,0 +1,7 @@
+.git
+target
+tmp
+node_modules
+*.pdf
+pkg
+*.class
.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:
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