Comments (12)
This appears to be the issue. These files are being excluded from the build via the pom.xml file:
/lucee-server.xml
/lucee-web.xml.cfm
from lucee5-heroku.
Heroku has an ephemeral file system so every time you deploy, and/or every time it wakes up from sleeping, it reverts to what's been deployed in the last commit.
The solution is pretty straight forward. You just need to make any desired changes on your local machine and add/commit them to your git repo. Then when you push to Heroku the changes will be included.
Let me know if you have any more questions.
from lucee5-heroku.
Thanks @mikesprague -- I tried the following:
- I ran foreman then I set all the Lucee server settings I wanted locally.
- Then I followed the rest of the process including committing all of my changes.
- However once it builds all of my server settings have been reset on Heroku or where overwritten/excluded from the build.
Please advise. Thanks!
from lucee5-heroku.
@timsayshey Those exclude lines actually exclude the files in the maven clean process.
I did some experimenting and it looks like the web context changes are saved correctly but the server context changes aren't.
On deploy it seems a new server.xml is written every time, even if one already exists.
I'll look into a way to copy an existing server.xml file post-deploy. Since the original is overwritten, it would require manually copying the file to a saved location before deploying.
I'm not sure there's a going to be an elegant solution for this regarding the server context. Are there any settings you are using that couldn't be set via the web context (/server/admin/web.cfm)?
from lucee5-heroku.
I am setting server password, datasources, mail and security settings locally. Problem is that everytime I push a change, I have to go set all of that stuff again.
from lucee5-heroku.
Right, I get that. Can't you do it via the web context and not the server context? If you do it there then it should keep the changes.
from lucee5-heroku.
Aren't web settings specific to the url? If so, localhost settings would be different than myapp.heroku.com
from lucee5-heroku.
Nope, just specific to that context. They will still work on a different URL.
In some environments, usually a dedicated server, one might have several websites hosted on one Luceee server. In that case, you set things in the server context that are globally available to each web context. However, the settings you add in each specific web context are only available to that site.
Since on Heroku you'll only be using one site there's no reason not to use the web context for all of your settings.
from lucee5-heroku.
Just tested adding the settings to the web context and committed the changes. Then I tried to send an email from heroku and I received "no SMTP Server defined." This tells me that the web context settings aren't persisting either.
from lucee5-heroku.
You want to confirm their existence via the web admin.
After deploy, go to https://you-app-name.herokuapp.com/lucee/admin/web.cfm
, log in and check there.
Make sure you're using the latest version of this repo too.
I have confirmed that local changes to the web context do deploy correctly.
from lucee5-heroku.
You can also set all of these via application.cfc
and remove the need to make them via the admin.
This is probably the recommended way as your settings are truly application specific.
It's also possible to read in Heroku environment variables this way if you're using add-ons for things like database, mail, cache, etc.
An example of this would be:
component output="false" {
variables.objEnvironment = createObject("java", "java.lang.System").getenv();
this.hostname = variables.objEnvironment.get("MANDRILL_SMTP_HOST");
this.port = variables.objEnvironment.get("MANDRILL_SMTP_PORT");
this.mailusername = variables.objEnvironment.get("MANDRILL_USERNAME");
this.mailpassword = variables.objEnvironment.get("MANDRILL_APIKEY");
...
}
from lucee5-heroku.
Okay, I removed all my hacks from the code and re-tested. It's working now using the web context. Thanks!
from lucee5-heroku.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lucee5-heroku.