jenkins-infra / jenkins-maven-cd-action

1 stars 7 forks source link

No .gitignore results artifact on artifactory but no release in github #11

Closed ikedam closed 2 years ago

ikedam commented 2 years ago

Without .gitignore (or no /target in .gitignore) results following error:

https://github.com/jenkinsci/editable-choice-plugin/runs/3639362233?check_suite_focus=true

+ mvn -B -V -s /home/runner/work/_actions/jenkins-infra/jenkins-maven-cd-action/v1.1.0/settings.xml -ntp -Dstyle.color=always -Dset.changelist -DaltDeploymentRepository=maven.jenkins-ci.org::default::https://repo.jenkins-ci.org/releases/ -Pquick-build '-P!consume-incrementals' clean deploy
...
[INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ editable-choice ---
[INFO] Using alternate deployment repository maven.jenkins-ci.org::default::https://repo.jenkins-ci.org/releases/
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:41 min
[INFO] Finished at: 2021-09-18T08:01:17Z
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "consume-incrementals" could not be activated because it does not exist.
++ mvn -B -ntp -Dset.changelist -Dexpression=project.version -q -DforceStdout help:evaluate
Error: on='[ERROR] Make sure `git status -s` is empty before using -Dset.changelist: [target/antrun/build-main.xml, ...] (use -Dignore.dirt to make this nonfatal) -> [Help 1]
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error:  
Error:  For more information about the errors and possible solutions, please read the following articles:
Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException'
Error: Process completed with exit code 1.

Following attempts for the same commit result: https://github.com/jenkinsci/editable-choice-plugin/actions/runs/1248135557/attempts/2

+ mvn -B -V -s /home/runner/work/_actions/jenkins-infra/jenkins-maven-cd-action/v1.1.0/settings.xml -ntp -Dstyle.color=always -Dset.changelist -DaltDeploymentRepository=maven.jenkins-ci.org::default::https://repo.jenkins-ci.org/releases/ -Pquick-build '-P!consume-incrementals' clean deploy
...
[INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ editable-choice ---
[INFO] Using alternate deployment repository maven.jenkins-ci.org::default::https://repo.jenkins-ci.org/releases/
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:40 min
[INFO] Finished at: 2021-09-18T08:24:55Z
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "consume-incrementals" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project editable-choice: Failed to deploy artifacts: Could not transfer artifact io.jenkins.plugins:editable-choice:hpi:56.vbc1258092a17 from/to maven.jenkins-ci.org (https://repo.jenkins-ci.org/releases/): authorization failed for https://repo.jenkins-ci.org/releases/io/jenkins/plugins/editable-choice/56.vbc1258092a17/editable-choice-56.vbc1258092a17.hpi, status: 403 Forbidden -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Error: Process completed with exit code 1.

This results:

No .gitignore can be a case when generating from archtype for jenkinsci/archetypes/issues/250 .

ikedam commented 2 years ago

This happens here:

version=$(mvn -B -ntp -Dset.changelist -Dexpression=project.version -q -DforceStdout help:evaluate)

Possible solutions:

A: Ignore dirties in git repository. B: Calculate version before building.

jglick commented 2 years ago

Will not fix—you should just make sure your .gitignore is complete.