javafxgitlab-cimaven-3

gitlab CI/CD pipeline will not run stage "deploy"


I have a gitlab project here: gitlab_project

and run successfully a CI pipeline for stages "build" and "test" in my gitlab-ci.yml, which is as follows:

stages:
  - build
  - test
  - deploy

variables:
  MAVEN_OPTS: '-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true'
  MAVEN_CLI_OPTS: '--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true'

# For other maven/openjdk versions see: https://hub.docker.com/_/maven/
image: maven:3.6.3-openjdk-17
cache:
  paths:
    - .m2/repository

build:openjdk17:
  stage: build
  script:
    - mvn $MAVEN_CLI_OPTS compile

.verify: &verify
  stage: test
  script:
    - 'mvn $MAVEN_CLI_OPTS verify'
verify:openjdk17:
  <<: *verify

deploy:openjdk17:
  stage: deploy
  script:
    - 'mvn $MAVEN_CLI_OPTS clean javafx:jlink com.coderplus.maven.plugins:copy-rename-maven-plugin:1.0:copy'
  only:
    - master

But stage "deploy" will not execute! How do I automatically execute stage "deploy", too?

Thanks in advance!

I expected all three stages to execute: build, test and deploy but the last one is skipped and not even mentioned by the log.

This is the build job: build_log

and this is the test job: verify_log


Solution

  • I checked you repository and I can't find any branch named master, you should probably replace master with main in your gitlab-ci.yml.