Skip to content

Commit

Permalink
Automated DEV setup using Gitpod (forem#2321)
Browse files Browse the repository at this point in the history
  • Loading branch information
jankeromnes authored and benhalpern committed Apr 7, 2019
1 parent 3b4bda8 commit 6bc248e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitpod.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM gitpod/workspace-postgres

# Install Ruby
COPY .ruby-version /tmp
RUN bash -lc "rvm install ruby-$(cat /tmp/.ruby-version)" \
&& rm -f /tmp/*
24 changes: 24 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
image:
file: .gitpod.dockerfile
ports:
- port: 3000
onOpen: open-preview
- port: 3035
onOpen: ignore
- port: 5432
onOpen: ignore
tasks:
- init: >
cp config/sample_application.yml config/application.yml &&
bin/setup 2>/dev/null
command: >
while [ -z "${ALGOLIASEARCH_APPLICATION_ID:=$(cat config/application.yml | grep ALGOLIASEARCH_APPLICATION_ID | sed 's/.*:\s*//')}" ] ||
[ -z "${ALGOLIASEARCH_SEARCH_ONLY_KEY:=$(cat config/application.yml | grep ALGOLIASEARCH_SEARCH_ONLY_KEY | sed 's/.*:\s*//')}" ] ||
[ -z "${ALGOLIASEARCH_API_KEY:=$(cat config/application.yml | grep ALGOLIASEARCH_API_KEY | sed 's/.*:\s*//')}" ] ; do
gp open config/application.yml 2>/dev/null &&
printf "\n❗ Dev.to requires free Algolia credentials.\n" &&
printf "❗ To get them, please follow https://docs.dev.to/get-api-keys-dev-env/#algolia\n\n" &&
read -p "Add them to config/application.yml, save the file, and press any key to continue... " -n 1 -r
done ;
bin/setup &&
bin/startup
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ Our docker implementation is incomplete and may not work smoothly. Please kindly
1. run `docker-compose up`
1. That's it! Navigate to `localhost:3000`
### Gitpod Installation
Simply open dev.to in Gitpod, a free online dev environment for GitHub:
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/thepracticaldev/dev.to)
#### Starting the application
We're mostly a Rails app, with a bit of Webpack sprinkled in. **For most cases, simply running `bin/rails server` will do.** If you're working with Webpack though, you'll need to run the following:
Expand Down

0 comments on commit 6bc248e

Please sign in to comment.