Commit 64e8c749 authored by Aral Balkan's avatar Aral Balkan
Browse files

Cleaned up the Gitlab webhook listener. Added further deployment instructions to the readme.

parent 34cd3f6d
......@@ -105,10 +105,6 @@ class GitlabWebhookServer
sshPath = path.join app.homeDirectory, 'ssh'
privateSSHKeyPath = path.join sshPath, 'id_rsa'
publicSSHKeyPath = path.join sshPath, 'id_rsa.pub'
@info "Public key path:"
@info publicSSHKeyPath
@info "Private key path:"
@info privateSSHKeyPath
repository = null
......@@ -119,11 +115,6 @@ class GitlabWebhookServer
# Fetch
repository = repo
@info "About to fetch from:"
@info repo
@info typeof repo
@info repository
return repository.fetch 'origin',
callbacks:
credentials: (url, userName) =>
......@@ -143,22 +134,15 @@ class GitlabWebhookServer
@info "Pulled."
@renderBlockdown()
# gitPullCommand = "cd #{app.contentDirectory} && ssh-agent bash -c '#{path.join app.homeDirectory, 'ssh', 'id_rsa'}; git pull origin master'"
# @debug "In production, about to pull content with command: #{gitPullCommand}"
# exec gitPullCommand, (error, stdout, stderr) =>
# if error
# @error stderr
# else
# @debug stdout
# @renderBlockdown()
else
# In development
@debug 'In development, not pulling content.'
@renderBlockdown()
.then =>
# Add and commit the changes to the data repository and
# push them to source.ind.ie.
# TODO
#
# Create the server
......
......@@ -5,14 +5,20 @@ Builds the blockdown data from the blockdown content.
# Deployment
1. Set up server with Dokku.
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
Then, create the volumes:
5. Create the volumes:
dokku docker-options:add blockdown-builder.ind.ie run "-v /root/ind.ie.blockdown-builder:/app/ind.ie.blockdown-builder"
dokku docker-options:add blockdown-builder.ind.ie deploy "-v /root/ind.ie.blockdown-builder:/app/ind.ie.blockdown-builder"
6. Create the data repository:
i. `cd ~/ind.ie.blockdown-builder/`
ii. `git clone git@source.ind.ie:blockdown/data.git`
dokku docker-options:add blockdown-builder.ind.ie run "-v /home/dokku/.ssh:/root/.ssh:ro"
7. 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)`
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