Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab Pipelines: zip: command not found after installing zip on docker image?

I'm trying to zip my dist folder and post to it Azure's kudu zipdeploy endpoint but I keep getting this error regardless of the fact that I have installed a zipping package myself.

My docker image: weltn24/up-docker-node-chrome-headless on tag: chrome-66_node-10.0_yarn-1.6.0

The part that fails in my yml file:

build:
  stage: build
  script:
    - apt-get install p7zip p7zip-full
    - yarn install
    - ./node_modules/@angular/cli/bin/ng build --prod
    - cd dist/AngularTemplate; zip -r ../dist.zip *; cd ..; cd..
  artifacts:
    paths:
      - dist.zip

The commands on the 4'th line is failing with zip: command not found.

like image 415
SebastianG Avatar asked Nov 12 '18 12:11

SebastianG


People also ask

What is the zip command in Linux?

The zip command is a command-line tool in Linux that allows us to create an archive of files and directories. Besides that, it also provides a multitude of functionalities for manipulating an archive.


1 Answers

Correct script below:

build:
  stage: build
  script:
    - apt-get install zip unzip
    - yarn install
    - ./node_modules/@angular/cli/bin/ng build --prod
    - cd dist/AngularTemplate; zip -r ../../dist.zip *; cd ..; cd..
  artifacts:
    paths:
      - dist.zip

Was installing the wrong Zip package and then puttin my archive in the wrong folder.

like image 167
SebastianG Avatar answered Nov 15 '22 05:11

SebastianG