2022-07-31 15:07:18 +00:00
|
|
|
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
|
2022-10-21 16:59:30 +00:00
|
|
|
make build-server
|
2022-10-07 22:13:19 +00:00
|
|
|
command: |
|
2022-07-31 15:07:18 +00:00
|
|
|
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
|
2022-10-07 22:13:19 +00:00
|
|
|
go run github.com/woodpecker-ci/woodpecker/cmd/server
|
2022-07-31 15:07:18 +00:00
|
|
|
- name: Agent
|
|
|
|
env:
|
|
|
|
WOODPECKER_SERVER: localhost:9000
|
|
|
|
WOODPECKER_SECRET: "1234"
|
|
|
|
WOODPECKER_MAX_PROCS: 1
|
|
|
|
WOODPECKER_HEALTHCHECK: false
|
2022-10-07 22:13:19 +00:00
|
|
|
command: |
|
2022-07-31 15:07:18 +00:00
|
|
|
gp sync-await woodpecker-server
|
2022-10-07 22:13:19 +00:00
|
|
|
go run github.com/woodpecker-ci/woodpecker/cmd/agent
|
2022-07-31 15:07:18 +00:00
|
|
|
- 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}" \
|
2022-10-26 14:54:42 +00:00
|
|
|
-d "{ \"name\": \"Woodpecker CI\", \"confidential_client\": true, \"redirect_uris\": [ \"https://8000-${GITPOD_WORKSPACE_ID}.${GITPOD_WORKSPACE_CLUSTER_HOST}/authorize\" ] }")
|
2022-07-31 15:07:18 +00:00
|
|
|
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
|
2022-10-09 20:13:04 +00:00
|
|
|
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
|
2022-07-31 15:07:18 +00:00
|
|
|
gp sync-done gitea
|
|
|
|
$DOCKER_COMPOSE_CMD logs -f
|
|
|
|
- name: App
|
2022-10-07 23:03:13 +00:00
|
|
|
before: |
|
2022-07-31 15:07:18 +00:00
|
|
|
cd web/
|
2022-10-07 23:03:13 +00:00
|
|
|
init: |
|
2022-10-08 14:15:07 +00:00
|
|
|
pnpm install
|
2022-10-07 23:03:13 +00:00
|
|
|
command: |
|
2022-10-08 14:15:07 +00:00
|
|
|
pnpm start
|
2022-07-31 15:07:18 +00:00
|
|
|
- name: Docs
|
2022-10-07 23:03:13 +00:00
|
|
|
before: |
|
2022-07-31 15:07:18 +00:00
|
|
|
cd docs/
|
2022-10-07 23:03:13 +00:00
|
|
|
init: |
|
2022-10-08 14:15:07 +00:00
|
|
|
pnpm install
|
|
|
|
pnpm build:woodpecker-plugins
|
2022-10-07 23:03:13 +00:00
|
|
|
command: |
|
2022-10-08 14:15:07 +00:00
|
|
|
pnpm start --port 4000
|
2022-07-31 15:07:18 +00:00
|
|
|
|
|
|
|
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"
|
2022-10-25 22:11:07 +00:00
|
|
|
- "Vue.volar"
|
2022-07-31 15:07:18 +00:00
|
|
|
- "redhat.vscode-yaml"
|
|
|
|
- "davidanson.vscode-markdownlint"
|
2022-10-15 18:25:55 +00:00
|
|
|
- "streetsidesoftware.code-spell-checker"
|