Merge branch 'development' of https://github.com/freeflowuniverse/herolib into development

This commit is contained in:
2025-01-14 23:12:56 +01:00
6 changed files with 46 additions and 18 deletions

View File

@@ -34,10 +34,44 @@ jobs:
uses: actions/checkout@v3
- name: Setup Vlang
run: ./install_v.sh
run: |
git clone --depth=1 https://github.com/vlang/v
cd v
make
sudo ./v symlink
cd ..
- name: Setup Herolib
run: ./install_herolib.vsh
run: |
mkdir -p ~/.vmodules/freeflowuniverse
ln -s $GITHUB_WORKSPACE/lib ~/.vmodules/freeflowuniverse/herolib
echo "Installing secp256k1..."
if [ "${{ matrix.os }}" = "macos-latest" ]; then
brew install secp256k1
elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
# Install build dependencies
sudo apt-get install -y build-essential wget autoconf libtool
# Download and extract secp256k1
cd /tmp
wget https://github.com/bitcoin-core/secp256k1/archive/refs/tags/v0.3.2.tar.gz
tar -xvf v0.3.2.tar.gz
# Build and install
cd secp256k1-0.3.2/
./autogen.sh
./configure
make -j 5
sudo make install
# Cleanup
rm -rf secp256k1-0.3.2 v0.3.2.tar.gz
else
echo "secp256k1 installation not implemented for ${OSNAME}"
exit 1
fi
echo "secp256k1 installation complete!"
- name: Install and Start Redis
run: |
@@ -64,7 +98,9 @@ jobs:
fi
- name: Do all the basic tests
run: ./test_basic.vsh
run: |
alias vtest='v -stats -enable-globals -n -w -cg -gc none -no-retry-compilation -cc tcc test'
./test_basic.vsh
# - name: Upload to S3
# run: |

3
.gitignore vendored
View File

@@ -27,4 +27,5 @@ output/
.stellar
vdocs/
data.ms/
test_basic
test_basic
cli/hero

View File

@@ -1,7 +1,7 @@
module main
import os
import cli { Command, Flag }
import cli { Command }
import freeflowuniverse.herolib.core.herocmds
// import freeflowuniverse.herolib.hero.cmds
// import freeflowuniverse.herolib.hero.publishing
@@ -34,14 +34,6 @@ fn do() ! {
version: '2.0.0'
}
cmd.add_flag(Flag{
flag: .string
name: 'url'
abbrev: 'u'
global: true
description: 'url of playbook'
})
// herocmds.cmd_run_add_flags(mut cmd)
mut toinstall := false
@@ -83,7 +75,7 @@ fn do() ! {
// herocmds.cmd_installers(mut cmd)
// herocmds.cmd_configure(mut cmd)
// herocmds.cmd_postgres(mut cmd)
// herocmds.cmd_mdbook(mut cmd)
herocmds.cmd_mdbook(mut cmd)
// herocmds.cmd_luadns(mut cmd)
// herocmds.cmd_caddy(mut cmd)
// herocmds.cmd_zola(mut cmd)

View File

@@ -88,7 +88,7 @@ fn cmd_mdbook_execute(cmd Command) ! {
mut plbook, _ := plbook_run(cmd)!
// get name from the book.generate action
if name == '' {
mut a := plbook.action_get(actor: 'mdbook', name: 'define')!
mut a := plbook.action_get(actor: 'book', name: 'define')!
name = a.params.get('name') or { '' }
}
} else {

View File

@@ -22,6 +22,7 @@ pub fn run(mut plbook playbook.PlayBook, dagu bool) ! {
play_core(mut plbook)!
play_ssh(mut plbook)!
play_git(mut plbook)!
play_publisher(mut plbook)!
// play_zola(mut plbook)!
// play_caddy(mut plbook)!
// play_juggler(mut plbook)!
@@ -36,8 +37,6 @@ pub fn run(mut plbook playbook.PlayBook, dagu bool) ! {
// base_install(play(mut plbook)!
// coredns.play(mut plbook)!
// publishing.play(mut plbook)!
// plbook.empty_check()!
console.print_header('Actions concluded succesfully.')

View File

@@ -78,7 +78,7 @@ pub fn (zdb ZDBDeployed) ping() bool {
panic('implement')
}
pub fn (zdb ZDBDeployed) redisclient() !redisclient.Redis {
pub fn (zdb ZDBDeployed) redisclient() !&redisclient.Redis {
redis_addr := '${zdb.mycelium_ip}:6379'
return redisclient.new(redis_addr)!
}