gitlab-org--gitlab-foss/.gitpod.yml

101 lines
3.7 KiB
YAML
Raw Normal View History

image: registry.gitlab.com/gitlab-org/gitlab-development-kit/gitpod-workspace:stable
tasks:
- name: GDK
command: gp sync-await gdk-copied && cd /workspace/gitlab-development-kit && gdk help
- init: |
echo "$(date) Copying GDK" | tee -a /workspace/startup.log
cp -r $HOME/gitlab-development-kit /workspace/
(
set -e
cd /workspace/gitlab-development-kit
# GitLab FOSS
[[ -d /workspace/gitlab-foss ]] && ln -fs /workspace/gitlab-foss /workspace/gitlab-development-kit/gitlab
# GitLab
[[ -d /workspace/gitlab ]] && ln -fs /workspace/gitlab /workspace/gitlab-development-kit/gitlab
mv /workspace/gitlab-development-kit/secrets.yml /workspace/gitlab-development-kit/gitlab/config
# update gdk.yml
gdk config set gitlab.rails.hostname $(gp url 3000 | sed -e 's+^http[s]*://++')
gdk config set gitlab.rails.port 443
gdk config set gitlab.rails.https.enabled true
# reconfigure GDK
echo "$(date) Reconfiguring GDK" | tee -a /workspace/startup.log
gdk reconfigure
# run DB migrations
echo "$(date) Running DB migrations" | tee -a /workspace/startup.log
make gitlab-db-migrate
# stop GDK
echo "$(date) Stopping GDK" | tee -a /workspace/startup.log
gdk stop
echo "$(date) GDK stopped" | tee -a /workspace/startup.log
)
command: |
(
set -e
gp sync-done gdk-copied
SECONDS=0
cd /workspace/gitlab-development-kit
# update GDK
if [ "$GITLAB_UPDATE_GDK" == true ]; then
echo "$(date) Updating GDK" | tee -a /workspace/startup.log
gdk update
fi
# start GDK
echo "$(date) Starting GDK" | tee -a /workspace/startup.log
export DEV_SERVER_PUBLIC_ADDR=$(gp url 3808)
export RAILS_HOSTS=$(gp url 3000 | sed -e 's+^http[s]*://++')
gdk start
# Run DB migrations
if [ "$GITLAB_RUN_DB_MIGRATIONS" == true ]; then
make gitlab-db-migrate
fi
cd /workspace/gitlab-development-kit/gitlab
# Display which branch we're on
git branch --show-current
# Install Lefthook
bundle exec lefthook install
git checkout db/structure.sql
cd /workspace/gitlab-development-kit
# Waiting for GitLab ...
gp await-port 3000
printf "Waiting for GitLab at $(gp url 3000) ..."
# Check /-/readiness which returns JSON, but we're only interested in the exit code
#
# We use http://localhost:3000 instead of the public hostname because
# it's no longer possible to access as specific cookies are required
until curl --silent --no-buffer --fail http://localhost:3000/-/readiness > /dev/null 2>&1; do printf '.'; sleep 5; done && echo ""
# Give Gitpod a few more seconds to set up everything ...
sleep 5
printf "$(date) GitLab is up (took ~%.1f minutes)\n" "$((10*$SECONDS/60))e-1" | tee -a /workspace/startup.log
gp preview $(gp url 3000) || true
# Speed up backend tests
export GITLAB_TEST_EAGER_LOAD=false
)
ports:
- port: 2222 # sshd
onOpen: ignore
- port: 3000 # rails-web
onOpen: notify
- port: 3010 # gitlab-pages
onOpen: ignore
- port: 3808 # webpack
onOpen: ignore
- port: 5000 # auto_devops
onOpen: ignore
- port: 5778 # jaeger
onOpen: ignore
- port: 9000 # object_store / minio
onOpen: ignore
vscode:
extensions:
- rebornix.ruby@0.28.0
- wingrunr21.vscode-ruby@0.27.0
- karunamurti.haml@1.3.1
- octref.vetur@0.34.1
- dbaeumer.vscode-eslint@2.1.8
- gitlab.gitlab-workflow@3.24.0