Commit b6ed7322 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Dockerization

parent e7adbd9a
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
stages:
  - build
  - generate-test-env
  - test
  - dockerize
@@ -7,6 +8,20 @@ variables:
  # to avoid "fatal: git fetch-pack: expected shallow list"
  GIT_STRATEGY: clone

build:
  stage: build
  tags:
    - docker
  only:
    refs:
      - ci-test
  script:
    - mvn clean package -DskipTests -DfinalName=vospace
  artifacts:
    paths:
      - target/vospace.jar
    expire_in: 7 days

pre_test:
  stage: generate-test-env
  tags:
@@ -37,3 +52,15 @@ test:
  coverage: '/coverage=\d+\.\d+/'
  only:
    - ci-test

dockerize:
  stage: dockerize
  tags:
    - shell
  only:
    refs:
      - ci-test
  script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker build -t $CI_REGISTRY_IMAGE .
    - docker push $CI_REGISTRY_IMAGE

Dockerfile

0 → 100644
+4 −0
Original line number Diff line number Diff line
FROM openjdk:14-jdk-alpine
ARG JAR_FILE=target/vospace.jar
COPY ${JAR_FILE} vospace.jar
ENTRYPOINT ["java","-jar","/vospace.jar"]
+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
        <java.version>11</java.version>
        <!-- File catalog repository directory -->
        <init_database_scripts_path>../../../vospace-file-catalog</init_database_scripts_path>
        <finalName>${project.artifactId}-${project.version}</finalName>
    </properties>

    <dependencies>
@@ -114,6 +115,7 @@
    </repositories>

    <build>
        <finalName>${finalName}</finalName>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>