From 10841795795ec79f599a95be6d0a73b196245579 Mon Sep 17 00:00:00 2001 From: Mac Siri Date: Thu, 7 Sep 2023 16:36:56 -0400 Subject: [PATCH] Update Gitpod's setup (#20026) --- .gitpod.dockerfile | 26 -------------------------- .gitpod.yml | 25 +++++++++++++------------ gitpod-init.sh | 9 --------- 3 files changed, 13 insertions(+), 47 deletions(-) delete mode 100644 .gitpod.dockerfile delete mode 100755 gitpod-init.sh diff --git a/.gitpod.dockerfile b/.gitpod.dockerfile deleted file mode 100644 index 1cb989f2c..000000000 --- a/.gitpod.dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -FROM gitpod/workspace-postgres - -# Install the GitHub CLI -RUN brew install gh - -# Install Ruby -ENV RUBY_VERSION=3.1.4 -RUN printf "rvm_gems_path=/home/gitpod/.rvm\n" > ~/.rvmrc \ - && bash -lc "rvm reinstall $RUBY_VERSION && \ - rvm use $RUBY_VERSION --default" \ - && printf "rvm_gems_path=/workspace/.rvm" > ~/.rvmrc \ - && printf "{ rvm use \$(rvm current); } >/dev/null 2>&1\n" >> "$HOME/.bashrc.d/70-ruby" - -# Install Node and Yarn -ENV NODE_VERSION=16.13.1 -RUN bash -c ". .nvm/nvm.sh && \ - nvm install ${NODE_VERSION} && \ - nvm alias default ${NODE_VERSION} && \ - npm install -g yarn" -ENV PATH=/home/gitpod/.nvm/versions/node/v${NODE_VERSION}/bin:$PATH - -# Install Redis. -RUN sudo apt-get update \ - && sudo apt-get install -y \ - redis-server \ - && sudo rm -rf /var/lib/apt/lists/* diff --git a/.gitpod.yml b/.gitpod.yml index a3907df4a..0c080ad44 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,6 +1,3 @@ -image: - file: .gitpod.dockerfile - ports: - port: 3000 onOpen: ignore @@ -12,25 +9,29 @@ ports: onOpen: ignore tasks: - - name: Forem Server - before: > - redis-server & - gp ports await 5432 && - sleep 1 - init: ./gitpod-init.sh - command: bin/startup - name: Open Site command: > gp ports await 3000 && printf "Waiting for local Forem development environment to load in the browser..." && - gp preview $(gp url 3000) + gp preview $(gp url 3000) && + exit + - name: Forem Server + before: | + cp .env_sample .env + echo "APP_DOMAIN=\"$(gp url 3000 | cut -f 3 -d /)\"" >> .env + echo 'APP_PROTOCOL="https://"' >> .env + echo 'COMMUNITY_NAME="DEV(Gitpod)"' >> .env + gem install dip + gem install solargraph + init: dip provision + command: dip up web github: prebuilds: # enable for the master/default branch (defaults to true) master: true # enable for all branches in this repo (defaults to false) - branches: true + branches: false # enable for pull requests coming from this repo (defaults to true) pullRequests: true # enable for pull requests coming from forks (defaults to false) diff --git a/gitpod-init.sh b/gitpod-init.sh deleted file mode 100755 index 2e9037e2e..000000000 --- a/gitpod-init.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -ln -s "$(which ruby)" "$(rvm gemdir)/bin/ruby" -cp .env_sample .env -echo "APP_DOMAIN=\"$(gp url 3000 | cut -f 3 -d /)\"" >> .env -echo 'APP_PROTOCOL="https://"' >> .env -gem install solargraph -gem install foreman -bin/setup