summaryrefslogtreecommitdiffstats
path: root/.gitpod.yml
blob: 8671edc47cc74e485d87eebcb0e8118bf3c8a28b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
tasks:
  - name: Setup
    init: |
      cp -r contrib/ide/vscode .vscode
      make deps
      make build
    command: |
      gp sync-done setup
      exit 0
  - name: Run backend
    command: |
      gp sync-await setup

      # Get the URL and extract the domain
      url=$(gp url 3000)
      domain=$(echo $url | awk -F[/:] '{print $4}')

      if [ -f custom/conf/app.ini ]; then
        sed -i "s|^ROOT_URL =.*|ROOT_URL = ${url}/|" custom/conf/app.ini
        sed -i "s|^DOMAIN =.*|DOMAIN = ${domain}|" custom/conf/app.ini
        sed -i "s|^SSH_DOMAIN =.*|SSH_DOMAIN = ${domain}|" custom/conf/app.ini
        sed -i "s|^NO_REPLY_ADDRESS =.*|SSH_DOMAIN = noreply.${domain}|" custom/conf/app.ini
      else
        mkdir -p custom/conf/
        echo -e "[server]\nROOT_URL = ${url}/" > custom/conf/app.ini
        echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = $GITPOD_REPO_ROOT/data/gitea.db" >> custom/conf/app.ini
      fi
      export TAGS="sqlite sqlite_unlock_notify"
      make watch-backend
  - name: Run frontend
    command: |
      gp sync-await setup
      make watch-frontend
    openMode: split-right

vscode:
  extensions:
    - editorconfig.editorconfig
    - dbaeumer.vscode-eslint
    - golang.go
    - stylelint.vscode-stylelint
    - DavidAnson.vscode-markdownlint
    - Vue.volar
    - ms-azuretools.vscode-docker
    - vitest.explorer
    - cweijan.vscode-database-client2
    - GitHub.vscode-pull-request-github

ports:
  - name: Gitea
    port: 3000