Skip to content

Commit

Permalink
Merge branch 'master' into address-1003
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 authored Aug 25, 2022
2 parents 7e8ba74 + f21d854 commit faf4153
Show file tree
Hide file tree
Showing 156 changed files with 8,651 additions and 5,754 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ body:
and copy paste the text instead.
Tip: You can attach images by clicking this area to highlight it and then dragging files in.
render: shell
validations:
required: false
- type: checkboxes
Expand Down
79 changes: 79 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
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
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
command: 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
init: |
gp sync-await woodpecker-server
command: 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
gp sync-done gitea
$DOCKER_COMPOSE_CMD logs -f
- name: App
init: |
cd web/
yarn install
command: yarn start
- name: Docs
init: |
cd docs/
yarn install
yarn build:woodpecker-plugins
command: yarn 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"
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"voorjaar.windicss-intellisense",
"johnsoncodehk.volar",
"Vue.volar",
"redhat.vscode-yaml",
"davidanson.vscode-markdownlint"
],
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@
"go.lintTool":"golangci-lint",
"go.lintFlags": [
"--fast"
]
],
"eslint.workingDirectories": [
"./web"
],
"prettier.configPath": "./web/.prettierrc.js",
"prettier.ignorePath": "./web/.prettierignore"
}
121 changes: 31 additions & 90 deletions .woodpecker/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,153 +2,94 @@ depends_on:
- test
- web

variables:
- &golang_image 'golang:1.18'
- &node_image 'node:16-alpine'
- &when_path
# related config files
- ".woodpecker/binaries.yml"
- "nfpm/*.yml"
# go source code
- "**/*.go"
- "go.*"
# web source code
- "web/**"

pipeline:
build-web:
group: prepare
image: node:16-alpine
image: *node_image
commands:
- cd web/
- yarn install --frozen-lockfile
- yarn build
when:
path:
# related config files
- ".woodpecker/binaries.yml"
- "nfpm/*.yml"
# go source code
- "**/*.go"
- "go.*"
# web source code
- "web/**"
path: *when_path

vendor:
group: prepare
image: golang:1.18
image: *golang_image
commands:
- go mod vendor
when:
path:
# related config files
- ".woodpecker/binaries.yml"
- "nfpm/*.yml"
# go source code
- "**/*.go"
- "go.*"
# web source code
- "web/**"
path: *when_path

build-server:
group: build
image: golang:1.18
image: *golang_image
commands:
- make release-server
when:
path:
# related config files
- ".woodpecker/binaries.yml"
- "nfpm/*.yml"
# go source code
- "**/*.go"
- "go.*"
# web source code
- "web/**"
path: *when_path

build-agent:
group: build
image: golang:1.18
image: *golang_image
commands:
- make release-agent
when:
path:
# related config files
- ".woodpecker/binaries.yml"
- "nfpm/*.yml"
# go source code
- "**/*.go"
- "go.*"
# web source code
- "web/**"
path: *when_path

build-cli:
group: build
image: golang:1.18
image: *golang_image
commands:
- make release-cli
when:
path:
# related config files
- ".woodpecker/binaries.yml"
- "nfpm/*.yml"
# go source code
- "**/*.go"
- "go.*"
# web source code
- "web/**"
path: *when_path

build-deb-rpm:
group: bundle
image: golang:1.18
image: *golang_image
commands:
- make bundle
when:
path:
# related config files
- ".woodpecker/binaries.yml"
- "nfpm/*.yml"
# go source code
- "**/*.go"
- "go.*"
# web source code
- "web/**"
path: *when_path

build-tarball:
group: bundle
image: golang:1.18
image: *golang_image
commands:
- make release-tarball
when:
path:
# related config files
- ".woodpecker/binaries.yml"
- "nfpm/*.yml"
# go source code
- "**/*.go"
- "go.*"
# web source code
- "web/**"
path: *when_path

checksums:
image: golang:1.18
image: *golang_image
commands:
- make release-checksums
when:
path:
# related config files
- ".woodpecker/binaries.yml"
- "nfpm/*.yml"
# go source code
- "**/*.go"
- "go.*"
# web source code
- "web/**"
path: *when_path

# TODO: upload build artifacts for pushes to ${CI_REPO_DEFAULT_BRANCH}

release-dryrun:
image: golang:1.18
image: *golang_image
commands:
- ls -la dist/*.*
- cat dist/checksums.txt
when:
path:
# related config files
- ".woodpecker/binaries.yml"
- "nfpm/*.yml"
# go source code
- "**/*.go"
- "go.*"
# web source code
- "web/**"
path: *when_path

release:
image: plugins/github-release
Expand Down
Loading

0 comments on commit faf4153

Please sign in to comment.