Merge pull request #3 from Northcode/master-rust
use alpine docker image and build in docker instead of jenkins
This commit is contained in:
commit
9f7e311069
17
Dockerfile
17
Dockerfile
@ -1,14 +1,17 @@
|
|||||||
FROM debian
|
ARG BASE_IMAGE=ekidd/rust-musl-builder:latest
|
||||||
|
|
||||||
RUN apt update
|
FROM ${BASE_IMAGE} AS builder
|
||||||
RUN apt install libssl1.1 openssl ca-certificates
|
|
||||||
|
|
||||||
ADD target/release/rollux /bin/.
|
ADD --chown=rust:rust . ./
|
||||||
|
|
||||||
RUN mkdir /app/
|
RUN cargo build --release
|
||||||
|
|
||||||
WORKDIR /app/
|
FROM alpine:latest
|
||||||
|
|
||||||
|
RUN apk --no-cache add ca-certificates
|
||||||
|
|
||||||
|
COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/rollux /usr/local/bin/
|
||||||
|
|
||||||
ENV DISCORD_TOKEN="invalid"
|
ENV DISCORD_TOKEN="invalid"
|
||||||
|
|
||||||
CMD '/bin/rollux'
|
CMD /usr/local/bin/rollux
|
||||||
|
|||||||
13
Jenkinsfile
vendored
13
Jenkinsfile
vendored
@ -1,21 +1,8 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
stages {
|
stages {
|
||||||
stage('build') {
|
|
||||||
agent {
|
|
||||||
docker {
|
|
||||||
image 'rust'
|
|
||||||
reuseNode true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
sh 'cargo build --release'
|
|
||||||
stash includes: 'target/release/rollux', name: 'app'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('docker build') {
|
stage('docker build') {
|
||||||
steps {
|
steps {
|
||||||
unstash 'app'
|
|
||||||
echo 'Starting docker image build'
|
echo 'Starting docker image build'
|
||||||
script {
|
script {
|
||||||
docker.withRegistry("https://pkg.northcode.no", 'docker-login') {
|
docker.withRegistry("https://pkg.northcode.no", 'docker-login') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user