Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ghost 1.x compatibility for Heroku: new config adapter, MySQL databas…
…e, updated S3 storage
- Loading branch information
Showing
16 changed files
with
155 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules/ | ||
npm-debug.log* | ||
|
||
content/themes/casper/ | ||
content/logs/ | ||
config.production.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Generate the Ghost JSON config file when Heroku dyno starts-up. | ||
node config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"url": "http://localhost:2368/", | ||
"server": { | ||
"port": 2368, | ||
"host": "127.0.0.1" | ||
}, | ||
"database": { | ||
"client": "sqlite3", | ||
"connection": { | ||
"filename": "content/data/ghost-local.db" | ||
} | ||
}, | ||
"mail": { | ||
"transport": "Direct" | ||
}, | ||
"logging": { | ||
"transports": [ | ||
"file", | ||
"stdout" | ||
] | ||
}, | ||
"process": "local", | ||
"paths": { | ||
"contentPath": "content" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../node_modules/ghost-storage-adapter-s3/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../node_modules/casper/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
var path = require('path'); | ||
var ghost = require('ghost'); | ||
var cluster = require('cluster'); | ||
|
||
ghost({ | ||
config: path.join(__dirname, 'config.js') | ||
}).then(function (ghostServer) { | ||
ghostServer.start(); | ||
}); | ||
// Heroku sets `WEB_CONCURRENCY` to the number of available processor cores. | ||
var WORKERS = process.env.WEB_CONCURRENCY || 1; | ||
|
||
if (cluster.isMaster) { | ||
// Master starts all workers and restarts them when they exit. | ||
cluster.on('exit', (worker, code, signal) => { | ||
console.log(`Starting a new worker because PID: ${worker.process.pid} exited code ${code} from ${signal} signal.`); | ||
cluster.fork(); | ||
}); | ||
for (var i = 0; i < WORKERS; i++) { | ||
cluster.fork(); | ||
} | ||
} else { | ||
// Run Ghost in each worker / processor core. | ||
ghost().then(function (ghostServer) { | ||
ghostServer.start(); | ||
}); | ||
} |