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.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
waste of time = more pipeline run time = more $
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The default image I need is obviously microsoft/dotnet:sdk. No it does not have zip unfortunately. So I do now every build:
apt-get update && apt-get install --yes zip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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:sdk
RUN 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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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/ *.js
bash: zip: command not found
The problem was fixed by defining the version of atlassian/default-image image to version 4.
name: Create archive
image: atlassian/default-image:4
script:
- env
- npm ci --omit=dev
I hope this will help someone else.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.