From d4835d5bfb82f57da26f74aaa98a59222451b56d Mon Sep 17 00:00:00 2001 From: "flow.gunso" Date: Tue, 19 Mar 2019 14:05:31 +0100 Subject: [PATCH] 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