Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

Commit

Permalink
Trying to get bash and callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
cintiadr committed Jan 29, 2017
1 parent f0ed2cd commit 8046164
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ MAINTAINER Jonas Enge

# Installs docker
RUN apk add --update --no-cache docker py-pip
RUN apk add bash bash-doc bash-completion
#RUN apk add util-linux pciutils usbutils coreutils binutils findutils grep
RUN pip install docker-compose

# Extra tools for native dependencies
Expand Down
5 changes: 3 additions & 2 deletions handlers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ module.exports = (request, reply) => {
runScript(options)
.then(dockerhubCallback)
.then((data) => {
request.log(['debug'], data.script.result)
request.log(['debug'], data.callback)
request.log(['debug'], `Script output: ${data.script.result}`)
request.log(['debug'], "Callback output:" + JSON.stringify(data.callback))

}).catch((err) => {
request.log(['err'], err)
})
Expand Down
11 changes: 5 additions & 6 deletions lib/dockerhub-callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ module.exports = (options) => {
const httpOptions = {
json: true,
body: {
state: options.state || 'success', // (Required)
state: options.state || 'success',
description: options.description || 'Your body is beautiful',
context: options.context || 'Continuous delivery by dockerhub-webhook'
// The URL where the results of the operation can be found. Can be retrieved on the Docker Hub.
// target_url: options.target_url || 'https://someawesomeurl.com'
context: options.context || 'Continuous delivery by dockerhub-webhook',
target_url: options.target_url || 'https://ci.openmrs.org'
},
method: 'post',
uri: options.callbackUrl
Expand All @@ -28,8 +27,8 @@ module.exports = (options) => {
} else {
const message = {
callback: {
code: response.statusCode,
response: body,
request: httpOptions,
response: response,
text: `Callback sent to ${options.callbackUrl}`
},
script: {
Expand Down

0 comments on commit 8046164

Please sign in to comment.