Some changes in dockerfile and jenkinsfile
test-org/prometheus-exporter/pipeline/pr-master There was a failure building this commit
Details
test-org/prometheus-exporter/pipeline/pr-master There was a failure building this commit
Details
parent
beecc698f0
commit
6ad1b23359
|
|
@ -5,6 +5,7 @@ RUN apt update && apt install -y musl-tools
|
||||||
RUN rustup target add x86_64-unknown-linux-musl
|
RUN rustup target add x86_64-unknown-linux-musl
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN cargo test
|
||||||
RUN cargo build --release --target=x86_64-unknown-linux-musl
|
RUN cargo build --release --target=x86_64-unknown-linux-musl
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
@ -14,4 +15,4 @@ COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/exporter /app/
|
||||||
RUN apk add --no-cache ca-certificates
|
RUN apk add --no-cache ca-certificates
|
||||||
|
|
||||||
|
|
||||||
CMD ["/app/exporter"]
|
ENTRYPOINT ["/app/exporter"]
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,8 @@ pipeline {
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def image = docker.build("${env.IMAGE_NAME}:${env.IMAGE_TAG}")
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
sh "docker run --rm ${env.IMAGE_NAME}:${env.IMAGE_TAG} cargo test"
|
def image = docker.build("${env.IMAGE_NAME}:${env.IMAGE_TAG}")
|
||||||
sh "docker tag ${env.IMAGE_NAME}:${env.IMAGE_TAG} ${env.REGISTRY_NAME}/${env.IMAGE_NAME}:${env.IMAGE_TAG}"
|
sh "docker tag ${env.IMAGE_NAME}:${env.IMAGE_TAG} ${env.REGISTRY_NAME}/${env.IMAGE_NAME}:${env.IMAGE_TAG}"
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
error("Tests failed: ${e.message}")
|
error("Tests failed: ${e.message}")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue