How to clear Heroku releases? - heroku

I have deployed in my Rails application in Heroku.
And on Heroku
$ heroku releases
=== my_app Releases
v34 Deploy b18bae5 user#example.com 2014/06/23 13:21:52
v33 Deploy 433982b user#example.com 2014/06/23 12:24:31
v32 Deploy 028406a user#example.com 2014/06/23 09:53:50
v31 Rollback to v29 user#example.com 2014/06/23 17:45:47
v30 Deploy ffead56 user#example.com 2014/06/22 17:04:51
v29 Deploy gghjk21 user#example.com 2014/05/24 12:19:43
v28 Deploy b18bae5 user#example.com 2014/05/20 14:52:19
v27 Deploy 8b72be3 user#example.com 2014/05/20 13:56:48
I want to remove particular release only, example I want to remove v29. How to do?

I don't think this is possible without destroying the app and recreating.
Why do you want to do that? What are you trying to achieve?

try heroku plugins:install heroku-repo then heroku repo:purge_cache -a appname
If the did not work go to the url How do I clear the build cache?

Related

"Couldn't find that app." when running heroku commands in console

I'm trying to run commands for my heroku app in my console, but it keeps telling me "Couldn't find that app." even though when I run heroku apps in my console it tells me I have one app called worldofwarcraft-api
So heroku recognizes my app in the apps list, but I can't run any commands to access it. The line I want to run is
heroku ps:scale web=1 --app worldofwarcraft-api
I'm trying to troubleshoot why my API returns a 503 when I try to make a GET request to it. This is the fix the heroku faq told me to try, but it's just telling me it can't find my app.
I'm wondering if it has something to do with the fact that I deployed my API from github, rather than running the heroku setup in my console. I don't know if that would effect my ability to run heroku commands on the app in my local console.
Apologies if my formatting is off a bit. I'm still getting used to this site.
In my case, someone renamed GitHub repo and I tried to find Heroku app with new GitHub name
It helps me
heroku apps
heroku git:remote -a YOUR_APP
Solved it. Just sharing for future searches.
The issue was fixed by running git init and then heroku git:remote -a worldofwarcraft-api in my command line while inside my repositories folder. This initialized git in the repo and then set the heroku git remote to that repository.
Hopefully, this helps anyone else who had a similar issue.
Just an easy way to solve this issue:
1st: Add the command into your terminal: $ heroku apps
If you already logged into your heroku account from your terminal, all your apps will appear as a list like this:
your-project-name-1
your-project-name-2
your-project-name-3
your-project-name-4
2nd: Then chose which one you are needing to connect with the following command:
$ heroku git:remote -a your-project-name-2
If you've done the connection properly you'll receive the following output:
set git remote heroku to https://git.heroku.com/your-project-name-2.git
For my case, I was renaming my github repository.
You can find it in your repository settings then just rename it, it appears in the first place.
Then you can continue with git init again to re-initiate your existing git repository and then set your heroku remote with your heroku apps new name heroku git:remote -a YOUR_APP_NAME
If the app belongs to a team that you participate in, you have to specify the team option in the commands to see the app:
E.g:
heroku apps -t <team name>
or
heroku ps:scale web=1 --app worldofwarcraft-api -t <team name>

Multiple apps in git remotes when trying to access rails console

I have two git branches, staging and production, and I deployed them on Heroku in the same Heroku acccount. Suppose my app names are app1.heroku-app.com and app2.heroku-app.com and the remote names are heroku-staging and heroku-production,respectively. I deployed both apps on Heroku. After I login to Heroku from the console using heroku login and then try to access a Rails console using heroku run rails c, I get this message :
▸ multiple apps in git remotes
▸ remotes: heroku-staging heroku-production
How can I access a console?
If there's only one Heroku remote, heroku can infer which you want. When there are multiple (or if you want to access an application that doesn't have a remote in this Git repo, or when you're not in a Git repo at all), you need to use the --app option to specify which application you want a console on.
$ heroku --help
Usage: heroku COMMAND [--app APP] [command-specific-options]
$ heroku run rails c --app app1
$ heroku run rails c --app app2
In addition to being able to specify the app as a per-command flag, if you'd like for there to be a default environment, setting the environment variable HEROKU_APP to the app you want will make it so that heroku commands don't rely on git config.
$ heroku logs
› Error: Multiple apps in git remotes
...
$ export HEROKU_APP=app1
$ heroku logs
2018-12-31T03:56:34.888350+00:00 app[web.1]: 1.2.3.4 ...

Where did these Heroku apps come from?

I have created a local git repository called phantomjs123 and I'm trying to deploy to Heroku:
me#my-PC /f/EasyPHP-12.1/www/phantomjs123 (master)
$ heroku apps
=== My Apps
phantomjs123
protected-waters-9718
serene-mesa-1437
As you can see 2 additional apps have been created. I tried to delete them but when I do
me#my-PC /f/EasyPHP-12.1/www/phantomjs123 (master)
$ ls
bin nbproject procfile
They don't appear to exist locally. Can someone explain what these other apps are and how to remove them?
To destroy apps on Heroku you can do:
heroku apps:destroy <APPNAME>
Mind you, they would only exist as a result of doing a heroku create.

How to deploy meteor 0.6.0 + to heroku

