Why is my app still displaying old code after generating new app? - node.js

I deployed my app like a month ago, and everything was working OK.
In the meantime my app changed a lot so I decided to deploy new version.
I used command git push heroku deployment:master (git branch deployment is containing some files just for deployment).
When I opened my app via heroku open I noticed that my app is still using old home page. After Googling around I've tried:
heroku reset
Creating new branch and pushing new code with few test lines added
Try to clear cache, open pages in different browsers
Checking the files with heroku run bash (all files are as they should be)
I went even further and tried:
heroku apps:destroy
heroku create (created new project, and used git push heroku deployment:master again)
Event after accessing the new URL, there is still old code, old .html pages and everything. I'm using Node.js v8.11.4
Help me out please! Thanks in addition.
EDIT: Was trying also to git clone Heroku Git URL, to my desktop. All files are as expected, I have no idea, where is heroku getting old files...

After 2 days of fooling around and trying a lot of different things there were 2 things that I need to do.
Don't forget to run ng build before deploying new version of app, or else old public files will be deployed
Clear the build cache for an app using the following commands:
heroku plugins:install heroku-repo
heroku repo:purge_cache -a appname
git commit --allow-empty -m "Purge cache"
git push heroku master
Where appname is replaced by the name of the app you want to clear the cache for.
SOURCE: How to clear build cache

Related

create(clone) the same app for development in heroku

I am having the app http://example.com in heroku. So I need to create(clone) the same app for my development in subfolder http://example.com/subfolder. How to do this. Any help will be much appreciated.
Note:
I am having only heroku access, no domain login available with me.
Heroku nodejs application.
I am new to Heroku. I have clonned the same app in my localhost:5000. But needed online development environment.
Finally I created the staging environment. My development environment is in local.
Once I clone my production app to my local, then I am creating the staging environment.
ref this link for downloading code from heroku. Ensure that you have downloaded the application slugs.
Once cloned into my local. I checked with localhost:5000. For this I have already installed node server and git in my windows 10.
heroku create --remote staging
after the above command, you will see the new staging environment(name will be auto generated) created in your Heroku login.
Click on that newly created app name in heroku login and then deploy tab, follow the procedure given in that. for which the link can be like this https://dashboard.heroku.com/apps/autogenerated-appname-12345/deploy/heroku-git
And in the final step git push heroku master I got the error
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.
Then I used git push staging master which is mentioned in this document.
Then I checked in the browser https://autogenerated-appname-12345.herokuapp.com/

heroku git dependency propagation

In my heroku app repo, we have git dependency
"allcountjs" : "git+https://gitlab.com/ourawesome/allcountjs.git#Print
I have made some changes to this repo (allcountjs ) and i want them reflected to my heroku app.
I did a git pull / git push on heroku and it seemed to have successfully deployed the app. Alas, I don't see the changes when i access the app on web.
Any idea why?
How can I force a node restart on a heroku app?
I hope it s clear. Thanks in advance.
It is more like NPM issue than Heroku. Try putting the commit id instead of branch in the url of dependency, e.g.:
"dependency" : "git+https://gitlab.com/ourawesome/allcountjs.git#e1111a0a4cf50ae6ef1dde4c22b87d833e26befa"
So that NPM knows that it was updated

Node.js app not changing

I have a node app running on my VS using pm2, deployed via git.
All works fine, but when I make changes in my local version and then push it to the server the files are changed and updated to the new version, but the app still looks like the same of the initial push I made when I deployed it for the first time. Pm2 is set to watch for changes and in my local version all works fine, while on Vs not.
How is that possible?
UPDATE
Apparently it's just the .js file that isn't changed, html are fine.
Apperently a rebase fixeded the problem:
git pull --rebase origin master
git push -u origin master

Ghost(node.js) app - 503 err after git push in OpenShift hosting

I created ghost blog in OpenShift host. Everything worked fine.
I wanted to make some changes in css file(change the margin of the page title), so i did git pull the resources, made changes in css file locally, and git push back with command git push -f(force) openshift master, because without -f, I couldn't do this push.
After this "git push" command, my app got broke, and now, the http outputs 503 error...
I tried to restart my app, but it doesn't help. Don't know why it crashed.
Not sure what actually happened with your new change.Check the app logs.
First ssh to your app
ssh 1234567890abcdef1234567890abcdef#your-app-domain.rhcloud.com
and then cd to logs directory
cd app-root/logs
tail the contents of nodejs.log file
This may not actually resolve your issue but logs can help you.

Custom domain on Openshift Nodejs App doesnt show up. [+process.env.OPENSHIFT_APP_DNS]

I run a ghost blog on openshift, i created with success custom domains for my site and everything works nice, but the subscribe link as some other links in my menu points to my openshift url ghost-nodejs.rhcloud.com than to my custom domain my-blog.com.
After i cloned the git repo on my machine, i opened the config.js and changed the url: 'http://my-ghost-blog.com', to my custom domain url: 'http://my-blog.com', but nothing changes. I also later changed production: {
'url: 'http://'+process.env.OPENSHIFT_APP_DNS, to my custom domain but that change made my blog not work at all. ( I completely remove the +process.env.OPENSHIFT_APP_DNS part)
Can someone guide me on this?
PS: The git commands i use are git clone ssh//***** i alter some stuff locally and then i run
git add -A then git commit -a -m 'alter my app' and finally git push
Make sure you run the following to set your runtime to production
`rhc set-env NODE_ENV=production --app yourappname'
This will make sure that the changes you made under the production section of your config.js are used.

Resources