From 769a67211fad40fab66107dfde7a2f299058cff5 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Tue, 6 Aug 2019 17:58:07 +0200 Subject: [PATCH] fix(tools): integrate gitpod for development workflow (#36302) --- .gitpod.Dockerfile | 8 ++++++++ .gitpod.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 6 ++++++ 3 files changed, 57 insertions(+) create mode 100644 .gitpod.Dockerfile create mode 100644 .gitpod.yml diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 00000000000000..f095f37d6dece9 --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,8 @@ +FROM gitpod/workspace-full + +USER gitpod +WORKDIR $HOME + +RUN wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.6.13.tgz && \ + mkdir -p mongodb && \ + tar xaf mongodb-linux-x86_64-ubuntu1604-3.6.13.tgz -C mongodb --strip-components=1 diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000000000..fd62f57bd2329a --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,43 @@ +image: + file: .gitpod.Dockerfile +ports: +- port: 27017 # mongodb + onOpen: ignore +- port: 8000 # client + onOpen: open-preview +- port: 9228 # node debug + onOpen: ignore +- port: 3000 # api + onOpen: ignore +- port: 9229 # node debug + onOpen: ignore + +tasks: +- name: db + # starting mongo in background, so it doesn't block prebuilds + before: > + mkdir -p /workspace/data && + (~/mongodb/bin/mongod --dbpath /workspace/data &) + +- name: server + before: export COOKIE_DOMAIN=gitpod.io && export HOME_LOCATION=$(gp url 8000) && export API_LOCATION=$(gp url 3000) + # init is not executed for prebuilt workspaces and restarts, + # so we should put all the heavy initialization here + init: > + cp sample.env .env && + npm ci && + gp await-port 27017 && + npm run seed && + ~/mongodb/bin/mongo --eval "db.fsyncLock(); db.fsyncUnlock()" + command: > + npm run ensure-env && + gp await-port 27017 && + npm run develop:server + +- name: client + before: export HOME_LOCATION=$(gp url 8000) && export API_LOCATION=$(gp url 3000) + command: > + gp await-port 3000 && + cd ./client && + npm run develop -- -H '0.0.0.0' + openMode: split-right diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 44a56ac3e8c423..1bc8dd26a99909 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -103,6 +103,12 @@ Essentially, we expect basic familiarity with some of the aforementioned technol **If you want to help us improve our codebase, here's [how to setup freeCodeCamp locally](/docs/how-to-setup-freecodecamp-locally.md).** +If you want to help us improve our codebase, you can either [setup freeCodeCamp locally](/docs/how-to-setup-freecodecamp-locally.md) or use Gitpod, a free online dev environment. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/freeCodeCamp/freeCodeCamp) + +(Starts a ready-to-code dev environment for freecodecamp in your browser.) + Feel free to ask us questions on the related issue threads, and we will be glad to clarify. When in doubt, you can reach out to our platform dev team to help you with this: | Name | GitHub | Twitter |