Difference between revisions of "GitLab CI: artifacts:"

From wikieduonline
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
* https://docs.gitlab.com/ee/ci/pipelines/job_artifacts.html
 
* https://docs.gitlab.com/ee/ci/pipelines/job_artifacts.html
 +
TO_MERGE [[GitLab artifacts:]]
 +
 +
 
<code>[[artifacts:]]</code>
 
<code>[[artifacts:]]</code>
  
Line 9: Line 12:
 
       - mycv.pdf
 
       - mycv.pdf
 
     [[expire_in]]: 1 week
 
     [[expire_in]]: 1 week
 +
 +
 +
 +
== Examples ==
 +
https://docs.gitlab.com/ee/ci/variables/#pass-an-environment-variable-to-another-job
 +
 +
build:
 +
  stage: build
 +
  script:
 +
    - echo "BUILD_VARIABLE=value_from_build_job" >> build.env
 +
  artifacts:
 +
    [[reports:]]
 +
      [[dotenv:]] build.env
 +
 +
deploy:
 +
  stage: deploy
 +
  variables:
 +
    BUILD_VARIABLE: value_from_deploy_job
 +
  script:
 +
    - echo "$BUILD_VARIABLE"  # Output is: 'value_from_build_job' due to precedence
 +
  environment: production
  
 
== Related ==
 
== Related ==
[[GitLab, cache:]]
+
* <code>[[GitLab, cache:|cache:]]</code>
  
 
== See also ==
 
== See also ==

Latest revision as of 11:48, 8 December 2022

TO_MERGE GitLab artifacts:


artifacts:


 artifacts:
   name: "Your name $CI_COMMIT_SHA"
   paths:
     - mycv.pdf
   expire_in: 1 week


Examples[edit]

https://docs.gitlab.com/ee/ci/variables/#pass-an-environment-variable-to-another-job

build:
  stage: build
  script:
    - echo "BUILD_VARIABLE=value_from_build_job" >> build.env
  artifacts:
    reports:
      dotenv: build.env

deploy:
  stage: deploy
  variables:
    BUILD_VARIABLE: value_from_deploy_job
  script:
    - echo "$BUILD_VARIABLE"  # Output is: 'value_from_build_job' due to precedence
  environment: production

Related[edit]

See also[edit]

Advertising: