From e63cb454016b62092a6ff2e67618ed3e1f2cc9f3 Mon Sep 17 00:00:00 2001 From: oxaliq Date: Tue, 30 Apr 2024 17:54:06 -0400 Subject: [PATCH] serve web --- .woodpecker/deploy.sh | 2 +- .woodpecker/pipeline.yaml | 36 +++++++++++++++++------------------- ludo-go-server/src/main.rs | 9 +++++++-- 3 files changed, 25 insertions(+), 22 deletions(-) mode change 100644 => 100755 .woodpecker/deploy.sh diff --git a/.woodpecker/deploy.sh b/.woodpecker/deploy.sh old mode 100644 new mode 100755 index 46b5a30..f807df6 --- a/.woodpecker/deploy.sh +++ b/.woodpecker/deploy.sh @@ -7,7 +7,7 @@ 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/. +mv target/release/go-game ludo-go/. ## move the database here # copy files to deployment target diff --git a/.woodpecker/pipeline.yaml b/.woodpecker/pipeline.yaml index 6f5e621..3d430c3 100644 --- a/.woodpecker/pipeline.yaml +++ b/.woodpecker/pipeline.yaml @@ -1,5 +1,3 @@ -name: ludo-go-pipeline - when: branch: include: [ main ] @@ -11,20 +9,20 @@ steps: - 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 + 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 diff --git a/ludo-go-server/src/main.rs b/ludo-go-server/src/main.rs index e7a11a9..8b4afce 100644 --- a/ludo-go-server/src/main.rs +++ b/ludo-go-server/src/main.rs @@ -1,3 +1,8 @@ -fn main() { - println!("Hello, world!"); +use warp::Filter; + +#[tokio::main] +async fn main() { + let root = warp::path::end().map(|| "hello world"); + + warp::serve(root).run(([127, 0, 0, 1], 5000)).await; }