debian-mirror-gitlab/.gitpod.yml

133 lines
5.3 KiB
YAML
Raw Normal View History

2023-01-13 00:05:48 +05:30
# Gitpod file reference
# https://www.gitpod.io/docs/configure/workspaces/tasks
2021-06-08 01:23:25 +05:30
image: registry.gitlab.com/gitlab-org/gitlab-development-kit/gitpod-workspace:stable
2023-04-23 21:23:45 +05:30
checkoutLocation: gitlab-development-kit/gitlab
2021-01-03 14:25:43 +05:30
tasks:
- name: GDK
2023-01-13 00:05:48 +05:30
# "command:" emits gitpod-start
before: |
START_UNIXTIME="$(date +%s)"
echo START_UNIXTIME="$(date +%s)" > /workspace/gitpod_start_time.sh
2022-08-13 15:12:31 +05:30
command: |
2023-01-13 00:05:48 +05:30
# send signal to other tasks that Gitpod started
2022-08-13 15:12:31 +05:30
gp sync-done gitpod-start
2023-01-13 00:05:48 +05:30
echo "Waiting for other task to copy GDK.."
2022-08-13 15:12:31 +05:30
gp sync-await gdk-copied && cd /workspace/gitlab-development-kit && gdk help
2021-01-03 14:25:43 +05:30
2023-01-13 00:05:48 +05:30
- name: GitLab
# "command:" emits gdk-copied
init: |
2021-01-03 14:25:43 +05:30
(
set -e
2023-01-13 00:05:48 +05:30
echo "$(date) Copying GDK" | tee -a /workspace/startup.log
cp -r $HOME/gitlab-development-kit /workspace/
2021-01-03 14:25:43 +05:30
cd /workspace/gitlab-development-kit
2023-01-13 00:05:48 +05:30
mv -v /workspace/gitlab-development-kit/secrets.yml /workspace/gitlab-development-kit/gitlab/config
2021-11-18 22:05:49 +05:30
# ensure gdk.yml has correct instance settings
2023-01-13 00:05:48 +05:30
gdk config set gitlab.rails.port 443 |& tee -a /workspace/startup.log
gdk config set gitlab.rails.https.enabled true |& tee -a /workspace/startup.log
gdk config set webpack.host 127.0.0.1 |& tee -a /workspace/startup.log
gdk config set webpack.static false |& tee -a /workspace/startup.log
gdk config set webpack.live_reload false |& tee -a /workspace/startup.log
2021-01-03 14:25:43 +05:30
# 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
2023-01-13 00:05:48 +05:30
gp sync-await gitpod-start
2022-08-13 15:12:31 +05:30
[[ -f /workspace/gitpod_start_time.sh ]] && source /workspace/gitpod_start_time.sh
2021-01-03 14:25:43 +05:30
SECONDS=0
cd /workspace/gitlab-development-kit
2023-07-09 08:55:56 +05:30
make gitlab-update
make gitlab-shell-update
make gitlab-workhorse-update
2021-01-03 14:25:43 +05:30
# update GDK
if [ "$GITLAB_UPDATE_GDK" == true ]; then
echo "$(date) Updating GDK" | tee -a /workspace/startup.log
gdk update
fi
2021-11-18 22:05:49 +05:30
# 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
2022-01-26 12:08:38 +05:30
gdk config set webpack.host 127.0.0.1
2022-05-07 20:08:51 +05:30
gdk config set webpack.static false
gdk config set webpack.live_reload false
2021-11-18 22:05:49 +05:30
# reconfigure GDK
echo "$(date) Reconfiguring GDK" | tee -a /workspace/startup.log
gdk reconfigure
2021-01-03 14:25:43 +05:30
# start GDK
echo "$(date) Starting GDK" | tee -a /workspace/startup.log
2021-01-29 00:20:46 +05:30
export DEV_SERVER_PUBLIC_ADDR=$(gp url 3808)
2021-01-03 14:25:43 +05:30
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-03-11 19:13:27 +05:30
cd /workspace/gitlab-development-kit/gitlab
2023-01-13 00:05:48 +05:30
echo "--- on branch: $(git branch --show-current)"
echo "--- installing lefthook"
2021-03-11 19:13:27 +05:30
bundle exec lefthook install
2023-01-13 00:05:48 +05:30
echo "--- resetting db/structure.sql"
2021-01-29 00:20:46 +05:30
git checkout db/structure.sql
2023-01-13 00:05:48 +05:30
echo "--- waiting for GitLab"
2022-08-13 15:12:31 +05:30
gp ports await 3000
2023-01-13 00:05:48 +05:30
printf "Awaiting /-/readiness on $(gp url 3000) ..."
2021-10-27 15:23:28 +05:30
# Check /-/readiness which returns JSON, but we're only interested in the exit code
#
2021-12-11 22:18:48 +05:30
# We use http://localhost:3000 instead of the public hostname because
2021-10-27 15:23:28 +05:30
# 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 ""
2021-01-03 14:25:43 +05:30
# 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-08-13 15:12:31 +05:30
PREBUILD_LOG=(/workspace/.gitpod/prebuild-log-*)
2023-01-13 00:05:48 +05:30
[[ -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_UNIXTIME}))/60))e-1" "$([[ -f "$PREBUILD_LOG" ]] && echo "With Prebuilds")"
2021-01-03 14:25:43 +05:30
)
ports:
2021-10-27 15:23:28 +05:30
- port: 2222 # sshd
2021-01-03 14:25:43 +05:30
onOpen: ignore
2021-10-27 15:23:28 +05:30
- port: 3000 # rails-web
onOpen: notify
2021-12-11 22:18:48 +05:30
- port: 3005 # gitlab-docs
onOpen: notify
2021-01-03 14:25:43 +05:30
- 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-06-21 17:19:12 +05:30
- port: 9122 # gitlab-shell
onOpen: ignore
2021-01-03 14:25:43 +05:30
vscode:
extensions:
2022-11-25 23:54:43 +05:30
- 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
2023-01-13 00:05:48 +05:30
- GitLab.gitlab-workflow@3.56.0
2022-11-25 23:54:43 +05:30
- DavidAnson.vscode-markdownlint@0.47.0
2023-07-09 08:55:56 +05:30
- esbenp.prettier-vscode