owntone: trying partial librar scan PR branch #2
42
build.sh
42
build.sh
|
@ -3,18 +3,42 @@
|
|||
set -e
|
||||
|
||||
usage() {
|
||||
echo "$0 <project>"
|
||||
echo "$0 <project> [--docker-push]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ "$1" = "" ]; then
|
||||
if [[ "$1" = "" ]]; then
|
||||
usage
|
||||
else
|
||||
PROJECT=$1
|
||||
PROJECT_PIPELINE=./${PROJECT}/.pipeline
|
||||
shift
|
||||
if [[ "$1" == "--docker-push" && -f "${PROJECT_PIPELINE}/docker-push.sh" ]]; then
|
||||
DOCKER_PUSH="true"
|
||||
else
|
||||
DOCKER_PUSH="false"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -f "${PROJECT_PIPELINE}/build.sh" && "${PROJECT}" == "owntone" ]]; then
|
||||
(
|
||||
set -e
|
||||
cd ./$PROJECT
|
||||
. .pipeline/build.sh
|
||||
|
||||
echo "[build.sh] executed '${PROJECT_PIPELINE}/build.sh' and exited with '$?'"
|
||||
echo
|
||||
|
||||
if [[ "${DOCKER_PUSH}" == "true" ]]; then
|
||||
. .pipeline/docker-push.sh
|
||||
echo "[build.sh] executed '${PROJECT_PIPELINE}/docker-push.sh' and exited with '$?'"
|
||||
echo
|
||||
fi
|
||||
)
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
for f in ${PROJECT_PIPELINE}/*.env; do
|
||||
echo "sourcing: $f"
|
||||
source $f
|
||||
|
@ -22,12 +46,12 @@ for f in ${PROJECT_PIPELINE}/*.env; do
|
|||
done
|
||||
echo && echo
|
||||
|
||||
if [ "${DOCKER_REPO}" = "" ]; then
|
||||
if [[ "${DOCKER_REPO}" = "" ]]; then
|
||||
# default if not explicitly set in project
|
||||
DOCKER_REPO="git.sudo.is/ben"
|
||||
fi
|
||||
|
||||
if [ -f "${PROJECT_PIPELINE}/init-git.sh" ]; then
|
||||
if [[ -f "${PROJECT_PIPELINE}/init-git.sh" ]]; then
|
||||
echo "running 'init-git.sh' for ${PROJECT}"
|
||||
(
|
||||
set -e
|
||||
|
@ -42,24 +66,24 @@ echo && echo
|
|||
echo "cleaning up ${PROJECT}/dist"
|
||||
mkdir -pv ./${PROJECT}/dist
|
||||
|
||||
if [ -d ./${PROJECT}/dist/target ]; then
|
||||
if [[ -d ./${PROJECT}/dist/target ]]; then
|
||||
echo "removing directory '${PROJECT}/dist/target'"
|
||||
rm -r ${PROJECT}/dist/target
|
||||
fi
|
||||
|
||||
if [ -f "./${PROJECT}/dist/*.tar.gz" ]; then
|
||||
if [[ -f "./${PROJECT}/dist/*.tar.gz" ]]; then
|
||||
rm -v ./${PROJECT}/dist/*.tar.gz
|
||||
fi
|
||||
if [ -f "./${PROJECT}/dist/*.tar.gz2" ]; then
|
||||
if [[ -f "./${PROJECT}/dist/*.tar.gz2" ]]; then
|
||||
rm -v ./${PROJECT}/dist/*.tar.gz2
|
||||
fi
|
||||
if [ -f "./${PROJECT}/dist/*.deb" ]; then
|
||||
if [[ -f "./${PROJECT}/dist/*.deb" ]]; then
|
||||
rm -v ./${PROJECT}/dist/*.deb
|
||||
fi
|
||||
echo && echo
|
||||
|
||||
BUILD_ARGS_FILE="${PROJECT_PIPELINE}/docker-build-args"
|
||||
if [ -f "$BUILD_ARGS_FILE" ]; then
|
||||
if [[ -f "$BUILD_ARGS_FILE" ]]; then
|
||||
echo "found docker-build-args file"
|
||||
cat $BUILD_ARGS_FILE
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@ fi
|
|||
|
||||
. ./.pipeline/init-git.sh
|
||||
|
||||
|
||||
mkdir -pv ./dist/
|
||||
rm -rv ./dist/dark-reader || true
|
||||
rm -rv ./dist/target || true
|
||||
rm -v ./dist/*.tar.gz || true
|
||||
rm -v ./dist/*.deb || true
|
||||
|
@ -26,23 +26,36 @@ rm -v ./dist/*.deb || true
|
|||
# create the .patch file with (dont include the huge css file):
|
||||
# git diff --patch > ../dark-reader-css.patch
|
||||
|
||||
# chdir into the git tree to apply the patch
|
||||
(
|
||||
# copy into the git tree and apply the patch
|
||||
cd owntone-server/
|
||||
git apply ../dark-reader-css.patch
|
||||
)
|
||||
# # chdir into the git tree to apply the patch
|
||||
# (
|
||||
# # copy into the git tree and apply the patch
|
||||
# cd owntone-server/
|
||||
# git apply ../dark-reader-css.patch
|
||||
# )
|
||||
|
||||
# then copy the css file
|
||||
cp dark-reader.css owntone-server/htdocs/assets
|
||||
# # then copy the css file
|
||||
# cp dark-reader.css owntone-server/htdocs/assets
|
||||
|
||||
|
||||
git --no-pager diff --color=always
|
||||
cp ../
|
||||
# git --no-pager diff --color=always
|
||||
# cp ../
|
||||
|
||||
docker build --pull --build-arg "VITE_OWNTONE_URL=$VITE_OWNTONE_URL" --target builder -t owntone:latest-builder .
|
||||
docker run -u $(id -u) --name owntone-build --rm -it -v $(pwd)/dist/:/mnt/dist/ owntone:latest-builder cp -r /usr/local/src/dist/. /mnt/dist/
|
||||
|
||||
docker build --pull --build-arg "VITE_OWNTONE_URL=$VITE_OWNTONE_URL" -t ${DOCKER_REPO}/owntone:latest .
|
||||
docker build --pull --build-arg "VITE_OWNTONE_URL=$VITE_OWNTONE_URL" -t ${DOCKER_REPO}/owntone:${OWNTONE_DOCKER_TAG} .
|
||||
|
||||
echo "$VITE_OWNTONE_URL"
|
||||
if [[ -d "./dist/dark-reader/" && -f "./dist/dark-reader/index.html" ]]; then
|
||||
echo
|
||||
echo
|
||||
(
|
||||
set -x
|
||||
diff --color=always ./dist/dark-reader/index.html ./dist/dark-reader/index.html.orig
|
||||
) || true
|
||||
echo
|
||||
echo
|
||||
fi
|
||||
|
||||
echo "VITE_OWNTONE_URL=\"${VITE_OWNTONE_URL}\""
|
||||
echo "[owntone/.pipeline/build.sh] done"
|
||||
echo "----------------------------"
|
||||
|
|
|
@ -4,5 +4,4 @@ set -e
|
|||
|
||||
source ./.pipeline/owntone.env
|
||||
|
||||
docker push ${DOCKER_REPO}/owntone:latest
|
||||
|
||||
docker push ${DOCKER_REPO}/owntone:${OWNTONE_DOCKER_TAG}
|
||||
|
|
|
@ -1,22 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -d "./${OWNTONE_SRC_REPO_NAME}/.git" ]; then
|
||||
if [[ -d "./${OWNTONE_SRC_REPO_NAME}/.git" ]]; then
|
||||
echo "clone of the ${OWNTONE_SRC_REPO_NAME} repo exists, updating branch '${OWNTONE_SRC_REPO_BRANCH}'."
|
||||
(
|
||||
cd ${OWNTONE_SRC_REPO_NAME}/
|
||||
git checkout ${OWNTONE_SRC_REPO_BRANCH}
|
||||
git checkout .
|
||||
git clean -fd
|
||||
git remote rm origin
|
||||
git remote add origin ${OWNTONE_SRC_REPO_ORIGIN}
|
||||
git pull origin ${OWNTONE_SRC_REPO_BRANCH}
|
||||
git checkout ${OWNTONE_SRC_REPO_BRANCH}
|
||||
|
||||
)
|
||||
else
|
||||
echo "clone of the ${OWNTONE_SRC_REPO_NAME} does not exist, cloning ${OWNTONE_SRC_REPO_ORIGIN}"
|
||||
git clone ${OWNTONE_SRC_REPO_ORIGIN}
|
||||
fi
|
||||
|
||||
if [ -d "./${OWNTONE_APT_REPO_NAME}/.git" ]; then
|
||||
if [[ -d "./${OWNTONE_APT_REPO_NAME}/.git" ]]; then
|
||||
echo "clone of the ${OWNTONE_APT_REPO_NAME} repo exists, updating branch '${OWNTONE_APT_REPO_BRANCH}'."
|
||||
(
|
||||
cd ${OWNTONE_APT_REPO_NAME}/
|
||||
|
@ -33,3 +35,24 @@ else
|
|||
fi
|
||||
|
||||
|
||||
echo "pulling and rebasing the branch for the partial filescans PR: https://github.com/owntone/owntone-server/pull/1179"
|
||||
(
|
||||
set -e
|
||||
|
||||
cd ${OWNTONE_SRC_REPO_NAME}/
|
||||
git checkout ${OWNTONE_SRC_REPO_BRANCH}
|
||||
|
||||
# cleanup and return to the main branch
|
||||
git branch -D file-scan-dir-path || true
|
||||
git remote rm whatdoineed2d || true
|
||||
|
||||
# add the repo with the PR branch
|
||||
git remote add whatdoineed2d https://github.com/whatdoineed2do/forked-daapd
|
||||
git fetch whatdoineed2d
|
||||
|
||||
#git rebase file-scan-dir-path
|
||||
|
||||
# check out the PR branch and rebase the main branch onto it (works now at least)
|
||||
git checkout file-scan-dir-path
|
||||
git rebase ${OWNTONE_SRC_REPO_BRANCH}
|
||||
)
|
||||
|
|
|
@ -7,3 +7,5 @@ export OWNTONE_APT_REPO_NAME="owntone-apt"
|
|||
export OWNTONE_APT_REPO_BRANCH="master"
|
||||
|
||||
export DOCKER_REPO=git.sudo.is/ben
|
||||
|
||||
export OWNTONE_DOCKER_TAG="file-scan-dir-path"
|
||||
|
|
|
@ -1,18 +1,31 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# copy dark-reader.css file from dark-reader (firefox extension), and
|
||||
# the modified index.html. both were placed in
|
||||
# /usr/local/src/dark-reader during the 'docker build`, and copy them
|
||||
# inside of the owntone build before we package it up
|
||||
|
||||
# save the diff of the index.html file in the dist/dark-reader dir for later inspection
|
||||
mkdir -p ${DISTDIR}dark-reader/
|
||||
ls -l ${DISTDIR}dark-reader/
|
||||
# touch ${DISTDIR}dark-reader/diff-index-html.txt
|
||||
# diff /usr/local/src/dark-reader/index.html ${DISTDIR}target/usr/share/owntone/htdocs/index.html >> ${DISTDIR}dark-reader/
|
||||
|
||||
# and save both the dark-reader findex.html file as it is included int he build, and the original index.html
|
||||
cp ${DISTDIR}target/usr/share/owntone/htdocs/index.html ${DISTDIR}dark-reader/index.html.orig
|
||||
cp /usr/local/src/dark-reader/index.html ${DISTDIR}dark-reader/
|
||||
|
||||
|
||||
# copy the files into the build
|
||||
cp -v /usr/local/src/dark-reader/dark-reader-full.css ${DISTDIR}/target/usr/share/owntone/htdocs/assets/dark-reader-full.css
|
||||
cp -v /usr/local/src/dark-reader/index.html ${DISTDIR}/target/usr/share/owntone/htdocs/index.html
|
||||
|
||||
echo "cat index.html"
|
||||
|
||||
cat ${DISTDIR}/target/usr/share/owntone/htdocs/index.html
|
||||
# save ls output of the htdocs/assets dir
|
||||
ls -l ${DISTDIR}/target/usr/share/owntone/htdocs/assets/ > ${DISTDIR}/dark-reader/ls-htdocs-assets.txt
|
||||
ls -l ${DISTDIR}/target/usr/share/owntone/htdocs/assets/dark-reader-full.css > ${DISTDIR}/dark-reader/ls-htdocs-assets-dark-reader-full.css.txt
|
||||
|
||||
tar -C ${DISTDIR}/target/ -czf ${DISTDIR}/owntone.tar.gz ${DISTDIR}/target/
|
||||
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
<title>OwnTone</title>
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index.css">
|
||||
<!--
|
||||
<link rel="stylesheet" href="/assets/dark-reader-full.css">
|
||||
-->
|
||||
<link rel="stylesheet" href="/assets/dark-reader-full.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
|
Loading…
Reference in New Issue