Skip to content

Commit

Permalink
Merge pull request #112 from screwdriver-cd/dockerize
Browse files Browse the repository at this point in the history
feat: create a Dockerfile that serves an instance of the guide
  • Loading branch information
tkyi authored Sep 30, 2017
2 parents ad361e9 + ed4afa2 commit 99551d6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ruby:2.4-alpine

# Create our application directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# Install guide
RUN set -x \
# Missing https for some magical reason; need build tools for jekyll install
&& apk add --no-cache --update ca-certificates build-base \
# You know you're using a lean image when you need to install wget
&& apk add --virtual wget \
# Fetch the latest Guide release
&& wget -q -O - https://github.com/screwdriver-cd/guide/releases/latest \
| egrep -o '/screwdriver-cd/guide/releases/download/v[0-9.]*/guide.tgz' \
| wget --base=http://github.com/ -i - -O guide.tgz \
&& tar -zxvf guide.tgz \
# General clean-up
&& rm -rf guide.tgz \
# Need jekyll to serve the pages
&& gem install jekyll

EXPOSE 4000

CMD ["jekyll", "serve", "--force_polling", "-H", "0.0.0.0", "-P", "4000"]
8 changes: 7 additions & 1 deletion screwdriver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,23 @@ jobs:

publish:
environment:
DOCKER_REPO: screwdrivercd/guide
RELEASE_FILE: guide.tgz
secrets:
- DOCKER_TRIGGER
- GIT_KEY
- GITHUB_TOKEN
steps:
- setup-ci: git clone https://gist.github.com/3d2388b2a7ba658cdcdaffa8cd874e50.git ci
- setup-ci: git clone https://github.com/screwdriver-cd/toolbox.git ci
- install: bundle install
- build: bundle exec jekyll build --source docs --destination _site
- package: tar -C _site -cvzf $RELEASE_FILE .
- tag: ./ci/git-tag.sh
- publish: ./ci/git-release.sh
- docker: |
./ci/git-latest.sh
export DOCKER_TAG=`cat VERSION`
./ci/docker-trigger.sh
deploy:
steps:
Expand Down

0 comments on commit 99551d6

Please sign in to comment.