forked from google/WebFundamentals
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alternative dev workflow based on Docker.
Merge this as soon as we publish google/webfundamentals-dev Docker image.
- Loading branch information
Showing
7 changed files
with
118 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.git | ||
.sass-cache | ||
.editorconfig | ||
.gitignore | ||
.ruby-version | ||
.travis.yml | ||
node_modules | ||
tools | ||
src | ||
appengine/build | ||
Dockerfile | ||
LICENSE | ||
Makefile | ||
*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM node:0.10 | ||
|
||
RUN apt-get update && apt-get install -y ruby ruby-dev bundler fontforge ttfautohint | ||
|
||
ENV CLOUDSDK_CORE_DISABLE_PROMPTS=1 | ||
ENV CLOUDSDK_PYTHON_SITEPACKAGES=1 | ||
|
||
ADD https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz / | ||
RUN tar xzf google-cloud-sdk.tar.gz | ||
|
||
RUN /google-cloud-sdk/install.sh | ||
RUN /google-cloud-sdk/bin/gcloud config set component_manager/fixed_sdk_version 0.9.48 | ||
RUN /google-cloud-sdk/bin/gcloud components update app -q | ||
|
||
ADD . /wf/ | ||
WORKDIR /wf | ||
|
||
RUN bundle install | ||
RUN npm install || ( cat /wf/npm-debug.log && exit 1 ) | ||
RUN npm install -g grunt-cli | ||
|
||
ENV PATH=/google-cloud-sdk/platform/google_appengine:$PATH | ||
ENV DOCKER=1 | ||
|
||
VOLUME /wf/src | ||
VOLUME /wf/appengine/build | ||
|
||
CMD /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
image=${WF_DOCKER_IMAGE:-google/webfundamentals-dev} | ||
cmd=$1 | ||
action=$2 | ||
if [[ "$cmd" = "grunt" && "$action" = "develop" ]]; then | ||
action="develop-no-open" | ||
fi | ||
# remove $cmd and $action from $@ | ||
shift | ||
shift | ||
|
||
args="-v $(pwd)/src:/wf/src -v $(pwd)/appengine/build:/wf/appengine/build" | ||
if [[ "$action" = develop* ]]; then | ||
args="$args -p 8081:8081 -p 35729:35729" | ||
fi | ||
|
||
docker run -ti --rm $args $image $cmd $action "$@" | ||
|
||
# revert ownership of files generated by root within the container | ||
if [ "$cmd" = "grunt" ]; then | ||
owner=$(id -ru):$(id -rg) | ||
docker run --rm $args $image chown -R $owner /wf/appengine/build /wf/src/icons | ||
fi | ||
|