moar build script
ci/woodpecker/push/base Pipeline was successful
Details
ci/woodpecker/push/base Pipeline was successful
Details
parent
5b3a208f16
commit
842cd08574
|
@ -11,20 +11,17 @@ if [[ ! -d "${NPM_DIR}" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${BUILDINDOCKER:-}" != "yes" ]]; then
|
if [[ "${BUILDINDOCKER:-}" != "yes" ]]; then
|
||||||
docker run --rm --workdir "/work" -v "${NPM_DIR}:/home/" -v "${BASEPATH}:/work" -e BUILDINDOCKER=yes node:14-bullseye /bin/bash -c 'chmod +x /work/scripts/build_in_docker.sh && /work/scripts/build_in_docker.sh'
|
if docker -v | grep -qi "podman"; then
|
||||||
|
is_podman='yes'
|
||||||
|
fi
|
||||||
|
docker run --rm --workdir "/work" -v "${BASEPATH}:/work" -e is_podman="${is_podman:-no}" -e BUILDINDOCKER=yes -e npm_config_cache=/work/.npm node:14-bullseye /bin/bash -c 'chmod +x /work/scripts/build_in_docker.sh && /work/scripts/build_in_docker.sh'
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## in docker
|
## in docker
|
||||||
|
|
||||||
echo "adding npmrc"
|
|
||||||
cat >>"${HOME}/.npmrc" <<'EOF'
|
|
||||||
cache=/work/.npm
|
|
||||||
fund=false
|
|
||||||
EOF
|
|
||||||
|
|
||||||
echo "adding secure git dir"
|
echo "adding secure git dir"
|
||||||
git config --global --add safe.directory /work
|
git config --global --add safe.directory '*'
|
||||||
|
|
||||||
echo "running chmods"
|
echo "running chmods"
|
||||||
find "${BASEPATH}" -iname "*.sh" -exec chmod +x {} +
|
find "${BASEPATH}" -iname "*.sh" -exec chmod +x {} +
|
||||||
|
@ -41,5 +38,9 @@ npx browserslist@latest --update-db || exit 1
|
||||||
echo "running build"
|
echo "running build"
|
||||||
"${BASEPATH}/scripts/build.sh" web rel
|
"${BASEPATH}/scripts/build.sh" web rel
|
||||||
|
|
||||||
|
if [[ "${is_podman}" != 'yes' ]]; then
|
||||||
echo "fixing perms"
|
echo "fixing perms"
|
||||||
chown -R 1000:1000 /work
|
chown -R 1000:1000 /work
|
||||||
|
else
|
||||||
|
echo "in podman, not fixing perms"
|
||||||
|
fi
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SCRIPT=$(realpath "$0")
|
||||||
|
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||||
|
BASEPATH="$(realpath "${SCRIPTPATH}/../")"
|
||||||
|
|
||||||
|
echo "adding secure git dir"
|
||||||
|
git config --global --add safe.directory '*'
|
||||||
|
|
||||||
|
echo "running chmods"
|
||||||
|
find "${BASEPATH}" -iname "*.sh" -exec chmod +x {} +
|
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SCRIPT=$(realpath "$0")
|
||||||
|
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||||
|
BASEPATH="$(realpath "${SCRIPTPATH}/../")"
|
||||||
|
|
||||||
|
NPM_DIR="${BASEPATH}/.npm"
|
||||||
|
|
||||||
|
if [[ ! -d "${NPM_DIR}" ]]; then
|
||||||
|
mkdir "${NPM_DIR}" || exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if docker -v | grep -qi "podman"; then
|
||||||
|
is_podman='yes'
|
||||||
|
fi
|
||||||
|
|
||||||
|
function run() {
|
||||||
|
docker run --rm --workdir "/work" -v "${BASEPATH}:/work" -e is_podman="${is_podman:-no}" -e BUILDINDOCKER=yes -e npm_config_cache=/work/.npm ${opts:-} node:14-bullseye ${@}
|
||||||
|
}
|
||||||
|
|
||||||
|
opts="-it" run /bin/bash -c 'bash /work/scripts/in_docker_prep.sh && bash'
|
||||||
|
|
||||||
|
if [[ "${is_podman}" != 'yes' ]]; then
|
||||||
|
echo "fixing perms"
|
||||||
|
run /bin/bash -c 'chown -R 1000:1000 /work'
|
||||||
|
else
|
||||||
|
echo "in podman, not fixing perms"
|
||||||
|
fi
|
Loading…
Reference in New Issue