Commit 780fe7ad authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Añade plantilla de construcción con mvnw

parent 0a0a70bf
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ All templates at root level (except `deprecation-warning.yml`) are deprecated, b

### Building

#### Maven
#### Maven [legacy]

Build an application with Maven, using [`redmic-project/docker/maven`](https://gitlab.com/redmic-project/docker/maven).

@@ -72,6 +72,14 @@ Build an application with Maven, using [`redmic-project/docker/maven`](https://g
* **library.yml**: Build a library project. Run at `build` stage.
* **microservice.yml**: Build a microservice project. Run at `build` stage.

#### MVNW

Build an application with Maven Wrapper (**MVNW**), using [`redmic-project/docker/maven`](https://gitlab.com/redmic-project/docker/maven).

Requires using `maven >= v3.9.0` and using a project with `mvnw` available.

* **building.yml**: Build a microservice project. Run at `build` stage.

### Deployment external service

Deploy ancillary services (predefined externally) to your main service.
+28 −0
Original line number Diff line number Diff line
.mvnw-build:
  image: ${MAVEN_IMAGE_NAME}:${MAVEN_IMAGE_TAG}
  variables:
    MAVEN_IMAGE_NAME: registry.gitlab.com/redmic-project/docker/maven
    MAVEN_IMAGE_TAG: latest
    APP_NAME: ${CI_PROJECT_NAME}
    APP_ROOT_PATH: '.'
    APP_BUILT_PATH: target
    MVNW_VERBOSE: 'false'
    MAVEN_OPTS: -Dmaven.repo.local=.m2/repository
    MAVEN_ARGS: -pl :${APP_NAME} -U -B
    MAVEN_GOALS: clean
    SPRING_PROFILES_ACTIVE: test
  script:
    - ./mvnw ${MAVEN_GOALS}
  cache:
    paths:
      - .m2/repository/
  artifacts:
    name: '${APP_NAME}-${CI_COMMIT_REF_NAME}'
    expire_in: '6 months'
    paths:
      - ${APP_ROOT_PATH}/${APP_BUILT_PATH}/*.jar
  rules:
    - if: $CI_MERGE_REQUEST_ID ||
          $CI_PIPELINE_SOURCE == "schedule"
      when: never
    - if: $CI_COMMIT_BRANCH || $CI_COMMIT_TAG
+9 −0
Original line number Diff line number Diff line
include:
  - local: '/building/mvnw/_base.yml'

mvnw-build:
  extends: .mvnw-build
  stage: build
  variables:
    APP_BUILT_PATH: dist
    MAVEN_GOALS: clean verify spring-boot:repackage