Automated DEV setup using Gitpod (#2321)
This commit is contained in:
parent
3b4bda89df
commit
6bc248e43b
3 changed files with 36 additions and 0 deletions
6
.gitpod.dockerfile
Normal file
6
.gitpod.dockerfile
Normal file
|
|
@ -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
.gitpod.yml
Normal file
24
.gitpod.yml
Normal file
|
|
@ -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
|
||||||
|
|
@ -187,6 +187,12 @@ Our docker implementation is incomplete and may not work smoothly. Please kindly
|
||||||
1. run `docker-compose up`
|
1. run `docker-compose up`
|
||||||
1. That's it! Navigate to `localhost:3000`
|
1. That's it! Navigate to `localhost:3000`
|
||||||
|
|
||||||
|
### Gitpod Installation
|
||||||
|
|
||||||
|
Simply open dev.to in Gitpod, a free online dev environment for GitHub:
|
||||||
|
|
||||||
|
[](https://gitpod.io/#https://github.com/thepracticaldev/dev.to)
|
||||||
|
|
||||||
#### Starting the application
|
#### 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:
|
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:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue