Commit a4f0817f authored by Aral Balkan's avatar Aral Balkan
Browse files

Now not pulling content while in dev. Added volume info to readme.

parent f132fdf1
......@@ -93,18 +93,26 @@ class GitlabWebhookServer
#
# Pull the latest content and convert the Blockdown into data for the apps and site.
#
gitPullCommand = "cd #{(new App).contentDirectory} && git pull origin master"
@info "About to run git command: #{gitPullCommand}"
# In production, pull from origin (live, via source.ind.ie). In dev, use content from ../content
# (Don’t do the pull as we can’t guarantee that we’ll be online during dev and it should still work).
exec gitPullCommand, (error, stdout, stderr) =>
if error
@error stderr
else
@info stdout
blockdown = new Blockdown
(blockdown.render (new App).contentDirectory).then =>
@info "Blockdown converted."
remote = if process.env.PORT
# In production
gitPullCommand = "cd #{(new App).contentDirectory} && git pull origin master"
@info "In production, about to pull content with command: #{gitPullCommand}"
exec gitPullCommand, (error, stdout, stderr) =>
if error
@error stderr
else
@info stdout
@renderBlockdown()
else
# In development
@info 'In development, not pulling content.'
@renderBlockdown()
#
# Create the server
......@@ -117,4 +125,15 @@ class GitlabWebhookServer
@app = app
#
# Render the Blockdown content.
#
renderBlockdown: =>
@info 'About to render blockdown.'
blockdown = new Blockdown
(blockdown.render (new App).contentDirectory).then =>
@info "Blockdown converted."
module.exports = GitlabWebhookServer
npm start
\ No newline at end of file
......@@ -8,6 +8,11 @@ Builds the blockdown data from the blockdown content.
2. Copy `config.coffee` into `~/ind.ie.blockdown-builder` (`/root/ind.ie.blockdown-builder/`) and configure it.
3. In the folder from Step 2, above, `git clone git@source.ind.ie:blockdown/content.git`
4. ./deploy
5. Run `dokku docker-options:add blockdown-builder.ind.ie deploy "-v /root/ind.ie.blockdown-builder:/app/ind.ie.blockdown-builder"`
To use, set up post-push and post-merge webhooks on Gitlab for both the Builder and Content repositories to point to `https://url/for/your/installation/build/(token-from-config.coffee)`
\ No newline at end of file
Then, create the volumes:
dokku docker-options:add blockdown-builder.ind.ie deploy "-v /root/ind.ie.blockdown-builder:/app/ind.ie.blockdown-builder"
dokku docker-options:add blockdown-builder.ind.ie deploy "-v /root/.ssh:/app/.ssh"
To use, set up post-push and post-merge webhooks on Gitlab for both the Builder and Content repositories to point to `https://url/for/your/installation/build/(token-from-config.coffee)`
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment