Is zip, or any other compressor program that producing zip archives available in pipelines?
Azure Function pipe works with zip archives only.
But how to produce the archive in a pipeline ?
If the Docker image you're using has zip built in, or if you install zip as part of the pipeline (perhaps with apt), then you can use zip in Bitbucket Pipelines.
@chudinov the default image: atlassian/default-image:2 has already zip installed. You could use that one.
Also, here you can see an example using Azure Web Apps Pipe: https://bitbucket.org/microsoft/example-azure-web-apps-deploy/src/master/bitbucket-pipelines.yml
The default image I use for build dot net application does not have zip. So I use apt-get to install every time before build with
apt-get update && apt-get install --yes zip
what a wasting of time!
The default image I need is obviously microsoft/dotnet:sdk. No it does not have zip unfortunately. So I do now every build:
@chudinov you can also build your own docker image, and host it for free up on Dockerhub. Any tools you required for your pipeline can be added to the image, simplifying your pipeline.
An example Dockefile:
FROM microsoft/dotnet:sdkRUN apt-get update && apt-get install -y zip# Install any other tooling you need.
In your bitbucket-pipelines.yml file, you can then specify the image you've built at either the pipeline or the step level.
I had the exactly same issue with a dotnet sdk and a need to zip the file and SFTP to a remote server after a small struggle I managed to resolve if anyone needs let me know.. since this is an old post....
Hi,I'm executing the command - dotnet build $PROJECT_NAME
Here once build successful, wanted to convert it to zip file before publishing it to SFTP
Please let me know how it was work for you.
waste of time = more pipeline run time = more $
Hello
Had the same problem, zip command was not found when I used atlassian/default-image in my pipeline. The global env had attached all known paths but whereis command didn't find the zip binary location.
$PATH=/root/.nvm:/bin/versions/node/v4.2.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ zip -r $BITBUCKET_REPO_SLUG.zip cfg/ client/ node_modules/ src/ *.jsbash: zip: command not found
The problem was fixed by defining the version of atlassian/default-image image to version 4.
name: Create archiveimage: atlassian/default-image:4script:- env- npm ci --omit=dev
I hope this will help someone else.
It looks like you're new here. Sign in or register to get started.