Merge branch 'staging'

This commit is contained in:
flow.gunso
2019-03-19 15:15:43 +01:00
4 changed files with 35 additions and 14 deletions

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -16,6 +16,12 @@
# 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.
# 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