Skip to content

Commit

Permalink
feat: dockerfiles, travis webhook to publish dockers
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Drukh committed Jun 26, 2017
1 parent c1470fb commit 64aa7d6
Show file tree
Hide file tree
Showing 4 changed files with 192 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sudo: false
dist: trusty
language: node_js
cache:
directories:
Expand All @@ -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+$/
55 changes: 55 additions & 0 deletions dockerfiles/bitbucket-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <broker-token>

# Your personal username to your bitbucket server account
ENV BITBUCKET_USERNAME <username>

# Your personal password to your bitbucket server account
ENV BITBUCKET_PASSWORD <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"]
67 changes: 67 additions & 0 deletions dockerfiles/github-com/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <broker-token>

# Your personal access token to your github.com / GHE account
# ENV GITHUB_TOKEN <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://<broker.client.hostname>:$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"]
67 changes: 67 additions & 0 deletions dockerfiles/github-enterprise/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <broker-token>

# Your personal access token to your github.com / GHE account
# ENV GITHUB_TOKEN <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://<broker.client.hostname>:$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"]

0 comments on commit 64aa7d6

Please sign in to comment.