-1

Why do we need to provide the path to the artifacts and the naming of executable after it finish building?

I tried to look up on gitlab's official documentation, which I still not quite understand, could anyone please describes it in a simpler way?

build:
  stage: build
  script: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac HelloWorld.java
  artifacts:
    paths:
     - HelloWorld.*

execute:
  stage: execute
  script: /usr/lib/jvm/java-8-openjdk-amd64/bin/java HelloWorld

for the above steps, in the build stage, I'm not quite sure what does the artifacts doing there, do I have to provide that artifacts?

Nicolas Pepinster
  • 5,413
  • 2
  • 30
  • 48

1 Answers1

0

You only need to provide the artifact path if you want that file (or files) uploaded to GitLab at the end of the job. As the commenter above noted, you can find more information in the Job Artifact documentation. Specifically, once an artifact is uploaded from a job you can browse or download that artifact later.

If you don't know why you need it, then you likely don't. Simply remove the three lines associated with artifacts in your .gitlab-ci.yml file. If your pipeline still passes, you're all set.

Drew Blessing
  • 2,595
  • 11
  • 16