Compare commits

...

8 Commits

Author SHA1 Message Date
Cameron Cordes
99dbc6577e Fix build directory permissions
Some checks failed
Core Repos/ImageApi/pipeline/pr-master There was a failure building this commit
2021-12-24 13:20:43 -05:00
Cameron Cordes
5a965d766b Update working directory
Some checks failed
Core Repos/ImageApi/pipeline/pr-master There was a failure building this commit
2021-12-24 11:05:06 -05:00
Cameron Cordes
44f9bcedbd Set User to fix permission issue
Some checks failed
Core Repos/ImageApi/pipeline/pr-master There was a failure building this commit
2021-12-24 11:02:34 -05:00
Cameron Cordes
90625e099e Create src directory
Some checks failed
Core Repos/ImageApi/pipeline/pr-master There was a failure building this commit
2021-12-24 10:45:35 -05:00
Cameron Cordes
d20a7e9c4d Make temporary main.rs for fetch
Some checks failed
Core Repos/ImageApi/pipeline/pr-master There was a failure building this commit
2021-12-24 10:44:18 -05:00
Cameron Cordes
6e39f8c58e Build from Dockerfile to improve caching
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.
2021-12-24 10:33:26 -05:00
1e3f33c2d3 Merge pull request 'Update Rust image to 1.55' (#17) from feature/update-ci-rust-155 into master
All checks were successful
Core Repos/ImageApi/pipeline/head This commit looks good
Reviewed-on: #17
2021-10-13 16:41:15 +00:00
Cameron Cordes
f0e96071be Update Rust image to 1.55
All checks were successful
Core Repos/ImageApi/pipeline/pr-master This commit looks good
2021-10-13 12:12:25 -04:00
3 changed files with 11 additions and 4 deletions

7
Dockerfile.ci Normal file
View File

@@ -0,0 +1,7 @@
FROM rust:1.55
RUN mkdir /usr/src/image-api && chown -R 1000:999 /usr/src/image-api
USER 1000:999
WORKDIR /usr/src/image-api
COPY Cargo.toml .
RUN mkdir ./src && echo "fn main() {}" > ./src/main.rs && cargo fetch
COPY src/ ./src/

6
Jenkinsfile vendored
View File

@@ -1,8 +1,8 @@
pipeline { pipeline {
agent { agent {
docker { dockerfile {
image 'rust:1.51' filename 'Dockerfile.ci'
args '-v "$PWD":/usr/src/image-api' args '-v "$PWD:/usr/src/image-api'
} }
} }

View File

@@ -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(),