forked from woodpecker-ci/woodpecker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitpod.yml
98 lines (96 loc) · 3.56 KB
/
.gitpod.yml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
tasks:
- name: Server
env:
WOODPECKER_OPEN: true
WOODPECKER_ADMIN: woodpecker
WOODPECKER_HOST: http://host.docker.internal:8000
WOODPECKER_SECRET: "1234"
WOODPECKER_GITEA: true
WOODPECKER_DEV_WWW_PROXY: http://localhost:8010
WOODPECKER_BACKEND_DOCKER_NETWORK: ci_default
init: |
go mod tidy
mkdir -p web/dist
touch web/dist/index.html
command: |
echo WOODPECKER_GITEA_URL=https://3000-${GITPOD_WORKSPACE_ID}.${GITPOD_WORKSPACE_CLUSTER_HOST} >> .env
echo WOODPECKER_DEV_OAUTH_HOST=https://8000-${GITPOD_WORKSPACE_ID}.${GITPOD_WORKSPACE_CLUSTER_HOST} >> .env
gp sync-await gitea
gp sync-done woodpecker-server
go run github.com/woodpecker-ci/woodpecker/cmd/server
- name: Agent
env:
WOODPECKER_SERVER: localhost:9000
WOODPECKER_SECRET: "1234"
WOODPECKER_MAX_PROCS: 1
WOODPECKER_HEALTHCHECK: false
command: |
gp sync-await woodpecker-server
go run github.com/woodpecker-ci/woodpecker/cmd/agent
- name: Gitea
command: |
export DOCKER_COMPOSE_CMD="docker-compose -f docker-compose.gitpod.yml -p woodpecker"
export GITEA_CLI_CMD="$DOCKER_COMPOSE_CMD exec -u git gitea gitea"
$DOCKER_COMPOSE_CMD up -d
sleep 10s
$GITEA_CLI_CMD admin user create --username woodpecker --password password --email woodpecker@localhost --admin
export GITEA_TOKEN=$($GITEA_CLI_CMD admin user generate-access-token -u woodpecker --raw)
GITEA_OAUTH_APP=$(curl -X 'POST' 'http://localhost:3000/api/v1/user/applications/oauth2' \
-H 'accept: application/json' -H 'Content-Type: application/json' -H "Authorization: token ${GITEA_TOKEN}" \
-d "{ \"name\": \"Woodpecker CI\", \"redirect_uris\": [ \"https://8000-${GITPOD_WORKSPACE_ID}.${GITPOD_WORKSPACE_CLUSTER_HOST}/authorize\" ] }")
echo WOODPECKER_GITEA_CLIENT=$(echo $GITEA_OAUTH_APP | jq -r .client_id) >> .env
echo WOODPECKER_GITEA_SECRET=$(echo $GITEA_OAUTH_APP | jq -r .client_secret) >> .env
curl -X 'POST' \
'http://localhost:3000/api/v1/user/repos' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H "Authorization: token ${GITEA_TOKEN}" \
-d '{ "auto_init": false, "name": "woodpecker-test", "private": true, "template": false, "trust_model": "default" }'
cd contrib/woodpecker-test-repo
git init
git checkout -b main
git remote add origin http://woodpecker:${GITEA_TOKEN}@localhost:3000/woodpecker/woodpecker-test.git
git add .
git commit -m ":tada: Initial commit"
git push -u origin main
gp sync-done gitea
$DOCKER_COMPOSE_CMD logs -f
- name: App
before: |
cd web/
init: |
pnpm install
command: |
pnpm start
- name: Docs
before: |
cd docs/
init: |
pnpm install
pnpm build:woodpecker-plugins
command: |
pnpm start --port 4000
ports:
- port: 3000
onOpen: ignore
visibility: public # TODO: https://github.com/woodpecker-ci/woodpecker/issues/856
- port: 8000
onOpen: notify
visibility: public # TODO: https://github.com/woodpecker-ci/woodpecker/issues/856
- port: 9000
onOpen: ignore
- port: 8010
onOpen: ignore
- port: 4000
onOpen: notify
vscode:
extensions:
- "golang.go"
- "EditorConfig.EditorConfig"
- "dbaeumer.vscode-eslint"
- "esbenp.prettier-vscode"
- "voorjaar.windicss-intellisense"
- "johnsoncodehk.volar"
- "redhat.vscode-yaml"
- "davidanson.vscode-markdownlint"
- "streetsidesoftware.code-spell-checker"