From 16b3af8892b56d206c95558cf341bb313342f13d Mon Sep 17 00:00:00 2001 From: "flow.gunso" Date: Mon, 18 Mar 2019 19:02:59 +0100 Subject: [PATCH 1/7] Add a failsafe script to import Seafile's APT key --- utils/build/import-seafile-apt-key.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 utils/build/import-seafile-apt-key.sh diff --git a/utils/build/import-seafile-apt-key.sh b/utils/build/import-seafile-apt-key.sh new file mode 100644 index 0000000..4818945 --- /dev/null +++ b/utils/build/import-seafile-apt-key.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Docker Seafile client, help you mount a Seafile library as a volume. +# Copyright (C) 2019, flow.gunso@gmail.com +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +not_imported=true +while $not_imported; do + apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8756C4F765C9AC3CB6B85D62379CE192D401AB61 + if [ $? -eq 0 ]; then + not_imported=false + else + sleep 5 + fi +done \ No newline at end of file From 4e1e559b08e2aeb1d78aad1a50f2e76561cdbbf9 Mon Sep 17 00:00:00 2001 From: "flow.gunso" Date: Mon, 18 Mar 2019 19:04:12 +0100 Subject: [PATCH 2/7] Add the file from @16b3af8892b56d206c95558cf341bb313342f13d, merge the apt key import with the packages installation --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index dc7a99f..830b31e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,12 +30,12 @@ COPY assets/supervisord.conf /.supervisord/ COPY assets/infinite-seaf-cli-start.sh / COPY entrypoint.sh / -# Install both seafile-cli and supervisord. -RUN apt-key adv \ - --keyserver hkp://keyserver.ubuntu.com:80 \ - --recv-keys 8756C4F765C9AC3CB6B85D62379CE192D401AB61 -RUN apt-get update ;\ +# Safely import Seafile APT key, then install both seafile-cli and supervisord. +COPY utils/build/import-seafile-apt-key.sh / +RUN /bin/bash /import-seafile-apt-key.sh ;\ + apt-get update ;\ apt-get install -o Dpkg::Options::="--force-confold" -y seafile-cli supervisor +RUN rm -f /import-seafile-apt-key.sh # Configure the user. ENV UNAME=seafuser From ca8ecfaeb455eecc1e77cbbe3071c9ab41a857ab Mon Sep 17 00:00:00 2001 From: "flow.gunso" Date: Mon, 18 Mar 2019 19:10:05 +0100 Subject: [PATCH 3/7] Add GPLv3 headers --- utils/publish/production.sh | 16 ++++++++++++++++ utils/publish/staging.sh | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/utils/publish/production.sh b/utils/publish/production.sh index 89eefc0..62d368f 100755 --- a/utils/publish/production.sh +++ b/utils/publish/production.sh @@ -1,5 +1,21 @@ #!/bin/bash +# Docker Seafile client, help you mount a Seafile library as a volume. +# Copyright (C) 2019, flow.gunso@gmail.com +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + # Restrict production build to tag matching MAJOR.MINOR.REVISION. if ! [[ "$CI_COMMIT_TAG" =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]; then echo "Version number must match major.minor.revision!" diff --git a/utils/publish/staging.sh b/utils/publish/staging.sh index 9d7735a..de1ba3c 100755 --- a/utils/publish/staging.sh +++ b/utils/publish/staging.sh @@ -1,5 +1,21 @@ #!/bin/bash +# Docker Seafile client, help you mount a Seafile library as a volume. +# Copyright (C) 2019, flow.gunso@gmail.com +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + # Just build and push as staging. docker build -t $CI_REGISTRY_IMAGE:staging . docker push $CI_REGISTRY_IMAGE:staging \ No newline at end of file From b107b9eaed3b8fc127f40115796b368d7bc79bdd Mon Sep 17 00:00:00 2001 From: "flow.gunso" Date: Mon, 18 Mar 2019 19:13:09 +0100 Subject: [PATCH 4/7] Add the ability to restrict builds to the latest, majors, minors and revisions version. --- utils/publish/production.sh | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/utils/publish/production.sh b/utils/publish/production.sh index 62d368f..8c3e6fb 100755 --- a/utils/publish/production.sh +++ b/utils/publish/production.sh @@ -22,6 +22,20 @@ if ! [[ "$CI_COMMIT_TAG" =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]; then exit 1 fi +# If no build indication was given, assume BUILD_LATEST. +# Most likely, this will only cover builds triggered from tag pushes. +if [ -z $BUILD_LATEST -o \ + -z $BUILD_MAJOR -o \ + -z $BUILD_MINOR -o \ + -z $BUILD_REVISION ]; then + BUILD_LATEST=true +fi + +# Cascade the builds by inheritance. +if [ $BUILD_LATEST ]; then BUILD_MAJOR=true; BUILD_MINOR=true; BUILD_REVISION=true; fi +if [ $BUILD_MAJOR ]; then BUILD_MINOR=true; BUILD_REVISION=true; fi +if [ $BUILD_MINOR ]; then BUILD_REVISION=true; fi + # Define MAJOR, MINOR and REVISION version numbers. MAJOR_NUMBER=$(echo "$CI_COMMIT_TAG" | awk -F \. {'print $1'}) MINOR_NUMBER=$(echo "$CI_COMMIT_TAG" | awk -F \. {'print $2'}) @@ -30,15 +44,15 @@ MAJOR=$MAJOR_NUMBER MINOR=$MAJOR.$MINOR_NUMBER REVISION=$MINOR.$REVISION_NUMBER -# Build. +# Always build with all tags, there's a single build anyway. docker build \ -t $CI_REGISTRY_IMAGE:latest \ -t $CI_REGISTRY_IMAGE:$MAJOR \ -t $CI_REGISTRY_IMAGE:$MINOR \ -t $CI_REGISTRY_IMAGE:$REVISION . -# And push. -docker push $CI_REGISTRY_IMAGE:latest -docker push $CI_REGISTRY_IMAGE:$MAJOR -docker push $CI_REGISTRY_IMAGE:$MINOR -docker push $CI_REGISTRY_IMAGE:$REVISION \ No newline at end of file +# Only push requested builds. +if [ $BUILD_LATEST ]; then docker push $CI_REGISTRY_IMAGE:latest; fi +if [ $BUILD_MAJOR ]; then docker push $CI_REGISTRY_IMAGE:$MAJOR; fi +if [ $BUILD_MINOR ]; then docker push $CI_REGISTRY_IMAGE:$MINOR; fi +if [ $BUILD_REVISION ]; then docker push $CI_REGISTRY_IMAGE:$REVISION; fi \ No newline at end of file From 2e2113b171f66ddba5c71a37a0b07e3198119e0e Mon Sep 17 00:00:00 2001 From: "flow.gunso" Date: Mon, 18 Mar 2019 19:28:25 +0100 Subject: [PATCH 5/7] Fix #1: add an Seafile APT key import failsafe --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8a0627..862bd01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +### [1.0.1] - 2019/03/18 +- Add failsafe when importing Seafile's APT-key # [1.0.0] - 2019/03/15 - Release to Docker Hub From 95bc41f6f8268f2ec03222b3723b5fb15e11e475 Mon Sep 17 00:00:00 2001 From: "flow.gunso" Date: Mon, 18 Mar 2019 19:28:56 +0100 Subject: [PATCH 6/7] Document changes for v1.0.1 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 862bd01..dd9f18c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### [1.0.1] - 2019/03/18 - Add failsafe when importing Seafile's APT-key +- Restrict production build to latest, majors, minors and revisions version, on-demand. # [1.0.0] - 2019/03/15 - Release to Docker Hub From 87577a1cca41566ef11a1d5411b3f0161b480f97 Mon Sep 17 00:00:00 2001 From: "flow.gunso" Date: Mon, 18 Mar 2019 19:30:02 +0100 Subject: [PATCH 7/7] Add the weekly/permanent builds, put v1.0.0 into permanent, set v1.0.1 as weeky and latest --- README.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c487633..80d8a25 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,25 @@ -[![1.0.0 status](https://gitlab.com/flwgns-docker/seafile-client/badges/1.0.0/pipeline.svg)](https://gitlab.com/flwgns-docker/seafile-client/commits/1.0.0) +[![1.0.1 status](https://gitlab.com/flwgns-docker/seafile-client/badges/1.0.1/pipeline.svg)](https://gitlab.com/flwgns-docker/seafile-client/commits/1.0.1) [![docker pulls](https://img.shields.io/docker/pulls/flowgunso/seafile-client.svg)](https://hub.docker.com/r/flowgunso/seafile-client) # Available tags -## Production stable release -[`1`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.0), -[`1.0`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.0), +Weekly stable release are built every Monday at 6AM UTC+2. +Permanent stable releases will not be built again. + +You can rely on the weekly stable releases. They are stable. + +## Weekly stable releases. +[`1`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.1), +[`1.0`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.1), +[`1.0.1`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.1), +[`latest`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.1) +(see tag/release [1.0.1](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.1)) + +## Permanent stable releases. [`1.0.0`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.0), -[`latest`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.0) (see tag/release [1.0.0](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.0)) -## Developmental releases +## Developmental releases. [`staging`](https://gitlab.com/flwgns-docker/seafile-client/tree/staging) (see branch [staging](https://gitlab.com/flwgns-docker/seafile-client/tree/staging))