How do I deploy my site from github to heroku? - heroku

How do I deploy my site from github to heroku?
nbp-229-179:portfolio folder admin$ git push heroku master
fatal: 'heroku' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
nbp-229-179:portfolio folder admin$

You might want to look into the GitHub integration, which will allow you to link your heroku app with github, not do any git pushes to heroku anymore but have your application automatically deployed.
With pipelines, you can automatically deploy a staging app with every push to the master branch, and manually promote the staging deployment to production.

Related

Uploading Files from Laravel App to BitBucket

Here is what im try to achieve, I have a laravel app with a BitBucket repo in my laravel project public directory (public/repo.name).
Now what i want is to run, git add . git commit -m "Changes" and git push from my (public/repo.name) directory inside my laravel app.
I want the git commands to run when i go to lets say, http://127.0.0.1:8000/deploy this would only deploy whatever changes are in (public/repo.name)
Convert your Project to a Git Project
Open your terminal and navigate to the project root directory and run the git init command.
git init
git-init-laravel-project
Git init Laravel project
Git Add and Commit All Files
With the git init command we have successfully converted our project into a local git project. Although we have not yet added a git remote to our project.
As a second step lets go ahead and add and commit all the files to our local git repository.
Run the git add and git commit command on the project root.
git add .
git commit -m "First Commit"
The git add command adds a change in the working directory to the staging area. It tells Git that you want to include updates to a particular file in the next commit.
The git commit command commits the staged snapshot to the project history. Committed snapshots can be thought of as “safe” versions of a project—Git will never change them unless you explicitly ask it to.
Git add and Git commit on Laravel project
Create a New BitBucket Repository
We are now ready to push our changes to a remote repository. But before that we have to create a repository where we can push our changes.
Login to Bitbucket if you already have an account or SignUp for a new account. On the left hand menu , Click on the + symbol to get the option of Creating a New Repository.
Create Bitbucket empty Repo for Laravel.
Enter a suitable project name and click on Create Repository. A blank repository will be created and you will be redirected to the overview page of the repo.
Now we can go ahead and make this repo our remote repo for the Laravel project.
Add Remote Repo and Push Changes
To add the repository you just created as the remote repo for your local Laravel project. Run the following command on your project root in terminal.
git remote add origin https://<repo_owner>#bitbucket.org/<accountname>/<reponame>.git
Replace the repo_owner and accountname in the URL accordingly.
git-laravel-remote-add
git remote add laravel
Now we can go ahead and push the changes to remote repository.
git push -u origin master
git-laravel-push-bitbucket
Git push Laravel project
If you see at source in your bitbucket repository. You should see your Laravel directory structure along with the files.

Changes not reflecting on browser after deploying code on heroku node js app

I have an app on Heroku. According to the Heroku App deploy guide I followed the below steps to modify the master.
Steps to make the push on Heroku
$ git add .
$ git commit -am "make it better"
$ git push Heroku master
The build of deploy was successful but the changes didn't reflect on the browser. I used hard refresh multiple times but didn't work.
If your app requires a build step to compress and combine assets and you are not seeing recent changes, then it's likely that you are forgetting to run that build step.
If you are using package such as parcel-bundler. you should run it before you deploy it. That would solve the issue.
You can read more on how to run it automatically whenever you deploy your app from here.
https://devcenter.heroku.com/articles/node-best-practices#hook-things-up

git clone from Azure DevOps failing

I can clone from a git repository hosted in Azure DevOps on an Windows Azure VM, but I can't clone on my local Windows machine anymore (I used to be able to). So, I can rule out permissions issues on the repository.
I can clone git repositories from an internally hosted TFS.
git version: 2.21.0.windows.1
C:\Users\someuser\dev>git clone https://somOorg#dev.azure.com/someOrg/someProject/_git/someRepository
Cloning into 'someRepository'...
remote: TF401019: The Git repository with name or identifier someRepository does not exist or you do not have permissions for the operation you are attempting.
fatal: repository 'https://someOrg#dev.azure.com/someOrg/someProject/_git/someRepository/' not found
What could be the issue?

Is there any way to prove a heroku deployment corresponds to a github repo?

I want to set an opensource project where users can be sure that the deployed version .heroku.com corresponds with the actual source code in github master branch github.com/
Is there any way to prove a heroku deployment corresponds to a github repo?
Your app can spit out the latest deployed Git SHA if it has the "Dyno Metadata" feature turned on: https://devcenter.heroku.com/articles/dyno-metadata
Using that, you can show the latest SHA and compare it against the public repo.
Also, to add to what Jon said, you can do this via the heroku releases command. Every release, be it a code deployment, config var is 'tagged' - the command will show you everything that has changed on your app and a deploy will show the short git SHA, you can copy the SHA and then use the git command to search the repo for it.
eg.
assuming heroku releases returns
v10 Deploy 33f21247 foo#bah.com 2018/09/03 10:01:38 +0100
then you could do:
git cat-file commit 33f21247
which will then output the corresponding match, or a message saying it's not found. Obviously, this assumes your local repo is in sync with GitHub. To check it against GitHub you'd need to open your repo on GitHub like:
https://github.com/heroku/{projectname}/commit/{sha}
which will show the same commit on GitHub.

How to redeploy a Tomcat 7 application on Openshift

I know that a git push origin master will let Openshift redeploy the application to its new version.
But my situation is that my Tomcat application depends on another sub-module maven project, and they are both snapshot.
Once its sub-module project changes (the Tomcat application remains the same), the git push origin master doesn't work at all (Everything up-to-date) and of course Openshift will not redeploy my application, which means that it doesn't renew the newest sub-module snapshot artifact for me.
So, how to solve this problem? I have tried rhc restart and rhc reload, but they doesn't work. Is there some command like rhc redeploy?
You can run
rhc app deploy HEAD -a <appname>
if you're using the command line tools
You can start the deploy steps by ssh'ing to your openshift application. Check your ssh line from https://openshift.redhat.com/app/console/applications/ -> Click your application and then "Want to log in to your application?". Check https://www.openshift.com/developers/remote-access for detailed help (thanks RustyTheBoyRobot).
Once in, run:
gear deploy
Are you sure that you've pulled and committed the most recent changes to the submodule? What's probably happening is the reference to the desired submodule commit isn't updated, so even though the submodule has changed, you project doesn't really know about it. I believe git submodule status should show you the commit your main project currently knows about.
To update this reference, follow these directions.
[main]$ cd ./subm
[subm]$ git pull origin/master # or fetch then merge
[subm]$ cd ..
[main]$ git commit ./subm -m "Updated submodule reference"
If you actually committed changes in the last step, then OpenShift should update it appropriately (since this time, there were changes to the git repo).

Resources