pass git revision to build process (#617)
This commit is contained in:
@@ -29,6 +29,10 @@ jobs:
|
||||
-
|
||||
name: checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: gh-describe
|
||||
id: gittag
|
||||
uses: proudust/gh-describe@v1.4.6
|
||||
-
|
||||
name: set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
@@ -46,4 +50,4 @@ jobs:
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: build
|
||||
run: cd contrib/docker && LIMITARCH=${{ github.event.inputs.limitarch }} ./build.sh
|
||||
run: cd contrib/docker && LIMITARCH=${{ github.event.inputs.limitarch }} GIT_REVISION=${{ steps.gittag.outputs.describe }} ./build.sh
|
||||
|
||||
+6
-2
@@ -137,8 +137,12 @@ AC_DEFINE_UNQUOTED(PACKAGE_LOGFILE, LOCALSTATEDIR "/log/" PACKAGE ".log", [The p
|
||||
AC_DEFINE(SCAN_VERSION, "[m4_esyscmd_s([sed -e 's#^\([0-9]*\.[0-9]*\).*#\1#' -e 's#\.\([0-9]\)$#0\1#' -e 's#\.##' VERSION])]", [The version of the package formatted for the scan result.])
|
||||
AC_DEFINE(PACKAGE_VERSION_MAJOR, "[m4_esyscmd_s([sed -e 's#^\([0-9]*\)\..*$#\1#' VERSION])]", [The major version of the package.])
|
||||
AC_DEFINE(PACKAGE_VERSION_MINOR, "[m4_esyscmd_s([sed -e 's#^.*\.\([0-9]*\)$#\1#' VERSION])]", [The minor version of the package.])
|
||||
AC_DEFINE(REVISION, "[m4_esyscmd_s([git describe --always 2>/dev/null || (date +p%Y%m%d)])]", [The revision of the package.])
|
||||
|
||||
AC_ARG_VAR(GIT_REVISION, [Predefined value to use for revision instead of running git describe.])
|
||||
if test -n "$GIT_REVISION"; then
|
||||
AC_DEFINE(REVISION, [m4_esyscmd_s([echo "$GIT_REVISION"])], [The revision of the package.])
|
||||
else
|
||||
AC_DEFINE(REVISION, "[m4_esyscmd_s([git describe --always 2>/dev/null || (date +p%Y%m%d)])]", [The revision of the package.])
|
||||
fi
|
||||
AC_CHECK_PROGS([HAVE_DOXYGEN], [doxygen], [])
|
||||
if test -z "$HAVE_DOXYGEN"; then
|
||||
AC_MSG_WARN([Doxygen not found - continuing without Doxygen support.])
|
||||
|
||||
@@ -13,12 +13,14 @@ WORKDIR /build
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
ARG EBUSD_VERSION
|
||||
ARG GIT_REVISION
|
||||
|
||||
ENV EBUSD_ARCH $TARGETARCH$TARGETVARIANT
|
||||
ENV EBUSD_VERSION $EBUSD_VERSION
|
||||
ENV GIT_REVISION $GIT_REVISION
|
||||
|
||||
ADD . /build
|
||||
RUN RUNTEST=full ./make_debian.sh
|
||||
RUN RUNTEST=full GIT_REVISION=$GIT_REVISION ./make_debian.sh
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,12 +13,14 @@ WORKDIR /build
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
ARG EBUSD_VERSION
|
||||
ARG GIT_REVISION
|
||||
|
||||
ENV EBUSD_ARCH $TARGETARCH$TARGETVARIANT
|
||||
ENV EBUSD_VERSION $EBUSD_VERSION
|
||||
ENV GIT_REVISION $GIT_REVISION
|
||||
|
||||
ADD . /build
|
||||
RUN ./make_debian.sh
|
||||
RUN GIT_REVISION=$GIT_REVISION ./make_debian.sh
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,9 +13,11 @@ WORKDIR /build
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
ARG EBUSD_VERSION
|
||||
ARG GIT_REVISION
|
||||
|
||||
ENV EBUSD_ARCH $TARGETARCH$TARGETVARIANT
|
||||
ENV EBUSD_VERSION $EBUSD_VERSION
|
||||
ENV GIT_REVISION $GIT_REVISION
|
||||
|
||||
ADD . /build
|
||||
RUN %EBUSD_MAKE%
|
||||
|
||||
@@ -58,6 +58,7 @@ for image in $images; do
|
||||
--build-arg "UPLOAD_URL=$UPLOAD_URL" \
|
||||
--build-arg "UPLOAD_CREDENTIALS=$UPLOAD_CREDENTIALS" \
|
||||
--build-arg "UPLOAD_OS=$image" \
|
||||
--build-arg "GIT_REVISION=$GIT_REVISION" \
|
||||
-t $tagprefix$tagsuffix \
|
||||
$extratag \
|
||||
$output \
|
||||
|
||||
@@ -15,7 +15,7 @@ function replaceTemplate () {
|
||||
|
||||
# devel update
|
||||
version_variant='-devel'
|
||||
make='RUNTEST=full ./make_debian.sh'
|
||||
make='RUNTEST=full GIT_REVISION=\$GIT_REVISION ./make_debian.sh'
|
||||
upload_lines=''
|
||||
copydeb='COPY --from=build /build/ebusd-*_mqtt1.deb ebusd.deb'
|
||||
debsrc='ebusd.deb \&\& rm -f ebusd.deb'
|
||||
@@ -25,7 +25,7 @@ replaceTemplate
|
||||
|
||||
# release update
|
||||
version_variant=''
|
||||
make='./make_debian.sh'
|
||||
make='GIT_REVISION=\$GIT_REVISION ./make_debian.sh'
|
||||
copydeb="ADD https://github.com/john30/ebusd/releases/download/v\${EBUSD_VERSION}/ebusd-\${EBUSD_VERSION}_\${TARGETARCH}\${TARGETVARIANT}-\${EBUSD_IMAGE}_mqtt1.deb ebusd.deb"
|
||||
copyentry='COPY contrib/docker/docker-entrypoint.sh /'
|
||||
namesuffix='.release'
|
||||
@@ -33,7 +33,7 @@ replaceTemplate
|
||||
|
||||
if [[ -n "$1" ]]; then
|
||||
# build releases update
|
||||
make='./make_all.sh'
|
||||
make='GIT_REVISION=\$GIT_REVISION ./make_all.sh'
|
||||
upload_lines='ARG UPLOAD_URL\nARG UPLOAD_CREDENTIALS\nARG UPLOAD_OS\nRUN if [ -n "\$UPLOAD_URL" ] \&\& [ -n "\$UPLOAD_CREDENTIALS" ]; then for img in ebusd-*.deb; do echo -n "upload \$img: "; curl -fsSk -u "\$UPLOAD_CREDENTIALS" -X POST --data-binary "@\$img" -H "Content-Type: application/octet-stream" "\$UPLOAD_URL/\$img?a=\$EBUSD_ARCH\&o=\$UPLOAD_OS\&v=\$EBUSD_VERSION" || echo "failed"; done; fi'
|
||||
upload_lines+='\n\n\nFROM scratch as deb\nCOPY --from=build /build/*.deb /'
|
||||
namesuffix='.build'
|
||||
|
||||
Reference in New Issue
Block a user