Posts

Showing posts from May, 2018

Essential Heroku Commands for Java (Spring Boot) developers

This blog post captures the command used to create and configure java apps or spring boot apps deployed to Heroku Cloud. I use these commands in CI/CD deployment steps for continuous delivery and also to access the application's information from my local development machine. These commands are tested with Heroku Client version: heroku/7.0.33 darwin-x64 node-v10.0.0 View help heroku help Login/Logout to heroku With email and password heroku auth:login heroku auth:whoami heroku auth:logout Login/Logout to heroku With token # set HEROKU_API_KEY environment variable to login export HEROKU_API_KEY=<<API Key from https://dashboard.heroku.com/account>> heroku auth:whoami # unset HEROKU_API_KEY environment variable to logout unset HEROKU_API_KEY # clear the history to clear the API Key history -cw && cat /dev/null > ~/.bash_history Show available regions for deployment heroku regions Create an application heroku apps:create --app app-

Git bundle and clone as a new repository

The following steps/commands will help to clone a local git repository using git bundle. This is useful when cloning a sample repository or sharing the repository to a peer through email or other channels where git pull/push is not feasible Navigate to existing repository cd ~/source_code/my_existing_repository Create a git bundle from master branch of an existing repository git bundle create /tmp/my_existing_repository_master.bundle master Create a new repository from the bundle git clone -b master /tmp/my_existing_repository_master.bundle ~/source_code/my_new_repository Navigate to the new repository cd ~/source_code/my_new_repository Verify the logs git --no-pager log --max-count 3 Cleanup the pre-existing origin  # verify the pre-existing origin before deleting git remote -v # delete the pre-existing origin git remote rm origin # verify remotes after deleting git remote -v Using git archive There is a git archive command which exports the files in th