diff options
author | Michael Fenn <michaelfenn87@gmail.com> | 2017-04-28 03:14:27 -0400 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2017-04-28 12:44:27 +0530 |
commit | 41235445e714fa55bdc77328212628cb3dd34d58 (patch) | |
tree | 2842f1663c1e4830481a5d88b448a57966033951 /build-docker | |
parent | 4af8ba19f1ddbb0d85f239618d0a7b3e4b02217b (diff) | |
download | nnn-41235445e714fa55bdc77328212628cb3dd34d58.tar.gz |
Add automatic RPM builds via travis (#18)
* Add automatic RPM builds via travis
* readline.h must be imported after stdio.h to pick up def of FILE
Diffstat (limited to 'build-docker')
-rwxr-xr-x | build-docker | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/build-docker b/build-docker new file mode 100755 index 0000000..6be8c7a --- /dev/null +++ b/build-docker @@ -0,0 +1,42 @@ +#!/bin/bash + +set -xe + +if [[ $# -ne 2 ]]; then + echo "Usage: $0 <OS_TYPE> <OS_VERSION>" + exit 1 +fi + +os_type="$1" +os_version="$2" + +docker_args="-e OS_TYPE=$os_type -e OS_VERSION=$os_version -v $(pwd):/build:rw --rm=true" + +case $os_type in + centos|fedora) + # check for correct package manager + if [[ $os_type == "fedora" ]]; then + YUM=dnf + else + YUM=yum + fi + + # set up the docker image with a baseline + cat >Dockerfile <<EOF +FROM $os_type:$os_version +RUN mkdir /build +VOLUME /build +RUN $YUM -y install rpm-build gcc git make readline-devel ncurses-devel +EOF + sudo docker build -t nnn . + + # do the build + sudo docker run $docker_args nnn /bin/bash -c "cd /build && ./redhat/build-rpm" + ;; + *) + echo "$OS_TYPE $OS_VERSION not supported!" + exit 1 + ;; +esac + +# vim: et:ai:ts=4:sw=4 |