Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

srinu ch July 13, 2019

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
Ahmed Adewale January 5, 2020

@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

Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 6, 2020

@Ahmed Adewale 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

0 votes
Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 15, 2019

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. 

srinu ch July 16, 2019

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.

Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 16, 2019

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"
srinu ch July 20, 2019

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.

Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 22, 2019

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.

srinu ch July 22, 2019

Screenshot_2.jpgScreenshot_3.jpgI tried both but no luck

Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 25, 2019

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

srinu ch July 26, 2019

yml.jpg

srinu ch July 26, 2019

Above one is my .yml file.

srinu ch July 26, 2019

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.

Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 29, 2019

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
srinu ch July 29, 2019

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.

Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 30, 2019

@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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events