2021-04-27 05:09:46 -04:00
|
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-development-kit/gitpod-workspace:stable
|
2020-10-16 05:09:06 -04:00
|
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
|
|
- name: GDK
|
2022-06-24 02:09:33 -04:00
|
|
|
|
command: |
|
|
|
|
|
echo START_TIME_IN_SECONDS="$(date +%s)" | tee /workspace/gitpod_start_time.sh
|
2022-07-06 08:08:36 -04:00
|
|
|
|
gp sync-done gitpod-start
|
2022-06-24 02:09:33 -04:00
|
|
|
|
gp sync-await gdk-copied && cd /workspace/gitlab-development-kit && gdk help
|
2020-10-16 05:09:06 -04:00
|
|
|
|
|
|
|
|
|
- init: |
|
|
|
|
|
echo "$(date) – Copying GDK" | tee -a /workspace/startup.log
|
|
|
|
|
cp -r $HOME/gitlab-development-kit /workspace/
|
|
|
|
|
(
|
|
|
|
|
set -e
|
|
|
|
|
cd /workspace/gitlab-development-kit
|
2022-05-26 02:08:37 -04:00
|
|
|
|
# Ensure GitLab directory is symlinked under the GDK
|
|
|
|
|
ln -nfs "$GITPOD_REPO_ROOT" /workspace/gitlab-development-kit/gitlab
|
2020-10-27 14:08:59 -04:00
|
|
|
|
mv /workspace/gitlab-development-kit/secrets.yml /workspace/gitlab-development-kit/gitlab/config
|
2021-10-12 20:09:55 -04:00
|
|
|
|
# ensure gdk.yml has correct instance settings
|
2021-08-30 20:10:56 -04:00
|
|
|
|
gdk config set gitlab.rails.port 443
|
|
|
|
|
gdk config set gitlab.rails.https.enabled true
|
2021-12-12 22:14:39 -05:00
|
|
|
|
gdk config set webpack.host 127.0.0.1
|
2022-03-03 13:19:46 -05:00
|
|
|
|
gdk config set webpack.static false
|
|
|
|
|
gdk config set webpack.live_reload false
|
2020-10-16 05:09:06 -04:00
|
|
|
|
# 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: |
|
|
|
|
|
(
|
2022-07-06 08:08:36 -04:00
|
|
|
|
gp sync-await gitpod-start
|
2020-10-16 05:09:06 -04:00
|
|
|
|
set -e
|
|
|
|
|
gp sync-done gdk-copied
|
2022-07-06 08:08:36 -04:00
|
|
|
|
[[ -f /workspace/gitpod_start_time.sh ]] && source /workspace/gitpod_start_time.sh
|
2020-10-16 05:09:06 -04:00
|
|
|
|
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
|
2021-10-12 20:09:55 -04:00
|
|
|
|
# ensure gdk.yml has correct instance settings
|
|
|
|
|
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
|
2021-12-12 22:14:39 -05:00
|
|
|
|
gdk config set webpack.host 127.0.0.1
|
2022-03-03 13:19:46 -05:00
|
|
|
|
gdk config set webpack.static false
|
|
|
|
|
gdk config set webpack.live_reload false
|
2021-10-12 20:09:55 -04:00
|
|
|
|
# reconfigure GDK
|
|
|
|
|
echo "$(date) – Reconfiguring GDK" | tee -a /workspace/startup.log
|
|
|
|
|
gdk reconfigure
|
2020-10-16 05:09:06 -04:00
|
|
|
|
# start GDK
|
|
|
|
|
echo "$(date) – Starting GDK" | tee -a /workspace/startup.log
|
2020-11-17 04:09:23 -05:00
|
|
|
|
export DEV_SERVER_PUBLIC_ADDR=$(gp url 3808)
|
2020-10-16 05:09:06 -04:00
|
|
|
|
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
|
2021-01-27 04:09:01 -05:00
|
|
|
|
cd /workspace/gitlab-development-kit/gitlab
|
2021-08-04 23:10:19 -04:00
|
|
|
|
# Display which branch we're on
|
|
|
|
|
git branch --show-current
|
2021-01-27 04:09:01 -05:00
|
|
|
|
# Install Lefthook
|
|
|
|
|
bundle exec lefthook install
|
2020-11-11 04:09:06 -05:00
|
|
|
|
git checkout db/structure.sql
|
2021-01-27 04:09:01 -05:00
|
|
|
|
cd /workspace/gitlab-development-kit
|
2020-10-16 05:09:06 -04:00
|
|
|
|
# Waiting for GitLab ...
|
2022-07-06 08:08:36 -04:00
|
|
|
|
gp ports await 3000
|
2020-10-16 05:09:06 -04:00
|
|
|
|
printf "Waiting for GitLab at $(gp url 3000) ..."
|
2021-08-05 02:09:25 -04:00
|
|
|
|
# Check /-/readiness which returns JSON, but we're only interested in the exit code
|
|
|
|
|
#
|
2021-10-26 05:09:57 -04:00
|
|
|
|
# We use http://localhost:3000 instead of the public hostname because
|
2021-08-05 02:09:25 -04:00
|
|
|
|
# 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 ""
|
2020-10-16 05:09:06 -04:00
|
|
|
|
# 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
|
2022-06-24 02:09:33 -04:00
|
|
|
|
PREBUILD_LOG=(/workspace/.gitpod/prebuild-log-*)
|
2022-10-03 05:09:43 -04:00
|
|
|
|
[[ -f /workspace/gitpod_start_time.sh ]] && printf "Took %.1f minutes from https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitpod.yml being executed through to completion %s\n" "$((10*(($(date +%s)-${START_TIME_IN_SECONDS}))/60))e-1" "$([[ -f "$PREBUILD_LOG" ]] && echo "With Prebuilds")"
|
2020-10-16 05:09:06 -04:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ports:
|
2021-08-03 23:09:14 -04:00
|
|
|
|
- port: 2222 # sshd
|
2020-10-16 05:09:06 -04:00
|
|
|
|
onOpen: ignore
|
2021-08-03 23:09:14 -04:00
|
|
|
|
- port: 3000 # rails-web
|
|
|
|
|
onOpen: notify
|
2021-11-09 01:13:00 -05:00
|
|
|
|
- port: 3005 # gitlab-docs
|
|
|
|
|
onOpen: notify
|
2020-10-16 05:09:06 -04:00
|
|
|
|
- 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
|
2022-03-24 20:07:56 -04:00
|
|
|
|
- port: 9122 # gitlab-shell
|
|
|
|
|
onOpen: ignore
|
2020-10-16 05:09:06 -04:00
|
|
|
|
|
|
|
|
|
vscode:
|
|
|
|
|
extensions:
|
2022-10-03 05:09:43 -04:00
|
|
|
|
- rebornix.ruby@0.28.1
|
|
|
|
|
- wingrunr21.vscode-ruby@0.28.0
|
|
|
|
|
- karunamurti.haml@1.4.1
|
|
|
|
|
- octref.vetur@0.36.0
|
|
|
|
|
- dbaeumer.vscode-eslint@2.2.6
|
|
|
|
|
- GitLab.gitlab-workflow@3.48.1
|
|
|
|
|
- DavidAnson.vscode-markdownlint@0.47.0
|