-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
71 additions
and
40 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,2 +1,2 @@ | ||
# Generate the Ghost JSON config file when Heroku dyno starts-up. | ||
node create-config.js | ||
bin/create-config |
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,2 +1 @@ | ||
web: npm start --production | ||
release: knex-migrator migrate --mgpath node_modules/ghost |
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,3 @@ | ||
module.exports = { | ||
mysqlDatabaseUrl: process.env.MYSQL_DATABASE_URL || process.env.JAWSDB_URL || process.env.CLEARDB_DATABASE_URL | ||
} |
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,3 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Initializing the deployment…" | ||
echo "pwd →" | ||
pwd | ||
echo "config.production.json →" | ||
cat "config.production.json" | ||
|
||
bin/wait-for-db | ||
|
||
knex-migrator init --mgpath node_modules/ghost |
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,21 @@ | ||
#!/usr/bin/env node | ||
|
||
var mysql = require('mysql'); | ||
var envValues = require('./common/env-values'); | ||
|
||
console.error(`Awaiting MySQL database…`); | ||
pingDatabaseUntilConnected(); | ||
|
||
function pingDatabaseUntilConnected() { | ||
var connection = mysql.createConnection(envValues.mysqlDatabaseUrl); | ||
connection.query('SELECT 1', function (error, results, fields) { | ||
if (error) { | ||
console.error(`Database not yet available: ${error.message}`); | ||
setTimeout(pingDatabaseUntilConnected, 5000); | ||
} else { | ||
console.error('Database connected.'); | ||
connection.end(); | ||
process.exit(0); | ||
} | ||
}); | ||
} |
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