简体   繁体   中英

Deploy Gitlab Spring Boot project on Heroku

I have Spring Boot project. After I created Heroku acc and new app. I changed my Postresql properties in application.properties, but the problem is deploying. If I am not mistaken, I cannot link gitlab with heroku, but can link with github. So, I'd like to know if I need to move my project on github or there are some ways to solve it. Thanks!

No, you don't need to move your code to GitHub. There are several ways to deploy to Heroku , only one of which is dependent on GitHub.

One common method would be to simply push your code to Heroku . Assuming you already have the Heroku CLI installed:

  1. Add a new remote called heroku that points to Heroku's Git repository for your app . The easiest way to do that is to run

    heroku git:remote -a example-app

    from your project directory. If you inspect your remotes you should see a new one called heroku .

  2. Then git push to the new heroku remote . In the common scenario where you want to deploy your local main or master branch, it's as simple as running

    git push heroku main # or "master"

    If you are deploying from another branch you'll still have to push to main or master on Heroku . Only those two branch names trigger a build.

I engourage you to read through all of the links I have provided above. Heroku's documentation for this stuff is quite good.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM