[英]Is there a way to download file(output by ci job) from browser in gitlab ci?
我可以在gitlab-ci.yaml
配置中運行腳本來構建我的項目。有沒有辦法讓 pipline 通過瀏覽器的構建腳本下載文件 output,然后我可以在我的電腦中找到它?
您可以從管道中的命令 output 創建作業工件(例如您的構建腳本),假設您已在文件中重定向 output。
然后,您可以使用 GitLab UI 或API下載作業工件。
使用GitLab CLI glab :
glab ci artifact <refName> <jobName> [flags]
# example
glab ci artifact main build
這是我的 ci 配置,用於通過artifact
字段在 Gitlab UI 上下載構建文件。
stages:
- build
.build-base:
stage: build
script:
- cd dev/${APP_PATH}
- yarn ${BUILD_SCRIPT}
when: manual
after_script:
- mv dev/${APP_PATH}/dist ./${APP_OUTPUT_NAME}
artifacts:
paths:
- ./${APP_OUTPUT_NAME}
expire_in: 2 week
name: ${APP_OUTPUT_NAME}_${CI_JOB_ID}
tags:
- kube-runner
order_workbench_sit_build:
extends: .build-base
variables:
APP_PATH: 'order-management'
BUILD_SCRIPT: 'build:sit'
APP_OUTPUT_NAME: 'order_workbench_sit'
order_workbench_build:
extends: .build-base
variables:
APP_PATH: 'order-management'
BUILD_SCRIPT: 'build'
APP_OUTPUT_NAME: 'order_workbench'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.