It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Which value i have to place for ZIP_FILE in .yml file.

while am doing auto deploying code from bit bucket to heroku, I got some configuration issue in bitbucket-pipelines.yml.

 HEROKU_API_KEY: 'XXXXXX'
 HEROKU_APP_NAME: 'XXXX'
 ZIP_FILE: 'your-app-sources.tar.gz'
 WAIT: 'true'

Above is the configuration for Heroku.

But while deploying it gives me an error near "ZIP_FILE":'..'

like that mentioned file/folder not found.

My question is which value i have to place for "ZIP_FILE":'XXXX'.

Please help me to go forward.

Note: am doing auto deployment from bitbucket to heroku for any push done on master b

2 answers

0 votes

Hi @srinu ch . The value of the ZIP_FILE variable should be a path to the tar.gz file containing a valid Heroku application sources.  Here is an example how to package and deploy a simple Java Spring Boot application:  Deploy to Heroku. 

Thank you for your information.

But application is Angular JS. while building my application we created dist folder with minified code.

Then how i can give that source file path.

You have to create a tar.gz from your dist folder and use the path to this tar.gz a ZIP_FILE:

- step:
        name: Create artifact
        script:
          - tar czfv application.tgz dist/
        artifacts:
          - application.tgz
    - step:
        name: Deploy to production
        deployment: production
        script:
          - pipe: atlassian/heroku-deploy:0.1.1
            variables:
              HEROKU_API_KEY: $HEROKU_API_KEY
              HEROKU_APP_NAME: $HEROKU_APP_NAME
              ZIP_FILE: "application.tgz"

image.pngHi I got above error, while running Create artifact step.
Could you please help me on this. Where is my dist folder created and which path i have to mentioned.

You should remove the leading slash from the /dist, otherwise tar will try to look up the dist folder relative to the root directory. You should use either dist or dist/ (with a trailing stash) to specify the directory relative to the build directory. Note, that the build directory is not a root directory inside the pipe container.

Screenshot_2.jpgScreenshot_3.jpgI tried both but no luck

This is weird. What is the path to the dist folder? And how do you create that dist folder with the minified code?

Above one is my .yml file.

This is my build success reportbuild.jpgafter completed gulp build , it creates dist folder with minified code,  But  i don't know the exact path .So could you please help me , where it was created.

Ok, I see what's going on. Since you're building your app in a separate step, you should also expose you dist folder as an artifact so the next step can access this folder to create a tar.gz file:

-step:
caches:
-node
script:
- npm install
- npm i -g bower
- bower install --allow-root
- npm i -g gulp-cli
- gulp build
artifacts:
- dist/** # this will make sure the dist/ folder is available to the next steps

Now dist folder recognized, but while pushing source code from bit bucket to heroku, the deployment is going to fail.build.jpgbuild2.jpgCould you please help on this.

@srinu ch as logs from Heroku inform, it can't detect the buildpack automatically. Mostly likely, you should run the pipe after you set the buildpack for an application. Try moving the heroku create --buildpack and heroku buildpacks:set commands up in the script so they are executed first.

@Alexander Zhukov please ho can I set my ZIP_FILE correctly, I'm deploying django through bitbucket.
I don't understand how the ZIP_FILE works.
heroku.PNG
Your urgent answer will be appreciated

@Adewale Abdulhammed you have to create a tgz file containing your django application source code like this

 

- step:
     name: Create artifact
     script:
       - tar czfv application.tgz django-app-folder/
     artifacts:
       - application.tgz
 - step:
     name: Deploy to production
     deployment: production
     script:
       - pipe: atlassian/heroku-deploy:0.1.1
         variables:
           HEROKU_API_KEY: $HEROKU_API_KEY
           HEROKU_APP_NAME: $HEROKU_APP_NAME
           ZIP_FILE: "application.tgz"

 Just replace the django-app-folder with the path to a directory with your source files. Then you should be able to pass the name of the tgz file as a ZIP_FILE

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,042 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you