Merge branch 'staging'

This commit is contained in:
flow.gunso
2019-03-18 19:30:28 +01:00
6 changed files with 102 additions and 17 deletions

View File

@@ -1,3 +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 # [1.0.0] - 2019/03/15
- Release to Docker Hub - Release to Docker Hub

View File

@@ -30,12 +30,12 @@ COPY assets/supervisord.conf /.supervisord/
COPY assets/infinite-seaf-cli-start.sh / COPY assets/infinite-seaf-cli-start.sh /
COPY entrypoint.sh / COPY entrypoint.sh /
# Install both seafile-cli and supervisord. # Safely import Seafile APT key, then install both seafile-cli and supervisord.
RUN apt-key adv \ COPY utils/build/import-seafile-apt-key.sh /
--keyserver hkp://keyserver.ubuntu.com:80 \ RUN /bin/bash /import-seafile-apt-key.sh ;\
--recv-keys 8756C4F765C9AC3CB6B85D62379CE192D401AB61 apt-get update ;\
RUN apt-get update ;\
apt-get install -o Dpkg::Options::="--force-confold" -y seafile-cli supervisor apt-get install -o Dpkg::Options::="--force-confold" -y seafile-cli supervisor
RUN rm -f /import-seafile-apt-key.sh
# Configure the user. # Configure the user.
ENV UNAME=seafuser ENV UNAME=seafuser

View File

@@ -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) [![docker pulls](https://img.shields.io/docker/pulls/flowgunso/seafile-client.svg)](https://hub.docker.com/r/flowgunso/seafile-client)
# Available tags # Available tags
## Production stable release Weekly stable release are built every Monday at 6AM UTC+2.
[`1`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.0), Permanent stable releases will not be built again.
[`1.0`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.0),
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), [`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)) (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) [`staging`](https://gitlab.com/flwgns-docker/seafile-client/tree/staging)
(see branch [staging](https://gitlab.com/flwgns-docker/seafile-client/tree/staging)) (see branch [staging](https://gitlab.com/flwgns-docker/seafile-client/tree/staging))

View File

@@ -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 <https://www.gnu.org/licenses/>.
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

View File

@@ -1,11 +1,41 @@
#!/bin/bash #!/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 <https://www.gnu.org/licenses/>.
# Restrict production build to tag matching MAJOR.MINOR.REVISION. # Restrict production build to tag matching MAJOR.MINOR.REVISION.
if ! [[ "$CI_COMMIT_TAG" =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]; then if ! [[ "$CI_COMMIT_TAG" =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]; then
echo "Version number must match major.minor.revision!" echo "Version number must match major.minor.revision!"
exit 1 exit 1
fi 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. # Define MAJOR, MINOR and REVISION version numbers.
MAJOR_NUMBER=$(echo "$CI_COMMIT_TAG" | awk -F \. {'print $1'}) MAJOR_NUMBER=$(echo "$CI_COMMIT_TAG" | awk -F \. {'print $1'})
MINOR_NUMBER=$(echo "$CI_COMMIT_TAG" | awk -F \. {'print $2'}) MINOR_NUMBER=$(echo "$CI_COMMIT_TAG" | awk -F \. {'print $2'})
@@ -14,15 +44,15 @@ MAJOR=$MAJOR_NUMBER
MINOR=$MAJOR.$MINOR_NUMBER MINOR=$MAJOR.$MINOR_NUMBER
REVISION=$MINOR.$REVISION_NUMBER REVISION=$MINOR.$REVISION_NUMBER
# Build. # Always build with all tags, there's a single build anyway.
docker build \ docker build \
-t $CI_REGISTRY_IMAGE:latest \ -t $CI_REGISTRY_IMAGE:latest \
-t $CI_REGISTRY_IMAGE:$MAJOR \ -t $CI_REGISTRY_IMAGE:$MAJOR \
-t $CI_REGISTRY_IMAGE:$MINOR \ -t $CI_REGISTRY_IMAGE:$MINOR \
-t $CI_REGISTRY_IMAGE:$REVISION . -t $CI_REGISTRY_IMAGE:$REVISION .
# And push. # Only push requested builds.
docker push $CI_REGISTRY_IMAGE:latest if [ $BUILD_LATEST ]; then docker push $CI_REGISTRY_IMAGE:latest; fi
docker push $CI_REGISTRY_IMAGE:$MAJOR if [ $BUILD_MAJOR ]; then docker push $CI_REGISTRY_IMAGE:$MAJOR; fi
docker push $CI_REGISTRY_IMAGE:$MINOR if [ $BUILD_MINOR ]; then docker push $CI_REGISTRY_IMAGE:$MINOR; fi
docker push $CI_REGISTRY_IMAGE:$REVISION if [ $BUILD_REVISION ]; then docker push $CI_REGISTRY_IMAGE:$REVISION; fi

View File

@@ -1,5 +1,21 @@
#!/bin/bash #!/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 <https://www.gnu.org/licenses/>.
# Just build and push as staging. # Just build and push as staging.
docker build -t $CI_REGISTRY_IMAGE:staging . docker build -t $CI_REGISTRY_IMAGE:staging .
docker push $CI_REGISTRY_IMAGE:staging docker push $CI_REGISTRY_IMAGE:staging