From 617c6519a62973ce308bfaa28d21f086af9f779a Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Sun, 25 Aug 2019 15:11:04 +0200 Subject: [PATCH] feat(rpm-builder): add rpm-builder binary and fix PATh environment --- Dockerfile | 11 +++++------ Makefile | 1 - installation-scripts/01-rustup.sh | 9 +++++++++ installation-scripts/02-rpm-builder.sh | 10 ++++++++++ 4 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 installation-scripts/01-rustup.sh create mode 100644 installation-scripts/02-rpm-builder.sh diff --git a/Dockerfile b/Dockerfile index 85bcce0..613236b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,12 +5,11 @@ RUN pacman --sync \ --noconfirm \ --sysupgrade go gcc make git go-bindata -RUN curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh && \ - chmod +x /tmp/rustup.sh && \ - /tmp/rustup.sh -y && \ - source ${HOME}/.cargo/env && \ - rustup target add x86_64-unknown-linux-musl +ENV PATH="/root/.cargo/bin:${PATH}" -ENV PATH='/root/.cargo/bin:${PATH}' +COPY installation-scripts /tmp/installation-scripts +RUN chmod +x /tmp/installation-scripts/* && \ + for f in $(ls /tmp/installation-scripts); do /tmp/installation-scripts/$f; done && \ + rm -rf /tmp/installation-scripts WORKDIR /workspace \ No newline at end of file diff --git a/Makefile b/Makefile index 8b304c2..75f781b 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,6 @@ DOCKER_USER:=volkerraschek image-build: docker build \ - --no-cache \ --tag ${DOCKER_USER}/build-image:${VERSION} \ . diff --git a/installation-scripts/01-rustup.sh b/installation-scripts/01-rustup.sh new file mode 100644 index 0000000..bdcbd03 --- /dev/null +++ b/installation-scripts/01-rustup.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh && \ + chmod +x /tmp/rustup.sh && \ + /tmp/rustup.sh -y && \ + source ${HOME}/.cargo/env && \ + rustup target add x86_64-unknown-linux-musl \ No newline at end of file diff --git a/installation-scripts/02-rpm-builder.sh b/installation-scripts/02-rpm-builder.sh new file mode 100644 index 0000000..1d54600 --- /dev/null +++ b/installation-scripts/02-rpm-builder.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +VERSION=v0.3.1 +TMP_DIR=$(mktemp -d) + +git clone --branch ${VERSION} https://github.com/Richterrettich/rpm-builder.git ${TMP_DIR} && + make -C ${TMP_DIR} build_linux && + cp ${TMP_DIR}/target/x86_64-unknown-linux-musl/release/rpm-builder /usr/local/bin/rpm-builder