Skip to content

Commit

Permalink
generic checksum script
Browse files Browse the repository at this point in the history
  • Loading branch information
hernandev committed Jan 10, 2021
1 parent 9bbe271 commit 805a7ab
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
25 changes: 25 additions & 0 deletions bin/checksum.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

# stop on errors.
set -e

# define starting directory.
PA_SOURCES_PATH="${APORTS:-/home/sandbox/scripts}"

# source helpers.
# shellcheck disable=SC1090
source "${BASH_SOURCE%/*}/helpers/colors.sh"

# ensure starts on sources path.
# shellcheck disable=SC2164
cd "${PA_SOURCES_PATH}"

# find all package directories
PACKAGE_DIRS=$(find . -name "APKBUILD" | xargs -I % readlink -f % | xargs -I % dirname %)

# loop packages and build each one.
for PACKAGE_DIR in $PACKAGE_DIRS; do
cd "${PACKAGE_DIR}" && abuild checksum
done

# echo -e "${PACKAGE_DIRS}"
5 changes: 3 additions & 2 deletions sandbox/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ RUN adduser -D -u 1000 sandbox && \
sed -i "/#PACKAGER=.*/c\PACKAGER=\"${APK_PACKAGER}\"" /etc/abuild.conf && \
sed -i "/#MAINTAINER=.*/c\MAINTAINER=\"${APK_MAINTAINER}\"" /etc/abuild.conf && \
chown -R sandbox:sandbox /home/sandbox && \
chown -R sandbox:sandbox /opt/php-alpine
chown -R sandbox:sandbox /opt/php-alpine && \
echo 'export PATH="/opt/php-alpine/bin:$PATH"' > /etc/profile.d/php-bin.sh

# required for running "aports-build" tool.
RUN mkdir -p /var/run/mqtt-exec.aports-build && \
Expand All @@ -81,4 +82,4 @@ ENTRYPOINT ["/opt/php-alpine/entrypoint.sh"]
WORKDIR "/home/sandbox/scripts"

# use bash as default command.
CMD ["/usr/bin/env", "ash"]
CMD ["/bin/sh"]
5 changes: 1 addition & 4 deletions sandbox/opt/php-alpine/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/env ash

# set php-alpine bin directory on path.
export PATH=/opt/php-alpine/bin:$PATH
#!/bin/sh

# trust the locally mounted public key and fix permissions.
sudo cp /home/sandbox/.abuild/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
Expand Down

0 comments on commit 805a7ab

Please sign in to comment.