init commit
All checks were successful
ci/woodpecker/push/pipeline Pipeline was successful

This commit is contained in:
sorrel 2024-04-30 12:49:06 -04:00
commit b2ae852f0b
12 changed files with 1333 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/target

30
.woodpecker/deploy.sh Normal file
View file

@ -0,0 +1,30 @@
#!/bin/sh -e
host=root@oxaliq.net
# organize files
echo "ORGANIZING THE FILES"
mkdir ludo-go
mv target/release/ludo-go-server ludo-go/.
mv target/release/ludo-go-db ludo-go/.
mv target/release/play-go ludo-go/.
## move the database here
# copy files to deployment target
echo "COPYING FILES TO DEPLOYMENT TARGET"
scp -r ludo-go "$host":~/
echo "SETTING OWNERSHIP AND PERMISSIONS"
ssh $host 'chown -R oxaliqdotnet:oxaliqdotnet ludo-go/'
ssh $host 'chown -R 755 ludo-go/'
## todo ensure new deployment is working prior to removing previous
echo "REPLACING PREVIOUS DEPLOYMENT"
ssh $host 'rm -rf /srv/ludo-go || true'
ssh $host 'mv ludo-go /srv/.'
echo "RESTARTING SERVICE"
ssh $host 'systemctl restart ludogo.service'
echo "SUCCESS!"
exit 0

30
.woodpecker/pipeline.yaml Normal file
View file

@ -0,0 +1,30 @@
name: ludo-go-pipeline
when:
branch:
include: [ main ]
steps:
build:
image: rust:slim-bookworm
commands:
- cargo build --workspace -r
- cargo test --verbose
deploy:
image: alpine:latest
secrets:
- oxaliq_deploy_ssh
commands:
- echo "SETTING UP SSH"
- apk add openssh-client
- mkdir -p $HOME/.ssh
- ssh-keyscan -t ed25519 oxaliq.net >> $HOME/.ssh/known_hosts
- echo "$oxaliq_deploy_ssh" > $HOME/.ssh/id_ed25519
- chmod 0600 $HOME/.ssh/id_ed25519
- echo "SSH SETUP DONE"
- echo "RUNNING DEPLOY SCRIPT"
- ./.woodpecker/deploy.sh
when:
# Only try to deploy if previous step is successful
status: success

1230
Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

3
Cargo.toml Normal file
View file

@ -0,0 +1,3 @@
[workspace]
members = ["ludo-go-server", "go-game", "ludo-go-db"]
resolver = "2"

8
go-game/Cargo.toml Normal file
View file

@ -0,0 +1,8 @@
[package]
name = "go-game"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

3
go-game/src/main.rs Normal file
View file

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

9
ludo-go-db/Cargo.toml Normal file
View file

@ -0,0 +1,9 @@
[package]
name = "ludo-go-db"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rusqlite = "0.31.0"

3
ludo-go-db/src/main.rs Normal file
View file

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

10
ludo-go-server/Cargo.toml Normal file
View file

@ -0,0 +1,10 @@
[package]
name = "ludo-go-server"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tokio = { version = "1.37.0", features = ["full"] }
warp = "0.3.7"

View file

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

3
src/main.rs Normal file
View file

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}