Commit 104da94e authored by Philip Makedonski's avatar Philip Makedonski
Browse files

Update .gitlab-ci.yml file

parent 23cadd9b
Loading
Loading
Loading
Loading
Loading
+23 −12
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@
# * Deploy built artifacts from master branch only.

variables:
  # CI_TARGET_BRANCH: $CI_DEFAULT_BRANCH
  CI_TARGET_BRANCH: "ttf-022-maven"
  SITE_LOCATION: "updatesite/org.etsi.mts.tdl.updatesite/target"
  ARCHIVE_NAME: "org.etsi.mts.tdl.updatesite-1.0.0-SNAPSHOT.zip"
  SITE_ARCHIVE: "${SITE_LOCATION}/${ARCHIVE_NAME}"
@@ -54,6 +56,19 @@ variables:
    -DinstallAtEnd=true
    -DdeployAtEnd=true

.default_rules:
  rules:
    - if: $CI_PIPELINE_SOURCE == "schedule"
      when: never
    - if: $CI_COMMIT_BRANCH == $CI_TARGET_BRANCH
    - if: '$CI_PIPELINE_SOURCE == "web"'
      when: always
    - if: $CI_COMMIT_TAG
      when: never
    # - when: never



# This template uses the latest Maven 3 release, e.g., 3.8.6, and OpenJDK 8 (LTS)
# for verifying and deploying images
# Maven 3.8.x REQUIRES HTTPS repositories.
@@ -110,6 +125,8 @@ stages: # List of stages for jobs, and their order of execution

build-job:       # This job runs in the build stage, which runs first.
  stage: build
  rules:
    - !reference [.default_rules, rules]
  script:
    - echo "Compiling the code..."
    - cd org.etsi.mts.tdl.parent
@@ -145,10 +162,8 @@ build-job: # This job runs in the build stage, which runs first.
# Adapted from OpenAPI2TDL converter
prepare:
  stage: prepare
  # rules:
    # - if: $CI_COMMIT_TAG
      # when: never
    # - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  rules:
    - !reference [.default_rules, rules]
  script:
    - VERSION=`date +%Y%m%d.%H.%M`
    - echo "EXTRA_DESCRIPTION=automatic-release" >> variables.env
@@ -168,10 +183,8 @@ upload:
      artifacts: true
    - job: build-job
      artifacts: true
  # rules:
    # - if: $CI_COMMIT_TAG
      # when: never
    # - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  rules:
    - !reference [.default_rules, rules]
  script:
    - echo "${PACKAGE_REGISTRY_URL}/${ARCHIVE_NAME}"
    - |
@@ -191,10 +204,8 @@ release:
  needs:
    - job: prepare
      artifacts: true
  # rules:
    # - if: $CI_COMMIT_TAG
      # when: never
    # - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  rules:
    - !reference [.default_rules, rules]
  script:
    - |
      release-cli create --name "Release $VERSION" --tag-name $VERSION --ref $CI_COMMIT_SHA \