Skip to content

Commit 805a7ab

Browse files
committed
generic checksum script
1 parent 9bbe271 commit 805a7ab

File tree

3 files changed

+29
-6
lines changed

3 files changed

+29
-6
lines changed

bin/checksum.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
# stop on errors.
4+
set -e
5+
6+
# define starting directory.
7+
PA_SOURCES_PATH="${APORTS:-/home/sandbox/scripts}"
8+
9+
# source helpers.
10+
# shellcheck disable=SC1090
11+
source "${BASH_SOURCE%/*}/helpers/colors.sh"
12+
13+
# ensure starts on sources path.
14+
# shellcheck disable=SC2164
15+
cd "${PA_SOURCES_PATH}"
16+
17+
# find all package directories
18+
PACKAGE_DIRS=$(find . -name "APKBUILD" | xargs -I % readlink -f % | xargs -I % dirname %)
19+
20+
# loop packages and build each one.
21+
for PACKAGE_DIR in $PACKAGE_DIRS; do
22+
cd "${PACKAGE_DIR}" && abuild checksum
23+
done
24+
25+
# echo -e "${PACKAGE_DIRS}"

sandbox/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ RUN adduser -D -u 1000 sandbox && \
6060
sed -i "/#PACKAGER=.*/c\PACKAGER=\"${APK_PACKAGER}\"" /etc/abuild.conf && \
6161
sed -i "/#MAINTAINER=.*/c\MAINTAINER=\"${APK_MAINTAINER}\"" /etc/abuild.conf && \
6262
chown -R sandbox:sandbox /home/sandbox && \
63-
chown -R sandbox:sandbox /opt/php-alpine
63+
chown -R sandbox:sandbox /opt/php-alpine && \
64+
echo 'export PATH="/opt/php-alpine/bin:$PATH"' > /etc/profile.d/php-bin.sh
6465

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

8384
# use bash as default command.
84-
CMD ["/usr/bin/env", "ash"]
85+
CMD ["/bin/sh"]

sandbox/opt/php-alpine/entrypoint.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
#!/usr/bin/env ash
2-
3-
# set php-alpine bin directory on path.
4-
export PATH=/opt/php-alpine/bin:$PATH
1+
#!/bin/sh
52

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

0 commit comments

Comments
 (0)