aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/deploy-ci.sh
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2018-08-31 23:25:18 +0200
committerGravatar Johannes Christ <[email protected]>2018-08-31 23:25:18 +0200
commit1d1ffe6b0d924760e1e64cf6485f46572129b131 (patch)
tree65cd8b71bd7a18b44ea417c0cf6ed76a87a8754e /scripts/deploy-ci.sh
parentRemove unused files. (diff)
parentInstall `flake8` on system. (diff)
Merge branch 'django' into django+documentation-link-api
Diffstat (limited to 'scripts/deploy-ci.sh')
-rwxr-xr-xscripts/deploy-ci.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/deploy-ci.sh b/scripts/deploy-ci.sh
new file mode 100755
index 00000000..f5c965ca
--- /dev/null
+++ b/scripts/deploy-ci.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Build and deploy on master branch
+echo "Connecting to docker hub"
+echo "$GITLAB_DOCKER_PASSWORD" | docker login --username "$GITLAB_DOCKER_USERNAME" --password-stdin registry.gitlab.com
+
+changed_lines=$(git diff HEAD~1 HEAD docker/base.Dockerfile | wc -l)
+
+if [ $changed_lines != '0' ]; then
+ echo "base.Dockerfile was changed"
+
+ echo "Building CI container"
+ docker build -t registry.gitlab.com/python-discord/projects/site/django-base:latest -f docker/base.Dockerfile .
+
+ echo "Pushing image to GitLab registry"
+ docker push registry.gitlab.com/python-discord/projects/site/django-base:latest
+else
+ echo "base.Dockerfile was not changed, not building"
+fi