forked from vieter-v/vieter
Compare commits
No commits in common. "2abbc1111870d3735ac3c3a94cc25560926c855e" and "06df2c21f08211af27bdeac11aec1a6cd689c94a" have entirely different histories.
2abbc11118
...
06df2c21f0
|
|
@ -26,4 +26,3 @@ gdb.txt
|
||||||
|
|
||||||
# Generated docs
|
# Generated docs
|
||||||
_docs/
|
_docs/
|
||||||
/man/
|
|
||||||
|
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
platform: 'linux/amd64'
|
|
||||||
branches:
|
|
||||||
exclude: [ main ]
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- build
|
|
||||||
|
|
||||||
skip_clone: true
|
|
||||||
|
|
||||||
pipeline:
|
|
||||||
generate:
|
|
||||||
image: 'chewingbever/vlang:latest'
|
|
||||||
pull: true
|
|
||||||
commands:
|
|
||||||
- curl -o vieter -L "https://s3.rustybever.be/vieter/commits/$CI_COMMIT_SHA/vieter-linux-amd64"
|
|
||||||
- chmod +x vieter
|
|
||||||
- ./vieter man man
|
|
||||||
- cd man
|
|
||||||
|
|
||||||
# Generate an HTML page from each man page
|
|
||||||
- for f in $(ls -1 *.1); do mandoc -Thtml -O style=mandoc.css,man=%N.%S.html $f > "$f.html"; done
|
|
||||||
|
|
||||||
# Download the mandoc.css file from the official site
|
|
||||||
- curl -o mandoc.css -L https://mandoc.bsd.lv/mandoc.css
|
|
||||||
|
|
||||||
- tar czvf ../man.tar.gz *.html mandoc.css
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
image: 'curlimages/curl'
|
|
||||||
secrets:
|
|
||||||
- 'site_api_key'
|
|
||||||
commands:
|
|
||||||
- 'curl -XPOST --fail -s -H "Authorization: Bearer $SITE_API_KEY" -T man.tar.gz https://rustybever.be/api/deploy?dir=man-vieter'
|
|
||||||
when:
|
|
||||||
event: push
|
|
||||||
branch: dev
|
|
||||||
|
|
@ -15,9 +15,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
* GitRepo: filter by repo
|
* GitRepo: filter by repo
|
||||||
* BuildLog: filter by start & end date, repo, exit code & arch
|
* BuildLog: filter by start & end date, repo, exit code & arch
|
||||||
* CLI flags to take advantage of above API improvements
|
* CLI flags to take advantage of above API improvements
|
||||||
* Added CLI command to generate all man pages
|
|
||||||
* PKGBUILDs now install man pages
|
|
||||||
* CLI man pages are now hosted on https://rustybever.be
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|
|
||||||
5
Makefile
5
Makefile
|
|
@ -60,11 +60,6 @@ api-docs:
|
||||||
rm -rf '$(SRC_DIR)/_docs'
|
rm -rf '$(SRC_DIR)/_docs'
|
||||||
cd '$(SRC_DIR)' && v doc -all -f html -m -readme .
|
cd '$(SRC_DIR)' && v doc -all -f html -m -readme .
|
||||||
|
|
||||||
.PHONY: man
|
|
||||||
man: vieter
|
|
||||||
rm -rf man
|
|
||||||
./vieter man man
|
|
||||||
|
|
||||||
|
|
||||||
# =====OTHER=====
|
# =====OTHER=====
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
|
|
|
||||||
11
PKGBUILD
11
PKGBUILD
|
|
@ -5,7 +5,6 @@ pkgbase='vieter'
|
||||||
pkgname='vieter'
|
pkgname='vieter'
|
||||||
pkgver='0.3.0_alpha.2'
|
pkgver='0.3.0_alpha.2'
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Vieter is a lightweight implementation of an Arch repository server."
|
|
||||||
depends=('glibc' 'openssl' 'libarchive' 'sqlite')
|
depends=('glibc' 'openssl' 'libarchive' 'sqlite')
|
||||||
makedepends=('git' 'vieter-v')
|
makedepends=('git' 'vieter-v')
|
||||||
arch=('x86_64' 'aarch64')
|
arch=('x86_64' 'aarch64')
|
||||||
|
|
@ -18,17 +17,11 @@ build() {
|
||||||
cd "$pkgname"
|
cd "$pkgname"
|
||||||
|
|
||||||
make prod
|
make prod
|
||||||
|
|
||||||
# The default CFLAGS for some reason causes vieter to segfault if used
|
|
||||||
# inside the PKGBUILD. As a workaround, we use tcc to build a debug build
|
|
||||||
# that does work, so we can generate the manpages.
|
|
||||||
CFLAGS= LDFLAGS= make man
|
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
|
pkgdesc="Vieter is a lightweight implementation of an Arch repository server."
|
||||||
|
|
||||||
install -dm755 "$pkgdir/usr/bin"
|
install -dm755 "$pkgdir/usr/bin"
|
||||||
install -Dm755 "$pkgname/pvieter" "$pkgdir/usr/bin/vieter"
|
install -Dm755 "$pkgname/pvieter" "$pkgdir/usr/bin/vieter"
|
||||||
|
|
||||||
install -dm755 "$pkgdir/usr/share/man/man1"
|
|
||||||
install -Dm644 "$pkgname/man"/*.1 "$pkgdir/usr/share/man/man1"
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
11
PKGBUILD.dev
11
PKGBUILD.dev
|
|
@ -5,7 +5,6 @@ pkgbase='vieter-git'
|
||||||
pkgname='vieter-git'
|
pkgname='vieter-git'
|
||||||
pkgver=0.2.0.r25.g20112b8
|
pkgver=0.2.0.r25.g20112b8
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Vieter is a lightweight implementation of an Arch repository server."
|
|
||||||
depends=('glibc' 'openssl' 'libarchive' 'sqlite')
|
depends=('glibc' 'openssl' 'libarchive' 'sqlite')
|
||||||
makedepends=('git' 'vieter-v')
|
makedepends=('git' 'vieter-v')
|
||||||
arch=('x86_64' 'aarch64')
|
arch=('x86_64' 'aarch64')
|
||||||
|
|
@ -26,17 +25,11 @@ build() {
|
||||||
cd "$pkgname"
|
cd "$pkgname"
|
||||||
|
|
||||||
make prod
|
make prod
|
||||||
|
|
||||||
# The default CFLAGS for some reason causes vieter to segfault if used
|
|
||||||
# inside the PKGBUILD. As a workaround, we use tcc to build a debug build
|
|
||||||
# that does work, so we can generate the manpages.
|
|
||||||
CFLAGS= LDFLAGS= make man
|
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
|
pkgdesc="Vieter is a lightweight implementation of an Arch repository server."
|
||||||
|
|
||||||
install -dm755 "$pkgdir/usr/bin"
|
install -dm755 "$pkgdir/usr/bin"
|
||||||
install -Dm755 "$pkgname/pvieter" "$pkgdir/usr/bin/vieter"
|
install -Dm755 "$pkgname/pvieter" "$pkgdir/usr/bin/vieter"
|
||||||
|
|
||||||
install -dm755 "$pkgdir/usr/share/man/man1"
|
|
||||||
install -Dm644 "$pkgname/man"/*.1 "$pkgdir/usr/share/man/man1"
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ module console
|
||||||
|
|
||||||
import arrays
|
import arrays
|
||||||
import strings
|
import strings
|
||||||
import cli
|
|
||||||
import os
|
|
||||||
|
|
||||||
// pretty_table converts a list of string data into a pretty table. Many thanks
|
// pretty_table converts a list of string data into a pretty table. Many thanks
|
||||||
// to @hungrybluedev in the Vlang Discord for providing this code!
|
// to @hungrybluedev in the Vlang Discord for providing this code!
|
||||||
|
|
@ -56,15 +54,3 @@ pub fn pretty_table(header []string, data [][]string) ?string {
|
||||||
|
|
||||||
return buffer.str()
|
return buffer.str()
|
||||||
}
|
}
|
||||||
|
|
||||||
// export_man_pages recursively generates all man pages for the given
|
|
||||||
// cli.Command & writes them to the given directory.
|
|
||||||
pub fn export_man_pages(cmd cli.Command, path string) ? {
|
|
||||||
man := cmd.manpage()
|
|
||||||
os.write_file(os.join_path_single(path, cmd.full_name().replace(' ', '-') + '.1'),
|
|
||||||
man)?
|
|
||||||
|
|
||||||
for sub_cmd in cmd.commands {
|
|
||||||
export_man_pages(sub_cmd, path)?
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
module man
|
|
||||||
|
|
||||||
import cli
|
|
||||||
import console
|
|
||||||
import os
|
|
||||||
|
|
||||||
// cmd returns the cli submodule that handles generating man pages.
|
|
||||||
pub fn cmd() cli.Command {
|
|
||||||
return cli.Command{
|
|
||||||
name: 'man'
|
|
||||||
description: 'Generate all man pages & save them in the given directory.'
|
|
||||||
usage: 'dir'
|
|
||||||
required_args: 1
|
|
||||||
execute: fn (cmd cli.Command) ? {
|
|
||||||
root := cmd.root()
|
|
||||||
os.mkdir_all(cmd.args[0])?
|
|
||||||
|
|
||||||
console.export_man_pages(root, cmd.args[0])?
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -6,7 +6,6 @@ import cli
|
||||||
import console.git
|
import console.git
|
||||||
import console.logs
|
import console.logs
|
||||||
import console.schedule
|
import console.schedule
|
||||||
import console.man
|
|
||||||
import cron
|
import cron
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
@ -30,7 +29,6 @@ fn main() {
|
||||||
cron.cmd(),
|
cron.cmd(),
|
||||||
logs.cmd(),
|
logs.cmd(),
|
||||||
schedule.cmd(),
|
schedule.cmd(),
|
||||||
man.cmd(),
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
app.setup()
|
app.setup()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue