summaryrefslogtreecommitdiffstats
path: root/redhat/docker/run.sh
blob: b8138d8c36361d7b851f2b2bda476edad9a2760a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

DISTRIB="$1"
TDE_VERSION="$2"
ARCH="$3"

[ -z "${TDE_VERSION}" ] && TDE_VERSION="14.0.4"
[ -z "${ARCH}" ] && ARCH="x86_64"

IMAGE="trinity.${DISTRIB}.${ARCH}:${TDE_VERSION}"
DIST="$(sed -n ${DISTRIB}/rpmmacros -e "/%dist/ s|.* ||p")"

mkdir -p "${HOME}/rpmbuild/RPMS/RPMS${DIST}.tde-${TDE_VERSION}"
mkdir -p "${HOME}/rpmbuild/SRPMS/SRPMS${DIST}.tde-${TDE_VERSION}"
mkdir -p "/dev/shm/docker"

docker run -t -i --rm \
  -h "${IMAGE}" \
  -v /dev/shm/docker:/tmp:z \
  -u trinity \
  -e TMPPATH=/tmp \
  -e TDE_VERSION=${TDE_VERSION} \
  -w /home/trinity/tde/tde-packaging/redhat \
  -v ${HOME}/.gnupg:/home/trinity/.gnupg \
  -v ${HOME}/tde/tde-packaging:/home/trinity/tde/tde-packaging \
  -v ${HOME}/tde/tde-tarballs:/home/trinity/tde/tde-tarballs \
  -v ${HOME}/rpmbuild/RPMS/RPMS${DIST}.tde-${TDE_VERSION}:/home/trinity/rpmbuild/RPMS.tde-${TDE_VERSION} \
  -v ${HOME}/rpmbuild/SRPMS/SRPMS${DIST}.tde-${TDE_VERSION}:/home/trinity/rpmbuild/SRPMS.tde-${TDE_VERSION} \
  "${IMAGE}" setarch ${ARCH} bash