From d4835d5bfb82f57da26f74aaa98a59222451b56d Mon Sep 17 00:00:00 2001 From: "flow.gunso" Date: Tue, 19 Mar 2019 14:05:31 +0100 Subject: [PATCH 1/5] Restrict the staging CI to pushes --- utils/publish/staging.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/publish/staging.sh b/utils/publish/staging.sh index de1ba3c..b7261a2 100755 --- a/utils/publish/staging.sh +++ b/utils/publish/staging.sh @@ -16,6 +16,11 @@ # 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. +# Restrict to pipeline triggered by pushes. +if [ $CI_PIPELINE_SOURCE != "push" ]; then + echo "This must be only ran from pushes." +fi + +# 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 f9fd67b74507e656f5946849c8281a2b21661acb Mon Sep 17 00:00:00 2001 From: "flow.gunso" Date: Tue, 19 Mar 2019 14:25:16 +0100 Subject: [PATCH 2/5] Forgot to exit on non-push pipeline trigger --- utils/publish/staging.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/publish/staging.sh b/utils/publish/staging.sh index b7261a2..0c220cf 100755 --- a/utils/publish/staging.sh +++ b/utils/publish/staging.sh @@ -19,6 +19,7 @@ # Restrict to pipeline triggered by pushes. if [ $CI_PIPELINE_SOURCE != "push" ]; then echo "This must be only ran from pushes." + exit 1 fi # Build and push as staging. From 3cbb0192d030ceac947f3ffbf92a63dfec5777e1 Mon Sep 17 00:00:00 2001 From: "flow.gunso" Date: Tue, 19 Mar 2019 15:09:06 +0100 Subject: [PATCH 3/5] Restrict to pushed/triggered pipelines, force build targets on triggered pipelines --- utils/publish/production.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/utils/publish/production.sh b/utils/publish/production.sh index 6447f51..819e47a 100755 --- a/utils/publish/production.sh +++ b/utils/publish/production.sh @@ -22,13 +22,22 @@ 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 ] || \ - [ -z $BUILD_MAJOR ] || \ - [ -z $BUILD_MINOR ] || \ - [ -z $BUILD_REVISION ]; then +# When this stage is ran from 'push', the build target is BUILD_LATEST. +# When this stage is ran from 'trigger', the build target must be provided. +# Otherwise, stop the stage. +if [ $CI_PIPELINE_SOURCE == "push" ]; then BUILD_LATEST=true +elif [ $CI_PIPELINE_SOURCE == "trigger" ]; then + if [ -z $BUILD_LATEST ] || \ + [ -z $BUILD_MAJOR ] || \ + [ -z $BUILD_MINOR ] || \ + [ -z $BUILD_REVISION ]; then + echo "You must provide build targets to this stage when ran from Pipeline Triggers." + exit 1 + fi +else + echo "This stage is restricted to 'push' or 'trigger' Pipeline sources." + exit 1 fi # Cascade the builds by inheritance. From a7a460d0f2cb216ac958217d38d083b351a40466 Mon Sep 17 00:00:00 2001 From: "flow.gunso" Date: Tue, 19 Mar 2019 15:13:12 +0100 Subject: [PATCH 4/5] Document changes in revision v1.0.3 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e61f7f3..5998dde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### [1.0.3] - 2019/03/19 +- Restrict staging pipelines to pushed pipelines +- Restrict production pipelines to pushed and triggered pipelines +- Require a build target on triggered production pipelines ### [1.0.2] - 2019/03/18 - Fix a minor issue when testing for requested production build. ### [1.0.1] - 2019/03/18 From bab0796db030f750c27c081c18c9f8f3a49feebb Mon Sep 17 00:00:00 2001 From: "flow.gunso" Date: Tue, 19 Mar 2019 15:13:36 +0100 Subject: [PATCH 5/5] Push to revision v1.0.3 --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8c1e8fd..f001880 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![1.0.2 status](https://gitlab.com/flwgns-docker/seafile-client/badges/1.0.2/pipeline.svg)](https://gitlab.com/flwgns-docker/seafile-client/commits/1.0.2) +[![1.0.3 status](https://gitlab.com/flwgns-docker/seafile-client/badges/1.0.3/pipeline.svg)](https://gitlab.com/flwgns-docker/seafile-client/commits/1.0.3) [![docker pulls](https://img.shields.io/docker/pulls/flowgunso/seafile-client.svg)](https://hub.docker.com/r/flowgunso/seafile-client) # Available tags @@ -9,14 +9,16 @@ 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.2), -[`1.0`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.2), -[`1.0.2`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.2), -[`latest`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.2) -(see tag/release [1.0.2](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.2)) +[`1`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.3), +[`1.0`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.3), +[`1.0.3`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.3), +[`latest`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.3) +(see tag/release [1.0.3](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.3)) ## Permanent stable releases. -[`1.0.0`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.0), +[`1.0.2`](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.2) +(see tag/release [1.0.2](https://gitlab.com/flwgns-docker/seafile-client/tags/1.0.2)) +[`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.