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 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. 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. diff --git a/utils/publish/staging.sh b/utils/publish/staging.sh index de1ba3c..0c220cf 100755 --- a/utils/publish/staging.sh +++ b/utils/publish/staging.sh @@ -16,6 +16,12 @@ # 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." + exit 1 +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