Build from Dockerfile to improve caching
Some checks failed
Core Repos/ImageApi/pipeline/pr-master There was a failure building this commit
Some checks failed
Core Repos/ImageApi/pipeline/pr-master There was a failure building this commit
This should improve build times with changes that don't change the dependencies in Cargo.toml.
This commit is contained in:
4
Dockerfile.ci
Normal file
4
Dockerfile.ci
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
FROM rust:1.55
|
||||||
|
COPY Cargo.toml .
|
||||||
|
RUN cargo fetch
|
||||||
|
COPY src/ ./src/
|
||||||
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@@ -1,8 +1,8 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent {
|
||||||
docker {
|
dockerfile {
|
||||||
image 'rust:1.55'
|
filename 'Dockerfile.ci'
|
||||||
args '-v "$PWD":/usr/src/image-api'
|
args '-v "$PWD:/usr/src/image-api'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ pub async fn login(
|
|||||||
if let Some(user) = user_dao.get_user(&creds.username, &creds.password) {
|
if let Some(user) = user_dao.get_user(&creds.username, &creds.password) {
|
||||||
let claims = Claims {
|
let claims = Claims {
|
||||||
sub: user.id.to_string(),
|
sub: user.id.to_string(),
|
||||||
exp: (Utc::now() + Duration::days(5)).timestamp(),
|
exp: (Utc::now() + Duration::minutes(1)).timestamp(),
|
||||||
};
|
};
|
||||||
let token = encode(
|
let token = encode(
|
||||||
&Header::default(),
|
&Header::default(),
|
||||||
|
|||||||
Reference in New Issue
Block a user