diff --git a/.travis.yml b/.travis.yml index 09ff4a8bb..3b6de8139 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ sudo: false +dist: trusty language: node_js cache: directories: @@ -8,11 +9,13 @@ notifications: node_js: - 4 - 6 + - 8 before_script: - npm run es5ify - npm prune after_success: - npm run semantic-release + - 'curl -s -H "Content-Type: application/json" --data "{\"build\": true}" -X POST https://registry.hub.docker.com/u/snyk/broker/trigger/${DOCKER_TOKEN}/' branches: except: - /^v\d+\.\d+\.\d+$/ diff --git a/dockerfiles/bitbucket-server/Dockerfile b/dockerfiles/bitbucket-server/Dockerfile new file mode 100644 index 000000000..c73239aa9 --- /dev/null +++ b/dockerfiles/bitbucket-server/Dockerfile @@ -0,0 +1,55 @@ +FROM node:6-alpine + +MAINTAINER Snyk Ltd + +# Install broker +RUN npm install --global snyk-broker + +# Don't run as root +WORKDIR /home/node +USER node + +# Generate default accept filter +RUN broker init bitbucket-server + + + +###################################### +# Custom Broker Client configuration # +# Redefine in derived Dockerfile, # +# or provide as runtime args `-e` # +###################################### + +# Your unique broker identifier +ENV BROKER_TOKEN + +# Your personal username to your bitbucket server account +ENV BITBUCKET_USERNAME + +# Your personal password to your bitbucket server account +ENV BITBUCKET_PASSWORD + +# Your Bitbucket Server host, excluding scheme +ENV BITBUCKET your.bitbucket.server.hostname + +####################################### +# Generic Broker Client configuration # +####################################### + +# The Bitbucket server API URL +ENV BITBUCKET_API $BITBUCKET/rest/api/1.0 + +# The URL of the Snyk broker server +ENV BROKER_SERVER_URL https://broker.snyk.io + +# The fine detail accept rules that allow Snyk to make API requests to your +# Bitbucket Server instance +ENV ACCEPT accept.json + + + + +HEALTHCHECK --interval=10s --timeout=1s \ + CMD wget -sq http://localhost:7341/healthcheck + +CMD ["broker", "--verbose"] diff --git a/dockerfiles/github-com/Dockerfile b/dockerfiles/github-com/Dockerfile new file mode 100644 index 000000000..1ebb7a009 --- /dev/null +++ b/dockerfiles/github-com/Dockerfile @@ -0,0 +1,67 @@ +FROM node:6-alpine + +MAINTAINER Snyk Ltd + +# Install broker +RUN npm install --global snyk-broker + +# Don't run as root +WORKDIR /home/node +USER node + +# Generate default accept filter +RUN broker init github + + + +###################################### +# Custom Broker Client configuration # +# Redefine in derived Dockerfile, # +# or provide as runtime args `-e` # +###################################### + +# Your unique broker identifier, copied from snyk.io org settings page +# ENV BROKER_TOKEN + +# Your personal access token to your github.com / GHE account +# ENV GITHUB_TOKEN + +# The port used by the broker client to accept webhooks +# Default value is 7341 +ENV PORT 7341 + +# The URL of your broker client (including scheme and port) +# This will be used as the webhook payload URL coming in from GitHub +# ENV BROKER_CLIENT_URL http://:$PORT + + + +####################################### +# Generic Broker Client configuration # +####################################### + +# GitHub host is github.com +ENV GITHUB github.com + +# The URL that the github API should be accessed, excluding scheme. +ENV GITHUB_API api.github.com + +# The URL where raw file content is accessed, excluding scheme. +ENV GITHUB_RAW raw.githubusercontent.com + +# The URL of the Snyk broker server +ENV BROKER_SERVER_URL https://broker.snyk.io + +# The fine detail accept rules that allow Snyk to make API requests to your +# GitHub account +ENV ACCEPT accept.json + + + + +EXPOSE $PORT + +HEALTHCHECK --interval=10s --timeout=1s \ + CMD wget -sq http://localhost:$PORT/healthcheck + +CMD ["broker", "--verbose"] diff --git a/dockerfiles/github-enterprise/Dockerfile b/dockerfiles/github-enterprise/Dockerfile new file mode 100644 index 000000000..76eb943db --- /dev/null +++ b/dockerfiles/github-enterprise/Dockerfile @@ -0,0 +1,67 @@ +FROM node:6-alpine + +MAINTAINER Snyk Ltd + +# Install broker +RUN npm install --global snyk-broker + +# Don't run as root +WORKDIR /home/node +USER node + +# Generate default accept filter +RUN broker init github + + + +###################################### +# Custom Broker Client configuration # +# Redefine in derived Dockerfile, # +# or provide as runtime args `-e` # +###################################### + +# The host where your GitHub Enterprise is running, excluding scheme. +ENV GITHUB=your.ghe.domain.com + +# Your unique broker identifier, copied from snyk.io org settings page +# ENV BROKER_TOKEN + +# Your personal access token to your github.com / GHE account +# ENV GITHUB_TOKEN + +# The port used by the broker client to accept webhooks +# Default value is 7341 +ENV PORT 7341 + +# The URL of your broker client (including scheme and port) +# This will be used as the webhook payload URL coming in from GitHub +# ENV BROKER_CLIENT_URL http://:$PORT + + + +####################################### +# Generic Broker Client configuration # +####################################### + +# The URL that the github API should be accessed at. +ENV GITHUB_API $GITHUB/api/v3 + +# The URL where raw file content is accessed, excluding scheme. +ENV GITHUB_RAW $GITHUB/raw + +# The URL of the Snyk broker server +ENV BROKER_SERVER_URL https://broker.snyk.io + +# The fine detail accept rules that allow Snyk to make API requests to your +# github enterprise instance +ENV ACCEPT accept.json + + + + +EXPOSE $PORT + +HEALTHCHECK --interval=10s --timeout=1s \ + CMD wget -sq http://localhost:$PORT/healthcheck + +CMD ["broker", "--verbose"]