Browse Source

CI

pull/1/head
Stephen 8 months ago
parent
commit
bf6f32b4e6
2 changed files with 43 additions and 13 deletions
  1. +34
    -0
      Jenkinsfile
  2. +9
    -13
      src/main.rs

+ 34
- 0
Jenkinsfile View File

@ -0,0 +1,34 @@
pipeline {
agent {
docker {
image 'rust:latest'
}
}
stages {
stage('Rustfmt') {
steps {
sh "rustup component add rustfmt"
sh "cargo fmt -- --check"
}
}
stage('Clippy') {
steps {
sh "rustup component add clippy"
sh "cargo clippy --all-targets --all-features -- -D warnings"
}
}
/*stage('Build') {
steps {
sh "cargo install cargo-deb"
sh "cargo deb"
}
}*/
}
post {
always {
archiveArtifacts artifacts: 'target/debian/*.deb', fingerprint: true
}
}
}

+ 9
- 13
src/main.rs View File

@ -159,20 +159,16 @@ async fn blacklist_proxy_fn(
.into_response(),
)
}
None => {
Ok(warp::reply::with_status(
"Proxy not found",
http::status::StatusCode::NOT_FOUND,
)
.into_response())
}
},
None => {
Ok(warp::reply::with_status(
"Website not found",
None => Ok(warp::reply::with_status(
"Proxy not found",
http::status::StatusCode::NOT_FOUND,
)
.into_response())
}
.into_response()),
},
None => Ok(warp::reply::with_status(
"Website not found",
http::status::StatusCode::NOT_FOUND,
)
.into_response()),
}
}

Loading…
Cancel
Save