Im trying to deploy my meteor 0.6.3 app to heroku i tried using https://github.com/jordansissel/heroku-buildpack-meteor.git it only supports meteor 0.5.9 i also tried bundling my app in a .tgz file as suggested by the meteor docs but was not able to deploy I kept getting the no cedar app detected?
I had to do a bit of work to get Meteor 0.8.2 to deploy properly to Heroku. I'm posting the sequence of steps that worked for me. You could turn this into a parameterized Bash script, if you were so inclined.
# Define Meteor/Heroku app name:
export APP_NAME='Your-App-Name-Here'
# Create Meteor app:
meteor create --example leaderboard "${APP_NAME}"
cd "${APP_NAME}"
git init .
git add .
git commit -m 'Initial commit'
if ( heroku apps | egrep --silent "^${APP_NAME}$" )
then
# If re-using an existing Heroku app:
echo "Heroku app '${APP_NAME}' already exists; configuring..."
git remote remove heroku
heroku git:remote -a "${APP_NAME}"
heroku config:set \
BUILDPACK_URL=https://github.com/oortcloud/heroku-buildpack-meteorite.git
else
# If creating the Heroku app for the first time:
echo "Creating Heroku app '${APP_NAME}'..."
heroku create --stack cedar --app "${APP_NAME}" \
--buildpack https://github.com/oortcloud/heroku-buildpack-meteorite.git
fi
heroku config:add ROOT_URL="http://${APP_NAME}.herokuapp.com"
# Make sure you have a verified account to enable the mongohq:sandbox add-on
heroku addons:add mongohq:sandbox
# Visit: https://addons-sso.heroku.com/apps/${APP_NAME}/addons/mongohq:sandbox
open "https://addons-sso.heroku.com/apps/${APP_NAME}/addons/mongohq:sandbox"
# - Click 'add a database user'
# - Enter a user name and password, and click 'Add user'
# - Click 'Overview' tab
# Set the following variables appropriately, based on the user name, password, and
# values within the 'Mongo URI' string in the Overview tab
export MONGO_DB_HOST='kahana.mongohq.com'
export MONGO_DB_PORT='db-port'
export MONGO_DB_NAME='db-name'
export MONGO_DB_USER='db-user'
export MONGO_DB_PASS='db-pass'
# Calculate connection string and URL:
export MONGO_DB_CONN="${MONGO_DB_HOST}:${MONGO_DB_PORT}/${MONGO_DB_NAME}"
export MONGO_DB_URL="mongodb://${MONGO_DB_USER}:${MONGO_DB_PASS}#${MONGO_DB_CONN}"
# If you have mongo client installed, verify the connection:
export MONGO_CMD='mongo'
"${MONGO_CMD}" "${MONGO_DB_CONN}" -u "${MONGO_DB_USER}" -p"${MONGO_DB_PASS}"
heroku config:add MONGO_URL="${MONGO_DB_URL}"
# Verify configs look okay:
heroku config
# Configure a public/private SSH key pair in order to perform builds:
export HEROKU_RSA_NAME='id_rsa#herokuapp.com'
export HEROKU_RSA_FILE=~/.ssh/"${HEROKU_RSA_NAME}"
# If creating the keys for the first time:
[[ -f "${HEROKU_RSA_FILE}" ]] || {
ssh-keygen -t rsa -f "${HEROKU_RSA_FILE}"
ssh-add "${HEROKU_RSA_FILE}"
}
heroku keys:add "${HEROKU_RSA_FILE}.pub"
# Deploy the Meteor app via Git and the custom build pack:
git push heroku master
# Any errors?
heroku logs
# Make sure the Heroku app is running using one web dyno:
heroku ps:scale web=1
# Test the app
heroku open
Use this, works like a charm.
https://github.com/oortcloud/heroku-buildpack-meteorite
To those having trouble with the bash: node: command not found issue, I went through that too and I solved it by deleting the Procfile.
Apparently, the Procfile indicates Heroku to run the app using node main.js but node is not a valid command since it is not included in the PATH varialbe, or similar.
By deleting the Procfile, Heroku detects that the app is a meteor app and runs it using the node binary with the full path.
Sorry for posting an answer instead of a comment, but my reputation doesn't let me comment.
Also, remember the ROOT_URL must be set begining with http://
I am running two Meteor applications on Heroku (both apps are connected to mongolab, so external MongoDB instances).
Here I have documented how I did it:
.../how-to-deploy-meteor-on-heroku-with.html

Heroku toolbelt command requires app-name

How do you specify the app you want when you log in to Heroku from the command line?
I was trying to check the logs so when I first logged in I tried:
Heroku logs
this then told me:
! No app specified.
! Run this command from an app folder or specify which app to use with --app <app name>
I then tried:
heroku --app my-appname
but i get:
`--app` is not a heroku command.
I have tried all combinations.
You still need to include the command:
heroku logs --app app-name
You can also use -a instead of --app:
heroku logs -a app-name
Another option is to associate your (git) project to Heroku. From heroku open - no app specified:
$ cd app-dir
$ heroku git:remote -a app-name
$ heroku logs
Try this:
heroku git:remote -a [app_name]
This should allow you to call commands without having to specify which app you want them to be called on.
You could try adding --app app-name after you sentence.
Example: $ heroku domains:add your-domain --app app-name
Heroku CLI automatically detects the app name by scanning the git remotes for the current working copy.
If you're not in the app's local git clone, you need to specify the app name:
heroku logs --app app-name
or
heroku logs -a app-name
or by specifying the remote name:
heroku logs --remote production
You can reference this part of the Heroku documentation:
https://devcenter.heroku.com/articles/using-the-cli#app-commands
From my tests the Heroku CLI will infer the app from the current Git remote.
So to change to the "test" app:
git config heroku.remote test
And to come back to the default "heroku" application, which is probably your production app:
git config heroku.remote heroku
Not sure this is a good idea though...
For future solution seekers-
The error says a possible solution.
Run this command from an app folder
cd to the app directory root, then run your desired command.

Resources