From 901e652fdd914cd00aabc8295fbb52a8b5992515 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Tue, 11 Oct 2022 16:28:03 +0000 Subject: [PATCH 1/4] Add Gitpod to documentation Signed-off-by: Yarden Shoham --- README.md | 6 ++++++ README_ZH.md | 6 ++++++ docs/content/doc/developers/hacking-on-gitea.en-us.md | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/README.md b/README.md index 80f1159aea1fa..115cafb58d4ae 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,12 @@ + + Contribute with Gitpod + diff --git a/README_ZH.md b/README_ZH.md index 2be35742672fd..0e58ad6d4a46e 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -33,6 +33,12 @@ + + Contribute with Gitpod + diff --git a/docs/content/doc/developers/hacking-on-gitea.en-us.md b/docs/content/doc/developers/hacking-on-gitea.en-us.md index 5f1cdff51d57f..8684f9d734e42 100644 --- a/docs/content/doc/developers/hacking-on-gitea.en-us.md +++ b/docs/content/doc/developers/hacking-on-gitea.en-us.md @@ -19,6 +19,12 @@ menu: {{< toc >}} +## Quickstart + +To get a quick working development environment you may use Gitpod. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/go-gitea/gitea) + ## Installing go You should [install go](https://golang.org/doc/install) and set up your go From 281680e8976acf072d9278ea864334d813308542 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Tue, 11 Oct 2022 16:41:42 +0000 Subject: [PATCH 2/4] Refactor .gitpod.yaml * Remove default image (redundant) * Use gp command to generate URL * Add Vue and Docker extensions * Watch hugo docs Signed-off-by: Yarden Shoham --- .gitpod.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index eb3114ce0b262..6b170c9d41d45 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,5 +1,3 @@ -image: gitpod/workspace-full:latest - tasks: - name: Setup init: | @@ -16,10 +14,13 @@ tasks: command: | gp sync-await setup mkdir -p custom/conf/ - echo -e "[server]\nROOT_URL=https://3000-$GITPOD_WORKSPACE_ID.${GITPOD_WORKSPACE_CLUSTER_HOST}/" > custom/conf/app.ini + echo -e "[server]\nROOT_URL=$(gp url 3000)/" > custom/conf/app.ini echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = /workspace/gitea/data/gitea.db" >> custom/conf/app.ini export TAGS="sqlite sqlite_unlock_notify" make watch-backend + - name: Run docs + before: sudo bash -c "$(grep 'https://github.com/gohugoio/hugo/releases/download' Makefile | tr -d '\')" # install hugo + command: cd docs && make clean update && hugo server -D -F --baseUrl $(gp url 1313) --liveReloadPort=443 --appendPort=false --bind=0.0.0.0 vscode: extensions: @@ -28,7 +29,11 @@ vscode: - golang.go - stylelint.vscode-stylelint - DavidAnson.vscode-markdownlint + - johnsoncodehk.volar + - ms-azuretools.vscode-docker ports: - name: Gitea port: 3000 + - name: Docs + port: 1313 \ No newline at end of file From 3ae29bf7fa3aa6eda4e774b5698465021e094f12 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Wed, 12 Oct 2022 00:24:25 +0300 Subject: [PATCH 3/4] Update docs/content/doc/developers/hacking-on-gitea.en-us.md Co-authored-by: Gusted --- docs/content/doc/developers/hacking-on-gitea.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/doc/developers/hacking-on-gitea.en-us.md b/docs/content/doc/developers/hacking-on-gitea.en-us.md index 8684f9d734e42..d8427b58f32b0 100644 --- a/docs/content/doc/developers/hacking-on-gitea.en-us.md +++ b/docs/content/doc/developers/hacking-on-gitea.en-us.md @@ -21,7 +21,7 @@ menu: ## Quickstart -To get a quick working development environment you may use Gitpod. +To get a quick working development environment you could use Gitpod. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/go-gitea/gitea) From 8f8d31a3a86bb46acbd8214eb8709f42b6ff38a3 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Tue, 11 Oct 2022 23:13:34 +0000 Subject: [PATCH 4/4] Use GITPOD_REPO_ROOT to get workspace repo If a fork isn't named "gitea" the previous code would breai Signed-off-by: Yarden Shoham --- .gitpod.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 6b170c9d41d45..55a12cc9e4791 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -15,7 +15,7 @@ tasks: gp sync-await setup mkdir -p custom/conf/ echo -e "[server]\nROOT_URL=$(gp url 3000)/" > custom/conf/app.ini - echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = /workspace/gitea/data/gitea.db" >> custom/conf/app.ini + echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = $GITPOD_REPO_ROOT/data/gitea.db" >> custom/conf/app.ini export TAGS="sqlite sqlite_unlock_notify" make watch-backend - name: Run docs @@ -36,4 +36,4 @@ ports: - name: Gitea port: 3000 - name: Docs - port: 1313 \ No newline at end of file + port: 1313