This commit is contained in:
commit
b2ae852f0b
12 changed files with 1333 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/target
|
30
.woodpecker/deploy.sh
Normal file
30
.woodpecker/deploy.sh
Normal 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
30
.woodpecker/pipeline.yaml
Normal 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
1230
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
3
Cargo.toml
Normal file
3
Cargo.toml
Normal file
|
@ -0,0 +1,3 @@
|
|||
[workspace]
|
||||
members = ["ludo-go-server", "go-game", "ludo-go-db"]
|
||||
resolver = "2"
|
8
go-game/Cargo.toml
Normal file
8
go-game/Cargo.toml
Normal 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
3
go-game/src/main.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
9
ludo-go-db/Cargo.toml
Normal file
9
ludo-go-db/Cargo.toml
Normal 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
3
ludo-go-db/src/main.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
10
ludo-go-server/Cargo.toml
Normal file
10
ludo-go-server/Cargo.toml
Normal 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"
|
3
ludo-go-server/src/main.rs
Normal file
3
ludo-go-server/src/main.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
3
src/main.rs
Normal file
3
src/main.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
Loading…
Reference in a new issue