From 540196b48863ca137b56d9c08bd9821e36918f7f Mon Sep 17 00:00:00 2001 From: dev-docker Date: Sat, 15 May 2021 13:14:07 +0000 Subject: [PATCH 1/3] fix(DEV): add global node-sass This fixes the case, where you bind-mount your own tileboard source directory into the dev container. Apparently, the node-sass module is compiled for the specdific machine. This seems to result in the `node-sass` executable not being found in the container, if the `node_modules` folder was compiled on a different machine (OS?). By adding node-sass globally in the container, it can be found even with a bind-mounted `tileboard-source` directory. --- Dockerfile.nightly | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.nightly b/Dockerfile.nightly index d05e050..e289896 100644 --- a/Dockerfile.nightly +++ b/Dockerfile.nightly @@ -12,6 +12,7 @@ RUN mkdir /tileboard-source \ && mkdir /tileboard \ && ln -s /tileboard build \ && yarn install \ + && npm install --global node-sass \ && yarn run build # Start Server @@ -31,4 +32,4 @@ COPY --from=dev /tileboard /tileboard # Start Server WORKDIR /tileboard EXPOSE 8000 -ENTRYPOINT python3 -m http.server \ No newline at end of file +ENTRYPOINT python3 -m http.server From f46f79bd4e1526c9cccacec8d624f6a6beab3669 Mon Sep 17 00:00:00 2001 From: dev-docker Date: Thu, 20 May 2021 20:19:36 +0000 Subject: [PATCH 2/3] feat(RELEASE): allow overriding build.sh * add `ARG` for `RELEASE_URL` * make `build.sh` prepare `.tags` even if tag exists * add outputs to be used by github workflows --- Dockerfile | 5 +++-- build.sh | 26 ++++++++++++++++---------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index d89199f..ff5ffff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,11 +7,12 @@ RUN apk update \ && update-ca-certificates # Download TileBoard -RUN wget -q -O release.zip "%RELEASE_URL%" \ +ARG RELEASE_URL +RUN wget -q -O release.zip "${RELEASE_URL:-%RELEASE_URL%}" \ && unzip release.zip -d /tileboard/ \ && rm release.zip # Start Server WORKDIR /tileboard EXPOSE 8000 -ENTRYPOINT python3 -m http.server \ No newline at end of file +ENTRYPOINT python3 -m http.server diff --git a/build.sh b/build.sh index 5e7c41b..0dd3621 100755 --- a/build.sh +++ b/build.sh @@ -32,21 +32,27 @@ echo "Docker repository: $docker_repo." LATEST_RELEASE=`getVersionFromLatestRelease $source_repo` echo "Latest release is: $LATEST_RELEASE." +echo "::set-output name=latest_release::$LATEST_RELEASE" + +SEMVER=( ${LATEST_RELEASE//./ } ) +MAJOR=${SEMVER[0]} +MINOR=${SEMVER[0]}.${SEMVER[1]} +PATCH=$LATEST_RELEASE +echo "::set-output name=major::$MAJOR" +echo "::set-output name=minor::$MINOR" +echo "::set-output name=patch::$PATCH" + +echo "latest,$MAJOR,$MINOR,$PATCH" > .tags +echo "::set-output name=tags::$(cat .tags)" + +RELEASE_URL=`getDownloadUrl` +echo "URL of release is: $RELEASE_URL." +echo "::set-output name=release_url::$RELEASE_URL" if docker_tag_exists $docker_repo $LATEST_RELEASE; then echo "Nothing to do. Latest release tag already exists." exit 78 # drone.io exit code to stop but success the pipeline fi -SEMVER=( ${LATEST_RELEASE//./ } ) -MAJOR=${SEMVER[0]} -MINOR=${SEMVER[0]}.${SEMVER[1]} -PATCH=$LATEST_RELEASE - -echo "latest,$MAJOR,$MINOR,$PATCH" > .tags - -RELEASE_URL=`getDownloadUrl` -echo "URL of release is: $RELEASE_URL." - echo "Writing release URL into Dockerfile..." sed -i "s|%RELEASE_URL%|$RELEASE_URL|g" ./Dockerfile From 908898fd98e7e261ced6f0d052d022e500e18aff Mon Sep 17 00:00:00 2001 From: dev-docker Date: Fri, 21 May 2021 06:51:04 +0000 Subject: [PATCH 3/3] remove superfluous outputs --- build.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/build.sh b/build.sh index 0dd3621..3f1c0e6 100755 --- a/build.sh +++ b/build.sh @@ -32,18 +32,13 @@ echo "Docker repository: $docker_repo." LATEST_RELEASE=`getVersionFromLatestRelease $source_repo` echo "Latest release is: $LATEST_RELEASE." -echo "::set-output name=latest_release::$LATEST_RELEASE" SEMVER=( ${LATEST_RELEASE//./ } ) MAJOR=${SEMVER[0]} MINOR=${SEMVER[0]}.${SEMVER[1]} PATCH=$LATEST_RELEASE -echo "::set-output name=major::$MAJOR" -echo "::set-output name=minor::$MINOR" -echo "::set-output name=patch::$PATCH" echo "latest,$MAJOR,$MINOR,$PATCH" > .tags -echo "::set-output name=tags::$(cat .tags)" RELEASE_URL=`getDownloadUrl` echo "URL of release is: $RELEASE_URL."