实际上,我的zip文件位于gitlab上,我想使用gitlab CI / CD提取这些文件。我已经在.gitlab-ci.yml中进行了尝试:
image: docker
stages:
- build
- test
services:
- docker:dind
build:
before_script:
- apk add p7zip
script:
- cd \kmfs
- 7z x -oChassisA ChassisA.zip
输出
$ apk add p7zip
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/3) Installing libgcc (6.4.0-r9)
(2/3) Installing libstdc++ (6.4.0-r9)
(3/3) Installing p7zip (16.02-r3)
Executing busybox-1.28.4-r3.trigger
OK: 11 MiB in 17 packages
$ cd \kmfs
$ 7z x -oChassisA ChassisA.zip
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=C.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU Intel(R) Xeon(R) CPU @ 2.30GHz (306F0),ASM,AES-NI)
Scanning the drive for archives:
1 file, 3638943 bytes (3554 KiB)
Extracting archive: ChassisA.zip
--
Path = ChassisA.zip
Type = zip
Physical Size = 3638943
Everything is Ok
Folders: 1
Files: 4
Size: 24070952
Compressed: 3638943
Job succeeded
它执行成功,但是提取的文件未反映在gitlab存储库中,并且我无法使用在测试阶段编写的node js代码访问这些文件。
因此,如果有人建议我使用命令或从nodejs代码中提取gitlab上的.zip文件的方式非常好……
答案 0 :(得分:0)
您需要在工作中使用工件,以声明提取的zip的路径。这将允许后续作业访问这些文件。
artifacts:
when: always
expire_in: 1 week
paths:
- zip files folder structure after its extracted