aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2019-09-20 22:39:28 -0700
committerGravatar MarkKoz <[email protected]>2019-09-20 22:39:28 -0700
commit00b7c8e52b7fdf55d886dbf2fff4e6144882640b (patch)
treec3a76bbaeb4c69f35b6d32522dee1bd55ad3e452 /scripts
parentLogin with v1 API (diff)
parentCI: use DockerHub container registry & remove login tasks (diff)
Merge branch 'ci' into research
Diffstat (limited to 'scripts')
-rw-r--r--scripts/.profile4
-rwxr-xr-xscripts/check_dockerfiles.sh10
-rwxr-xr-xscripts/dev.sh9
3 files changed, 13 insertions, 10 deletions
diff --git a/scripts/.profile b/scripts/.profile
index bff260d..bd46a17 100644
--- a/scripts/.profile
+++ b/scripts/.profile
@@ -20,8 +20,8 @@ nsjpy() {
--chroot / \
-E LANG=en_US.UTF-8 \
-R/usr -R/lib -R/lib64 \
- --user nobody \
- --group nogroup \
+ --user 65534 \
+ --group 65534 \
--time_limit 2 \
--disable_proc \
--iface_no_lo \
diff --git a/scripts/check_dockerfiles.sh b/scripts/check_dockerfiles.sh
index ddc7084..c84c61f 100755
--- a/scripts/check_dockerfiles.sh
+++ b/scripts/check_dockerfiles.sh
@@ -24,7 +24,8 @@ get_build() {
response="$(curl -sSL "${url}")"
if [[ -z "${response}" ]] \
- || ! printf '%s' "${response}" | jq -re '.count'
+ || ! count="$(printf '%s' "${response}" | jq -re '.count')" \
+ || (( "${count}" < 1 ))
then
return 1
else
@@ -64,7 +65,7 @@ printf '%s\n' "Comparing HEAD (${head}) against ${prev_commit}."
if git diff --quiet "${prev_commit}" -- docker/base.Dockerfile; then
echo "No changes detected in docker/base.Dockerfile."
- echo "##vso[task.setvariable variable=BASE_CHANGED;isOutput=true]false"
+ echo "##vso[task.setvariable variable=BASE_CHANGED;isOutput=true]False"
else
# Always rebuild the venv if the base changes.
exit 0
@@ -72,13 +73,14 @@ fi
if git diff --quiet "${prev_commit}" -- docker/venv.Dockerfile Pipfile*; then
echo "No changes detected in docker/venv.Dockerfile or the Pipfiles."
- echo "##vso[task.setvariable variable=VENV_CHANGED;isOutput=true]false"
+ echo "##vso[task.setvariable variable=VENV_CHANGED;isOutput=true]False"
elif master_commit="$(
get_build "refs/heads/master" \
| jq -re '.value[0].sourceVersion'
)" \
&& git diff --quiet "${master_commit}" -- docker/base.Dockerfile
then
+ # Though base image hasn't changed, it's still needed to build the venv.
echo "Can pull base image from Docker Hub; no changes made since master."
- echo "##vso[task.setvariable variable=BASE_PULL;isOutput=true]true"
+ echo "##vso[task.setvariable variable=BASE_PULL;isOutput=true]True"
fi
diff --git a/scripts/dev.sh b/scripts/dev.sh
index 097690b..8f5b24f 100755
--- a/scripts/dev.sh
+++ b/scripts/dev.sh
@@ -34,16 +34,17 @@ fi
# The volume is mounted to same the path in the container as the source
# directory on the host to ensure coverage can find the source files.
docker run \
- -td \
+ --tty \
+ --detach \
--name snekbox_test \
--privileged \
--network host \
- -h pdsnk-dev \
+ --hostname pdsnk-dev \
-e PYTHONDONTWRITEBYTECODE=1 \
-e PIPENV_PIPFILE="/snekbox/Pipfile" \
-e ENV="${PWD}/scripts/.profile" \
- -v "${PWD}":"${PWD}" \
- -w "${PWD}"\
+ --volume "${PWD}":"${PWD}" \
+ --workdir "${PWD}"\
--entrypoint /bin/ash \
pythondiscord/snekbox-venv:dev \
>/dev/null \