adding dockerfile and jenkinsfile
This commit is contained in:
parent
2fa38d96dc
commit
bb9f170134
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
||||
pkg
|
||||
target
|
22
.jenkins/jenkinsfile
Normal file
22
.jenkins/jenkinsfile
Normal file
@ -0,0 +1,22 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Deploy') {
|
||||
when { branch 'master' }
|
||||
steps {
|
||||
script {
|
||||
docker.withRegistry('https://git.sarsoo.xyz', 'git-registry-creds') {
|
||||
|
||||
docker.build("sarsoo/draught:latest").push()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
20
Dockerfile
Normal file
20
Dockerfile
Normal file
@ -0,0 +1,20 @@
|
||||
FROM rust:1.69 AS rust-build
|
||||
|
||||
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||
|
||||
COPY . ./
|
||||
|
||||
RUN wasm-pack build --release
|
||||
RUN cargo doc --no-deps --document-private-items
|
||||
|
||||
FROM node:18 AS js-build
|
||||
|
||||
COPY . ./
|
||||
COPY --from=rust-build /pkg /pkg
|
||||
WORKDIR /www
|
||||
RUN npm ci
|
||||
RUN npm run build --if-present
|
||||
COPY --from=rust-build /target/doc /www/dist/
|
||||
|
||||
FROM nginx
|
||||
COPY --from=js-build /www/dist /usr/share/nginx/html/
|
Loading…
Reference in New Issue
Block a user