+last unstable commit: ${SHORTSHA} +
+ ++API Document(doxygen): https://nugulinux.github.io/sdk-unstable/doxygen/ +
+ ++ add-apt-repository ppa:nugulinux/sdk + apt-get update ++ +
+ echo "deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ bionic main" > /etc/apt/sources.list.d/nugudev.list + apt-get update ++ +
+ echo "deb [trusted=yes] https://nugulinux.github.io/sdk-unstable/ubuntu/ xenial main" > /etc/apt/sources.list.d/nugudev.list + apt-get update ++ +
Generated at ${DATE}
+ + + +EOF + +function generate { + DIST=$1 + HOST=$2 + PKGSREPO="dists/${DIST}/pool" + PKGS="dists/${DIST}/main/binary-${HOST}/" + + echo "> DEB Repo: ${PKGSREPO}" + echo "> Packages path: ${PKGS}" + + cd ${BASEROOT}/ubuntu + dpkg-scanpackages -m -a $HOST $PKGSREPO > ${PKGS}/Packages + cd - +} + +function generate_doxygen { + git clone https://github.com/${REPOSLUG} + cd ${REPO} + git checkout ${SHA} + git reset --hard + rm -rf .git + + doxygen + mv doc/html ${BASEROOT}/doxygen + cd .. + rm -rf ${REPO} +} + +generate "xenial" "amd64" +generate "xenial" "arm64" +generate "xenial" "armhf" +generate "bionic" "amd64" +generate "bionic" "arm64" +generate "bionic" "armhf" + +generate_doxygen diff --git a/prepare.sh b/prepare.sh new file mode 100755 index 0000000000..4b8e31c9c6 --- /dev/null +++ b/prepare.sh @@ -0,0 +1,52 @@ +#!/bin/bash +set -e + +echo "Repository slug = ${REPOSLUG}" +echo "SHA = ${SHA}" +echo "Short SHA = ${SHORTSHA}" + +# Get date for commit to genereate version +DATETIME=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X GET https://api.github.com/repos/${REPOSLUG}/commits/${SHORTSHA} | jq '.commit.committer.date' -r) +echo "commit.committer.date = ${DATETIME}" + +STAMP=$(date -d ${DATETIME} +%Y%m%d) +VERSION="${STAMP}${SHORTSHA}" +echo "package version = ${VERSION}" + +echo "Clone the sdk repository" +git clone https://github.com/${REPOSLUG} --recursive +cd ${REPO} +git checkout ${SHA} +git reset --hard +rm -rf .git + +echo "Add commit-id(${SHORTSHA}) to package version" +sed -i "1 s/ubuntu[0-9]*~xenial/ubuntu${VERSION}~xenial/" packaging/xenial/changelog +sed -i "1 s/ubuntu[0-9]*~bionic/ubuntu${VERSION}~bionic/" packaging/bionic/changelog +head -1 packaging/xenial/changelog +head -1 packaging/bionic/changelog +cd - + +# Fix permissions for docker +chmod 777 $PWD +chmod 777 $PWD/${REPO} + +echo "Build debian package" +docker run -t --rm --privileged -v $PWD:$PWD -w $PWD/${REPO} \ + -v /var/lib/schroot/chroots \ + nugulinux/buildenv:$TARGET sdkbuild.sh + +ls -l + +if [[ -d /tmp/result ]]; then + echo "/tmp/result exist" + ls -l /tmp/result + rm -rf /tmp/result/* +else + echo "Create /tmp/result" + mkdir /tmp/result +fi + +cp *.deb /tmp/result/ + +echo "Completed"