Commit 12538c51 authored by Eduard Štefan Mlynárik's avatar Eduard Štefan Mlynárik
Browse files

Merge branch '#66-checking-pipeline-caching' into 'master'

#66 fixed pipeline caching, modified pipeline

See merge request !33
parents 12631a8b 7a4e7a38
Loading
Loading
Loading
Loading
Loading
+44 −16
Original line number Diff line number Diff line
image: maven:3-amazoncorretto-21

cache:
  paths:
    - .m2/repository

variables:
  MAVEN_REPO_CACHE: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
  MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
  MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version"

stages:
  - build
  - test

####################
# Customer Service #
####################
build-customer-service:
  tags:
    - shared-fi
  stage: build
  script:
    - echo "Running app compilation"
    - mvn $MAVEN_REPO_CACHE clean install -pl customer-service -am -DskipTests
    - mvn $MAVEN_CLI_OPTS clean install  -pl customer-service -am -DskipTests
  artifacts:
    paths:
      - customer-service/target/*.jar
    expire_in: 1 day

test-customer-service:
  tags:
    - shared-fi
@@ -23,17 +34,23 @@ test-customer-service:
  needs: [build-customer-service]
  script:
    - echo "Running tests"
    - mvn $MAVEN_REPO_CACHE test -pl customer-service -am
# TODO add deployment job?

    - mvn $MAVEN_CLI_OPTS test -pl customer-service -am

######################
# Harvest Management #
######################
build-harvest-management:
  tags:
    - shared-fi
  stage: build
  script:
    - echo "Running app compilation"
    - mvn $MAVEN_REPO_CACHE clean install -pl harvest-management -am -DskipTests
    - mvn $MAVEN_CLI_OPTS clean install -pl harvest-management -am -DskipTests
  artifacts:
    paths:
      - harvest-management/target/*.jar
    expire_in: 1 day

test-harvest-management:
  tags:
    - shared-fi
@@ -41,17 +58,23 @@ test-harvest-management:
  needs: [build-harvest-management]
  script:
    - echo "Running tests"
    - mvn $MAVEN_REPO_CACHE test -pl harvest-management -am
# TODO add deployment job?

    - mvn $MAVEN_CLI_OPTS test -pl harvest-management -am

########################
# Inventory Management #
########################
build-inventory-management:
  tags:
    - shared-fi
  stage: build
  script:
    - echo "Running app compilation"
    - mvn $MAVEN_REPO_CACHE clean install -pl inventory-management -am -DskipTests
    - mvn $MAVEN_CLI_OPTS clean install -pl inventory-management -am -DskipTests
  artifacts:
    paths:
      - inventory-management/target/*.jar
    expire_in: 1 day

test-inventory-management:
  tags:
    - shared-fi
@@ -59,17 +82,23 @@ test-inventory-management:
  needs: [build-inventory-management]
  script:
    - echo "Running tests"
    - mvn $MAVEN_REPO_CACHE test -pl inventory-management -am
# TODO add deployment job?

    - mvn $MAVEN_CLI_OPTS test -pl inventory-management -am

###################
# Wine Production #
###################
build-wine-production:
  tags:
    - shared-fi
  stage: build
  script:
    - echo "Running app compilation"
    - mvn $MAVEN_CACHE clean install -pl wine-production -am -DskipTests
    - mvn $MAVEN_CLI_OPTS clean install -pl wine-production -am -DskipTests
  artifacts:
      paths:
        - wine-production/target/*.jar
      expire_in: 1 day

test-wine-production:
  tags:
    - shared-fi
@@ -77,5 +106,4 @@ test-wine-production:
  needs: [build-wine-production]
  script:
    - echo "Running tests"
    - mvn $MAVEN_CACHE test -pl wine-production -am
# TODO add deployment job?
    - mvn $MAVEN_CLI_OPTS test -pl wine-production -am