2021-09-26 14:42:50 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-05-15 18:02:02 +02:00
|
|
|
BUILDER_IMAGE="ghcr.io/polprzewodnikowy/sc64env:v1.5"
|
2022-01-16 21:13:59 +01:00
|
|
|
|
2022-05-15 15:47:12 +02:00
|
|
|
pushd $(dirname $0) > /dev/null
|
2021-12-10 17:36:30 +01:00
|
|
|
|
2022-01-16 21:13:59 +01:00
|
|
|
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
|
|
GIT_TAG=$(git describe --tags 2> /dev/null)
|
|
|
|
GIT_SHA=$(git rev-parse HEAD)
|
2022-01-12 16:14:08 +01:00
|
|
|
|
2022-01-15 01:16:17 +01:00
|
|
|
if [ -t 1 ]; then
|
|
|
|
DOCKER_OPTIONS="-it"
|
|
|
|
fi
|
2022-05-15 16:00:38 +02:00
|
|
|
|
2022-05-15 15:47:12 +02:00
|
|
|
docker run \
|
2022-01-16 21:13:59 +01:00
|
|
|
$DOCKER_OPTIONS \
|
2022-05-15 15:47:12 +02:00
|
|
|
--rm \
|
2022-05-15 18:02:02 +02:00
|
|
|
--user $(id -u):$(id -g) \
|
2022-05-15 15:47:12 +02:00
|
|
|
--mac-address ${MAC_ADDRESS:-F8:12:34:56:78:90} \
|
|
|
|
--mount type=bind,src="$(pwd)/flexlm",target="/flexlm" \
|
|
|
|
--mount type=bind,src="$(pwd)",target="/workdir" \
|
2022-01-16 21:13:59 +01:00
|
|
|
-e GIT_BRANCH="$GIT_BRANCH" \
|
|
|
|
-e GIT_TAG="$GIT_TAG" \
|
|
|
|
-e GIT_SHA="$GIT_SHA" \
|
2022-05-15 15:47:12 +02:00
|
|
|
$BUILDER_IMAGE \
|
2021-11-10 02:05:51 +01:00
|
|
|
./build.sh $@
|
2022-05-15 15:47:12 +02:00
|
|
|
|
2022-08-19 20:56:29 +02:00
|
|
|
BUILD_ERROR=$?
|
|
|
|
|
|
|
|
ls -R -lah $(pwd)/fw/project
|
2022-08-19 19:53:43 +02:00
|
|
|
|
2022-05-15 15:47:12 +02:00
|
|
|
popd > /dev/null
|
2022-08-19 19:53:43 +02:00
|
|
|
|
|
|
|
if [ $BUILD_ERROR -ne 0 ]; then
|
|
|
|
exit -1
|
|
|
|
fi
|