build-version.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. # (c) 2014-2018 Freifunk Hochstift <kontakt@hochstift.freifunk.net>
  3. #
  4. # calls build.sh with information found in given versionfile
  5. ### includes
  6. . functions.sh
  7. ### static variables
  8. MY_DIR=$(dirname $0)
  9. MY_DIR=$(readlink -f "${MY_DIR}")
  10. ### set reasonable defaults for unset environment variables
  11. versionfile=$1
  12. [ -r ${versionfile} ] || abort "Failed to find versionfile: '${versionfile}'."
  13. . ${versionfile}
  14. [ -n "${BROKEN}" ] || BROKEN=0
  15. [ -n "${BRANCH}" ] || abort "Failed to parse branch name from version file."
  16. [ -n "${GLUON}" ] || abort "Failed to parse Gluon base commit-id from version file."
  17. [ -n "${SITE}" ] || abort "Failed to parse site repo commit-id from version file."
  18. [ -n "${TARGETS}" ] || abort "Failed to parse targets from version file"
  19. [ -n "${TS}" ] || abort "Failed to parse timestamp from version file."
  20. [ -n "${VERSION}" ] || abort "Failed to parse version from version file."
  21. info "Building ${BRANCH} version '${VERSION}' again ..."
  22. echo " * Gluon base: ${GLUON}"
  23. echo " * Site commit: ${SITE}"
  24. echo " * Targets: ${TARGETS}"
  25. echo " * Timestamp: ${TS}"
  26. # invoke build script
  27. pushd ${MY_DIR} > /dev/null
  28. BASE="${GLUON}" BRANCH="${BRANCH}" SITE="${SITE}" VERSION="${VERSION}" BUILD_TS="${TS}" TARGETS="${TARGETS}" BROKEN="${BROKEN}" ./build.sh
  29. popd > /dev/null #${MY_DIR}