Heroku not automatically deploying changes - github

I'm having an issue where I can only deploy changes to heroku via a manual command.
I've already followed the guide and set up auto deployment through github https://devcenter.heroku.com/articles/github-integration but it seems like changes are not deployed to heroku unless I explicitly run git push heroku main
Is there anything I can do to check how to automate the push?

Automatic deploy with Heroku and Github is temporary stopped
https://dev.to/lukeecart/herokus-github-integration-has-been-stopped-a7c
Follow the news : https://status.heroku.com/

Related

Heroku: how to install an existing app from GitHub?

sorry for a primitive question. I am a totally new Heroku user and I want to install an app that is on GitHub. It is written on Python. I've created a pipeline on Heroku and connected my Heroku account to my GitHub account.
Now I have absolutely no idea what to do, could you please help me?
The easiest way would be to push your code from your local machine to Heroku the Heroku CLI. You can install it here: https://devcenter.heroku.com/articles/heroku-cli
Create an app. Run heroku create. This will make an app on your account and add a Git remote called `heroku.
Push your code with git push heroku master
This "getting started" doc may help as well: https://devcenter.heroku.com/articles/getting-started-with-python

Can I edit an application that is live on Heroku?

I have a Spring Web Application live on Heroku and it is deployed via my Github. I want to make a few edits to the application. If I edit the code in Eclipse and commit it to the connected Github repository with the Heroku account will the live Spring Application automatically update and display the changes?
If I edit the code in Eclipse and commit it to the connected Github repository with the Heroku account will the live Spring Application automatically update and display the changes?
Not by default, but if you connect your GitHub and Heroku accounts you can enable automatic deploys:
When you enable automatic deploys for a GitHub branch, Heroku builds and deploys all pushes to that branch. If, for example, you have a development app on Heroku, you can configure pushes to your GitHub development branch to be automatically built and deployed to that app.
I should also point out that you probably aren't "committing to a GitHub repository".
Since Git is a distributed version control system you're committing locally and then pushing those commits to GitHub. Heroku's deploy-from-GitHub is triggered by the push (and may be dependent on CI passing).

Automated go app deployment

I'm wondering if there are any convenient ways to automate deployment of code to a live server in GO, either standard built-in methods, or otherwise.
I want something google app engine like, I just run the command and it uploads to the server and triggers a restart.
(Ultimately I want a git commit to trigger a rebuild and redeploy, but thats for down the track in the future)
I recommend Travis CI + Heroku.
You can deploy to heroku directly with just a git push, but I like to use Travis to build and run the tests before that.
There are some guides online but I'll try to go directly to the point:
What you will need?
Github account
Travis account (linked with github, free if open source)
Empty Heroku app (Free dyno works great)
Setup
In your github repo, create the following files:
.travis.yml (more info on the Travis CI documentation)
Procfile
.go-dir
After that go to your Travis account, add your repository and enabled the build for it.
Here is a sample minimal config file content (based on my app that I deploy to heroku):
.travis.yml
language: go
go:
- tip
deploy:
provider: heroku
buildpack: https://github.com/kr/heroku-buildpack-go.git
api_key:
secure: <your heroku api key encripted with travis encrypt>
on: master
Procfile
worker: your-app-binary
.go-dir
your-app-binary
Procfile and .go-dir are heroku configs so it can vary if you are deploying a web app, you can read more at the heroku documentation
One important and easily missed point is the build pack, without it the deploy will not work.
Read the Travis docs to see how to encrypt the heroku key
How it works?
Basically, every push to your repository will trigger the Travis CI build, if it passes it will deploy the app to heroku, so you set this up once and build + deploy is just a push away ;)
Also Travis will build and updated the status of all Pull Requests to your repository automagically.
To see my config and build, please take a look at my Travis build and my repository with my working configs

Can't create project or add ssh key on Gitlab

I just created a CentOS 6.3 VM and followed these instructions for the gitlab install: http://howto.basjes.nl/linux/installing-gitlab-on-centos-6
I've tried this installation with both gitlab v3.01 and v2.91.
Here is what is working for me:
I can complete the gitlab install without problem
From the command-line, I can use passwordless authentication from the the gitlab service account to the gitolite service account
From the command-line, I can clone the gitolite-admin repo, make changes, and pushes the changes back to the remote repo
I can start the rails web app
I can login the web management site
I can create new accounts and login with the new accounts
Here's what I can't do:
I can't create projects (Repos)
I can't add ssh keys
I always get the same error:
GitLab was unable to access your Gitolite system.
In the githost.log log file, I get a less than useful error:
ERROR -> Timeout::Error execution expired
I've double checked permissions
Reviewed the gitlab.yml config file
Ran through the four suggested troubleshooting tips from the web page
Tried different versions of gitlab, but no matter what I do, I keep getting the same error.
I'm stuck because the logs don't tell me anything and I am able to access the gitolite repositories with the gitlab service account without issue. Anybody have any success with the most recent versions of CentOS/Gitlab/Gitolite? Any help would be much appreciated, thanks!
I know this is kind of late - but for completeness.
I've run into the same problem doing installation on recent Debian version.
It is, or was for me, caused by an old version of redis-server.

How to deploy heroku app with secret yaml configuration file without committing the file?

In other rails projects, I'd have a local database.yml and in source code repository only commit the database.sample file. When deploying, a capistrano script that would symlink a shared version of database.yml to all the releases.
When deploying to heroku, git is used and they seem to override database.yml altogether and do something internal.
That's all fine and good for database.yml, but what if I have s3 configurations in config/s3.yml. And I'm putting my project on github so I don't want to commit the s3.yml where everyone can see my credentials. It'd rather commit a sample s3.sample which people will override with their own settings, and keep a local s3.yml file uncommitted in my working directory.
what is the best way to handle this?
Heroku have some guidance on this -
http://devcenter.heroku.com/articles/config-vars
An alternative solution is to create a new local-branch where you modify .gitignore so secret-file can be pushed to heroku.
DON'T push this branch to your Github repo.
To push non-master branch to heroku, use:
git push heroku secret-branch:master
More info can be found on:
https://devcenter.heroku.com/articles/multiple-environments#advanced-linking-local-branches-to-remote-apps
Use heroku run bash and then ls to check whether your secret-file have been pushed on to heroku or not
Store the s3 credentials in environment variables.
$ cd myapp
$ heroku config:add S3_KEY=8N029N81 S3_SECRET=9s83109d3+583493190
Adding config vars:
S3_KEY => 8N029N81
S3_SECRET => 9s83109d3+583493190
Restarting app...done.
In your app:
AWS::S3::Base.establish_connection!(
:access_key_id => ENV['S3_KEY'],
:secret_access_key => ENV['S3_SECRET']
)
See the Heroku Config Vars documentation which explain development setup etc.
If using Rails 4.1 beta, try the heroku_secrets gem, from https://github.com/alexpeattie/heroku_secrets:
gem 'heroku_secrets', github: 'alexpeattie/heroku_secrets'
This lets you store secret keys in Rails 4.1's config/secrets.yml (which is not checked in to source control) and then just run
rake heroku:secrets RAILS_ENV=production
to make its contents available to heroku (it parses your secrets.yml file and pushes everything in it to heroku as environment variables, per the heroku best practice docs).
You can also check out the Figaro gem.
I solved this by building the credentials from env variables during the build time, and write it to where I need it to be before the slug is created.
Some usecase specific info that you can probably translate to your situation:
I'm deploying a Node project, and in the package.json in the postinstall script I call "bash create-secret.sh". Since postinstall is performed before the slug is created, the file will be added to the slug.
I had to use a bash script because I had some trouble printing strings that contained newlines that had to be printed correctly, and I wasn't able to get it done with Node. Probably just me not being skilled enough, but maybe you run into a similar problem.
Looking into this with Heroku + Build & Deploy-time Secrets. It seems like it's not something Heroku supports. This means for a rails app, there is no way other than committing BUNDLE_GITHUB__COM for example to get from private repo.
I'll try to see if there is a way to have CI bundle private deps before beaming at heroku