Skip to content

Commit

Permalink
convert Tiltfile to new liveupdate (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicks committed Apr 10, 2019
1 parent 725b8f5 commit b9f20d8
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 29 deletions.
9 changes: 0 additions & 9 deletions Dockerfile

This file was deleted.

27 changes: 14 additions & 13 deletions Tiltfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# -*- mode: Python -*-

default_registry('gcr.io/windmill-public-containers')

# Generate the API docs.
read_file('api/api.py')
local('make api')

k8s_yaml('serve.yaml')

img = fast_build('gcr.io/windmill-public-containers/tilt-site',
'base.dockerfile',
'bundle exec jekyll serve --config _config.yml,_config-dev.yml')
img.add('./src', '/src/')
img.run('bundle install', trigger=['src/Gemfile', 'src/Gemfile.lock'])
img.hot_reload()
docker_build('tilt-site', 'src', dockerfile='site.dockerfile',
live_update = [
sync('./src', '/src/'),
run('bundle install', trigger=['src/Gemfile', 'src/Gemfile.lock'])
])

img = fast_build('gcr.io/windmill-public-containers/docs-site',
'docs.dockerfile',
'bundle exec jekyll serve --config _config.yml,_config-dev.yml')
img.add('./src', '/src/')
img.add('./docs', '/docs/')
img.run('bundle install', trigger=['src/Gemfile', 'src/Gemfile.lock', 'docs/Gemfile', 'docs/Gemfile.lock'])
img.hot_reload()
docker_build('docs-site', '.', dockerfile='docs.dockerfile',
live_update = [
sync('./src', '/src/'),
sync('./docs', '/docs/'),
run('bundle install', trigger=['src/Gemfile', 'src/Gemfile.lock',
'docs/Gemfile', 'docs/Gemfile.lock'])
])

k8s_resource('tilt-site', port_forwards=4000)
k8s_resource('docs-site', port_forwards=4001)
5 changes: 0 additions & 5 deletions base.dockerfile

This file was deleted.

10 changes: 10 additions & 0 deletions docs.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@ FROM ruby:2.6
RUN gem install jekyll bundler

WORKDIR /docs

RUN mkdir -p /src
RUN mkdir -p /docs
ADD src/Gemfile* /src/
ADD docs/Gemfile* /docs/

RUN bundle install
ADD src /src/
ADD docs /docs/
ENTRYPOINT bundle exec jekyll serve --config _config.yml,_config-dev.yml
4 changes: 2 additions & 2 deletions serve.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: tilt-site
image: gcr.io/windmill-public-containers/tilt-site
image: tilt-site
ports:
- containerPort: 4000
---
Expand All @@ -32,6 +32,6 @@ spec:
spec:
containers:
- name: docs-site
image: gcr.io/windmill-public-containers/docs-site
image: docs-site
ports:
- containerPort: 4000
10 changes: 10 additions & 0 deletions site.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ruby:2.6

RUN gem install jekyll bundler

WORKDIR /src

ADD ./Gemfile* /src/
RUN bundle install
ADD . .
ENTRYPOINT bundle exec jekyll serve --config _config.yml,_config-dev.yml

0 comments on commit b9f20d8

Please sign in to comment.