diff options
-rw-r--r-- | .SRCINFO | 49 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | PKGBUILD | 136 | ||||
-rw-r--r-- | agent-systemd.service | 19 | ||||
-rw-r--r-- | agent-sysusers.conf | 1 | ||||
-rw-r--r-- | agent-tmpfiles.conf | 1 | ||||
-rw-r--r-- | agent.env | 59 | ||||
-rw-r--r-- | server-systemd.service | 19 | ||||
-rw-r--r-- | server-sysusers.conf | 1 | ||||
-rw-r--r-- | server-tmpfiles.conf | 1 | ||||
-rw-r--r-- | server.env | 144 |
11 files changed, 433 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..34dff5a464b0 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,49 @@ +pkgbase = woodpecker-git + pkgdesc = A simple CI engine with great extensibility (development version) + pkgver = 0.15.0.r406.ga3f4f3056 + pkgrel = 1 + url = https://woodpecker-ci.org + arch = x86_64 + license = Apache + makedepends = git + makedepends = go + makedepends = yarn + depends = glibc + options = !lto + source = woodpecker::git+https://github.com/woodpecker-ci/woodpecker + source = server-systemd.service + source = server-sysusers.conf + source = server-tmpfiles.conf + source = server.env + source = agent-systemd.service + source = agent-sysusers.conf + source = agent-tmpfiles.conf + source = agent.env + b2sums = SKIP + b2sums = 9435cd7af8128a91fc939206fedd767c719c94abd027150599d2079dbffd67f6886ef7ccb53449e09f8f3e86b0ad2bfa33b7002140c772421f5b6e936d008e6f + b2sums = 92d4b131ac328661bc35f59904bc94bd59df8e61d16dcf13d279641fb825d75949b3da469800573e03bea407a2eb2c5b1536f6c5ae4d33db218a20fb42068f5b + b2sums = d28d74767a4e36a34632308449a902abcb62c3f06260bab966825d937e04862c531f2c25273186a0ca3503274560770142154f7829fc850e980455f7c902734a + b2sums = c2f6c3764b8dffaabc1e5583df3d5b8f9a3b731aa190b940ca57cb9f47d1d7aee94c7ffbeefc3097bd6036d465bdc8289f3d107eda1d6e96d42b45a9579e5b95 + b2sums = 6f5833c1d4db8f287f5a9877687fb0d8d66c91e80e9bbb0a78910f315e6dd4cba01131dfca20bcceaeb828833187ee6161b33272050967e3e1cea4cb2665cf57 + b2sums = 373a5889c899445c4b583a48e6d0ff67d4572e30e0dfd0842b389e9338712771ec053ee3771202fe2874ee8bbfb7cb5965a04cf10d4071100c4f7c89cf2a14f3 + b2sums = b6479a7f3b3cf1ecaf0fc4e0653de10176af29b780ff716bf038077d70b0440e45a649ccd5ad9a12d5f52c9eecf9b5d8b5a01510a53eec7b664162c8bb9153ab + b2sums = 9d64fa22d5fcfb8634926220aeb89b0fa914d8e04ee39fe14abf3f170292ab2dc875fe3fe14b054ca8173c167cec4d93518d15d5f08698bd70d86dec7728dee8 + +pkgname = woodpecker-server-git + pkgdesc = A simple CI engine with great extensibility (server) (development version) + provides = woodpecker-server + conflicts = woodpecker-server + backup = etc/woodpecker/server.env + +pkgname = woodpecker-agent-git + pkgdesc = A simple CI engine with great extensibility (agent) (development version) + optdepends = docker: Docker backend + optdepends = podman: Podman backend + provides = woodpecker-agent + conflicts = woodpecker-agent + backup = etc/woodpecker/agent.env + +pkgname = woodpecker-cli-git + pkgdesc = A simple CI engine with great extensibility (cli) (development version) + provides = woodpecker-cli + conflicts = woodpecker-cli diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..83fd8e037e8b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +src/ +pkg/ +woodpecker/ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..0764c133d9cd --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,136 @@ +# Maintainer: Jef Roosens +# Contributor: George Rawlinson <grawlinson@archlinux.org> +# Contributor: Ersei <samb at disroot dot org> +# Contributor: Anthony Wang <ta180m@pm.me> + +# This PKGBUILD is very heavily taken from the official Woodpecker package and +# I take no credit for it. I've solely modified it to work with the master +# branch. + +_pkgbase=woodpecker +pkgbase=woodpecker-git +pkgname=( + 'woodpecker-server-git' + 'woodpecker-agent-git' + 'woodpecker-cli-git' +) +pkgver=0.15.0.r406.ga3f4f3056 +pkgrel=1 +_pkgdesc='A simple CI engine with great extensibility' +pkgdesc="${_pkgdesc} (development version)" +arch=('x86_64') +url='https://woodpecker-ci.org' +license=('Apache') +depends=('glibc') +makedepends=('git' 'go' 'yarn') +options=('!lto') +source=( + "${_pkgbase}::git+https://github.com/woodpecker-ci/woodpecker" + 'server-systemd.service' + 'server-sysusers.conf' + 'server-tmpfiles.conf' + 'server.env' + 'agent-systemd.service' + 'agent-sysusers.conf' + 'agent-tmpfiles.conf' + 'agent.env' +) +b2sums=('SKIP' + '9435cd7af8128a91fc939206fedd767c719c94abd027150599d2079dbffd67f6886ef7ccb53449e09f8f3e86b0ad2bfa33b7002140c772421f5b6e936d008e6f' + '92d4b131ac328661bc35f59904bc94bd59df8e61d16dcf13d279641fb825d75949b3da469800573e03bea407a2eb2c5b1536f6c5ae4d33db218a20fb42068f5b' + 'd28d74767a4e36a34632308449a902abcb62c3f06260bab966825d937e04862c531f2c25273186a0ca3503274560770142154f7829fc850e980455f7c902734a' + 'c2f6c3764b8dffaabc1e5583df3d5b8f9a3b731aa190b940ca57cb9f47d1d7aee94c7ffbeefc3097bd6036d465bdc8289f3d107eda1d6e96d42b45a9579e5b95' + '6f5833c1d4db8f287f5a9877687fb0d8d66c91e80e9bbb0a78910f315e6dd4cba01131dfca20bcceaeb828833187ee6161b33272050967e3e1cea4cb2665cf57' + '373a5889c899445c4b583a48e6d0ff67d4572e30e0dfd0842b389e9338712771ec053ee3771202fe2874ee8bbfb7cb5965a04cf10d4071100c4f7c89cf2a14f3' + 'b6479a7f3b3cf1ecaf0fc4e0653de10176af29b780ff716bf038077d70b0440e45a649ccd5ad9a12d5f52c9eecf9b5d8b5a01510a53eec7b664162c8bb9153ab' + '9d64fa22d5fcfb8634926220aeb89b0fa914d8e04ee39fe14abf3f170292ab2dc875fe3fe14b054ca8173c167cec4d93518d15d5f08698bd70d86dec7728dee8') + +pkgver() { + git -C "${_pkgbase}" describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' +} + +prepare() { + cd "${_pkgbase}" + + # create directory for build output + mkdir build + + # download dependencies + go mod download +} + +build() { + cd "${_pkgbase}" + + # generate web interface to embed in woodpecker-server + pushd web + yarn install --frozen-lockfile + yarn build + popd + + # set Go flags + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + + # build server/agent/cli + go build -v \ + -trimpath \ + -buildmode=pie \ + -mod=readonly \ + -modcacherw \ + -ldflags "-linkmode external -extldflags ${LDFLAGS}" \ + -o build \ + ./cmd/... +} + +package_woodpecker-server-git() { + pkgdesc="${_pkgdesc} (server) (development version)" + provides=("${pkgname%-git}") + conflicts=("${pkgname%-git}") + backup=('etc/woodpecker/server.env') + + # systemd integration + install -vDm644 server-systemd.service "${pkgdir}/usr/lib/systemd/system/${pkgname%-git}.service" + install -vDm644 server-sysusers.conf "${pkgdir}/usr/lib/sysusers.d/${pkgname%-git}.conf" + install -vDm644 server-tmpfiles.conf "${pkdir}/usr/lib/tmpfiles.d/${pkgname%-git}.conf" + install -vDm644 server.env -t "${pkgdir}/etc/woodpecker" + + cd "${_pkgbase}" + + # binary + install -vDm755 build/server "${pkgdir}/usr/bin/${pkgname%-git}" +} + +package_woodpecker-agent-git() { + pkgdesc="${_pkgdesc} (agent) (development version)" + optdepends=( + 'docker: Docker backend' + 'podman: Podman backend' + ) + provides=("${pkgname%-git}") + conflicts=("${pkgname%-git}") + backup=('etc/woodpecker/agent.env') + + # systemd integration + install -vDm644 agent-systemd.service "${pkgdir}/usr/lib/systemd/system/${pkgname%-git}.service" + install -vDm644 agent-sysusers.conf "${pkgdir}/usr/lib/sysusers.d/${pkgname%-git}.conf" + install -vDm644 agent-tmpfiles.conf "${pkgdir}/usr/lib/tmpfiles.d/${pkgname%-git}.conf" + install -vDm644 agent.env -t "${pkgdir}/etc/woodpecker" + + cd "${_pkgbase}" + + # binary + install -vDm755 build/agent "${pkgdir}/usr/bin/${pkgname%-git}" +} + +package_woodpecker-cli-git() { + pkgdesc="${_pkgdesc} (cli) (development version)" + provides=("${pkgname%-git}") + conflicts=("${pkgname%-git}") + + cd "${_pkgbase}" + + # binary + install -vDm755 build/cli "${pkgdir}/usr/bin/${pkgname}" +} diff --git a/agent-systemd.service b/agent-systemd.service new file mode 100644 index 000000000000..116fc906f4d7 --- /dev/null +++ b/agent-systemd.service @@ -0,0 +1,19 @@ +[Unit] +Description=Woodpecker agent +Documentation=https://woodpecker-ci.org/docs/intro +Requires=network-online.target +After=network-online.target + +[Service] +User=woodpecker-agent +Group=woodpecker-agent +EnvironmentFile=/etc/woodpecker/agent.env +ExecStart=/usr/bin/woodpecker-agent +RestartSec=5 +Restart=on-failure +SyslogIdentifier=woodpecker-agent +WorkingDirectory=/var/lib/woodpecker-agent +ReadWritePaths=/var/lib/woodpecker-agent + +[Install] +WantedBy=multi-user.target diff --git a/agent-sysusers.conf b/agent-sysusers.conf new file mode 100644 index 000000000000..fe12d44f685c --- /dev/null +++ b/agent-sysusers.conf @@ -0,0 +1 @@ +u woodpecker-agent - "Woodpecker agent daemon user" /var/lib/woodpecker-agent diff --git a/agent-tmpfiles.conf b/agent-tmpfiles.conf new file mode 100644 index 000000000000..9269d5224407 --- /dev/null +++ b/agent-tmpfiles.conf @@ -0,0 +1 @@ +d /var/lib/woodpecker-agent 0750 woodpecker-agent woodpecker-agent diff --git a/agent.env b/agent.env new file mode 100644 index 000000000000..1226ac54fbfd --- /dev/null +++ b/agent.env @@ -0,0 +1,59 @@ +# Configures gRPC address of the server. +# Default: localhost:9000 +#WOODPECKER_SERVER= + +# The gRPC username. +# Default: x-oauth-basic +#WOODPECKER_USERNAME= + +# A shared secret used by server and agents to authenticate communication. A secret can be generated by openssl rand -hex 32. +# Default: empty +#WOODPECKER_AGENT_SECRET= + +# Configures the logging level. Possible values are trace, debug, info, warn, error, fatal, panic, disabled and empty. +# Default: empty +#WOODPECKER_LOG_LEVEL= + +# Enable pretty-printed debug output. +# Default: false +#WOODPECKER_DEBUG_PRETTY= + +# Disable colored debug output. +# Default: true +#WOODPECKER_DEBUG_NOCOLOR= + +# Configures the agent hostname. +# Default: empty +#WOODPECKER_HOSTNAME= + +# Configures the number of parallel builds. +# Default: 1 +#WOODPECKER_MAX_PROCS= + +# Enable healthcheck endpoint. +# Default: true +#WOODPECKER_HEALTHCHECK= + +# After a duration of this time of no activity, the agent pings the server to check if the transport is still alive. +# Default: empty +#WOODPECKER_KEEPALIVE_TIME= + +# After pinging for a keepalive check, the agent waits for a duration of this time before closing the connection if no activity. +# Default: 20s +#WOODPECKER_KEEPALIVE_TIMEOUT= + +# Configures if the connection to WOODPECKER_SERVER should be made using a secure transport. +# Default: false +#WOODPECKER_GRPC_SECURE= + +# Configures if the gRPC server certificate should be verified, only valid when WOODPECKER_GRPC_SECURE is true. +# Default: true +#WOODPECKER_GRPC_VERIFY= + +# Configures the backend engine to run pipelines on. Possible values are auto-detect or docker. +# Default: auto-detect +#WOODPECKER_BACKEND= + +# Path to Docker or Podman socket. Can be an SSH address. +# Default: unix:///var/run/docker.sock +#DOCKER_HOST= diff --git a/server-systemd.service b/server-systemd.service new file mode 100644 index 000000000000..526fb752cb37 --- /dev/null +++ b/server-systemd.service @@ -0,0 +1,19 @@ +[Unit] +Description=Woodpecker server +Documentation=https://woodpecker-ci.org/docs/intro +Requires=network-online.target +After=network-online.target + +[Service] +User=woodpecker-server +Group=woodpecker-server +EnvironmentFile=/etc/woodpecker/server.env +ExecStart=/usr/bin/woodpecker-server +RestartSec=5 +Restart=on-failure +SyslogIdentifier=woodpecker-server +WorkingDirectory=/var/lib/woodpecker-server +ReadWritePaths=/var/lib/woodpecker-server + +[Install] +WantedBy=multi-user.target diff --git a/server-sysusers.conf b/server-sysusers.conf new file mode 100644 index 000000000000..df1ae4d5c894 --- /dev/null +++ b/server-sysusers.conf @@ -0,0 +1 @@ +u woodpecker-server - "Woodpecker server daemon user" /var/lib/woodpecker-server diff --git a/server-tmpfiles.conf b/server-tmpfiles.conf new file mode 100644 index 000000000000..5ab1e0f154cf --- /dev/null +++ b/server-tmpfiles.conf @@ -0,0 +1 @@ +d /var/lib/woodpecker-server 0750 woodpecker-server woodpecker-server diff --git a/server.env b/server.env new file mode 100644 index 000000000000..657879877a59 --- /dev/null +++ b/server.env @@ -0,0 +1,144 @@ +# Note that this is not all of the possible configuration options, just the most likely to be used ones. +# View all of the administration documentation here: https://woodpecker-ci.org/docs/administration/server-config +# For integrating with Gitea/Github/Gitlab, look at https://woodpecker-ci.org/docs/administration/vcs/overview + +# Configures the logging level. Possible values are trace, debug, info, warn, error, fatal, panic, disabled and empty. +# Default: empty +#WOODPECKER_LOG_LEVEL= + +# Enable pretty-printed debug output. +# Default: false +#WOODPECKER_DEBUG_PRETTY= + +# Disable colored debug output. +# Default: true +#WOODPECKER_DEBUG_NOCOLOR= + +# Server fully qualified url of the user-facing hostname. +# Default: empty +# Example: WOODPECKER_HOST=http://woodpecker.example.org +#WOODPECKER_HOST= + +# Configures the HTTP listener port. +# Default: :8000 +#WOODPECKER_SERVER_ADDR= + +# Path to an SSL certificate used by the server to accept HTTPS requests. +# Default: empty +# Example: WOODPECKER_SERVER_CERT=/path/to/cert.pem +#WOODPECKER_SERVER_CERT= + +# Path to an SSL certificate key used by the server to accept HTTPS requests. +# Default: empty +# Example: WOODPECKER_SERVER_KEY=/path/to/key.pem +#WOODPECKER_SERVER_KEY= + +# Automatically generates an SSL certificate using Let's Encrypt, and configures the server to accept HTTPS requests. +# Default: false +#WOODPECKER_LETS_ENCRYPT= + +# Configures the gRPC listener port. +# Default: :9000 +#WOODPECKER_GRPC_ADDR= + +# Comma-separated list of admin accounts. +# Default: empty +# Example: WOODPECKER_ADMIN=user1,user2 +#WOODPECKER_ADMIN= + +# Comma-separated list of approved organizations. +# Default: empty +# Example: org1,org2 +#WOODPECKER_ORGS= + +# Comma-separated list of syncable repo owners. ??? +# Default: empty +# Example: user1,user2 +#WOODPECKER_REPO_OWNERS= + +# Enable to allow user registration. +# Default: false +#WOODPECKER_OPEN= + +# Link to documentation in the UI. +# Default: https://woodpecker-ci.org/ +#WOODPECKER_DOCS= + +# Always use authentication to clone repositories even if they are public. Needed if the SCM requires to always authenticate as used by many companies. +# Default: false +#WOODPECKER_AUTHENTICATE_PUBLIC_REPOS= + +# The default docker image to be used when cloning the repo +# Default: woodpeckerci/plugin-git:latest +#WOODPECKER_DEFAULT_CLONE_IMAGE= + +# Configures the session expiration time. +# Default: 72h +#WOODPECKER_SESSION_EXPIRES= + +# Docker images to run in privileged mode. Only change if you are sure what you do! +# Default: plugins/docker,plugins/gcr,plugins/ecr,woodpeckerci/plugin-docker,woodpeckerci/plugin-docker-buildx +#WOODPECKER_ESCALATE= + +# Configures a specific private registry config for all pipelines. +# Default: empty +# Example: WOODPECKER_DOCKER_CONFIG=/home/user/.docker/config.json +#WOODPECKER_DOCKER_CONFIG= + +# A shared secret used by server and agents to authenticate communication. A secret can be generated by openssl rand -hex 32. +# Default: empty +#WOODPECKER_AGENT_SECRET= + +# Server-side enforcement policy on the minimum amount of time a client should wait before sending a keepalive ping. +# Default: empty +# Example: WOODPECKER_KEEPALIVE_MIN_TIME=10s +#WOODPECKER_KEEPALIVE_MIN_TIME= + +# Database configuration documentation can be found here: https://woodpecker-ci.org/docs/administration/database +# The database driver name. Possible values are sqlite3, mysql or postgres. +# Default: sqlite3 +#WOODPECKER_DATABASE_DRIVER= + +# The database connection string. The default value is the path of the embedded sqlite database file. +# Default: woodpecker.sqlite +# MySQL Example: +# https://github.com/go-sql-driver/mysql#dsn-data-source-name +# WOODPECKER_DATABASE_DATASOURCE=root:password@tcp(1.2.3.4:3306)/woodpecker?parseTime=true +# +# PostgreSQL Example: +# https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING +# WOODPECKER_DATABASE_DATASOURCE=postgres://root:password@1.2.3.4:5432/woodpecker?sslmode=disable +#WOODPECKER_DATABASE_DATASOURCE= + +# Token to secure the Prometheus metrics endpoint. +# Default: empty +#WOODPECKER_PROMETHEUS_AUTH_TOKEN= + +# Context prefix Woodpecker will use to publish status messages to SCM. You probably will only need to change it if you run multiple Woodpecker instances for a single repository. +# Default: ci/woodpecker +#WOODPECKER_STATUS_CONTEXT= + +# The maximum amount of memory a single pipeline container is allowed to swap to disk, configured in bytes. There is no limit if 0. +# Default: 0 +#WOODPECKER_LIMIT_MEM_SWAP= + +# The maximum amount of memory a single pipeline container can use, configured in bytes. There is no limit if 0. +# Default: 0 +#WOODPECKER_LIMIT_MEM= + +# The maximum amount of memory of /dev/shm allowed in bytes. There is no limit if 0. +# Default: 0 +#WOODPECKER_LIMIT_SHM_SIZE= + +# The number of microseconds per CPU period that the container is limited to before throttled. There is no limit if 0. +# Default: 0 +#WOODPECKER_LIMIT_CPU_QUOTA= + +# The relative weight vs. other containers. +# Default: 0 +#WOODPECKER_LIMIT_CPU_SHARES= + +# Comma-separated list to limit the specific CPUs or cores a pipeline container can use. +# Default: empty +# Example: WOODPECKER_LIMIT_CPU_SET=1,2 +#WOODPECKER_LIMIT_CPU_SET= |