Files
lazyjournal/Supfile.yml
2025-09-26 09:21:46 +03:00

131 lines
3.2 KiB
YAML

env:
GIT_URL: https://github.com/Lifailon/lazyjournal
networks:
dev:
hosts:
- lifailon@192.168.3.101:2121
bsd:
hosts:
- root@192.168.3.102:22
- root@192.168.3.103:22
rpi:
hosts:
- lifailon@192.168.3.105:2121
- lifailon@192.168.3.106:2121
commands:
install:
desc: Install Go
run: |
if command -v go > /dev/null 2>&1; then
go version
else
if [ "$(uname -s)" = "FreeBSD" ]; then
pkg update
pkg install -y go
elif [ "$(uname -s)" = "OpenBSD" ]; then
pkg_add -u
yes | pkg_add go
fi
fi
creat:
desc: Creat directory for upload files
run: |
rm -rf docker/lazyjournal
mkdir -p docker/lazyjournal
copy:
desc: Upload all files to remote hosts
upload:
- src: \*
dst: docker/lazyjournal
ls:
desc: Check directory
run: ls -lh docker/lazyjournal
prep:
desc: Install dependencies and code preparation
run: |
cd docker/lazyjournal
go fmt ./...
go vet ./...
go get ./...
go mod tidy
go mod verify
go build -o /dev/null -v ./...
test:
desc: Run unit tests
run: |
cd docker/lazyjournal
go test -v -cover --run "TestUnixFiles|TestColor|TestFilter|TestFlags|TestCommandColor|TestCommandFuzzyFilter|TestCommandRegexFilter|TestMainInterface|TestMockInterface"
docker:
desc: Run docker containers test
run: |
cd docker/lazyjournal
go test -v -cover --run "TestDockerContainer"
remove:
desc: Remove files on remote hosts
run: |
rm -rf docker/lazyjournal
ls -l docker/lazyjournal 2> /dev/null || echo "lazyjournal removed"
bin:
desc: Install binary from GitHub
run: curl -sS https://raw.githubusercontent.com/Lifailon/lazyjournal/main/install.sh | bash
flags:
desc: Check flags from release
run: |
if [ "$(uname -s)" = "FreeBSD" ]; then
. ~/.shrc
elif [ "$(uname -s)" = "OpenBSD" ]; then
. ~/.kshrc
fi
lazyjournal -v
mkdir -p /opt
echo test > /opt/test.log
lazyjournal -a
rm /opt/test.log
lazyjournal -g
curl -s https://raw.githubusercontent.com/Lifailon/lazyjournal/refs/heads/main/color.log | lazyjournal -c
curl -s https://raw.githubusercontent.com/Lifailon/lazyjournal/refs/heads/main/color.log | lazyjournal -f "success"
curl -s https://raw.githubusercontent.com/Lifailon/lazyjournal/refs/heads/main/color.log | lazyjournal -r "http|127"
tmux:
desc: Check run interface from release
run: |
if [ "$(uname -s)" = "FreeBSD" ]; then
. /root/.shrc
elif [ "$(uname -s)" = "OpenBSD" ]; then
. /root/.kshrc
fi
tmux new-session -d -s test-session lazyjournal
sleep 1
tmux capture-pane -p
tmux send-keys -t test-session "$(echo -e 'syslog\t\r')"
sleep 2
tmux capture-pane -p
tmux send-keys -t test-session "$(echo -e '\t\t\trsyslogd')"
sleep 2
tmux capture-pane -p
tmux kill-session -t test-session
targets:
testing:
- install
- creat
- copy
- ls
- prep
- test
- remove
release:
- bin
- flags
- tmux