From ef7a67897a4f1672dcbdc572688fab6e390f3cb0 Mon Sep 17 00:00:00 2001
From: Piotr Zurek
Date: Wed, 27 Feb 2019 16:03:12 +1300
Subject: [PATCH] Update entrypoint.sh
---
entrypoint.sh | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/entrypoint.sh b/entrypoint.sh
index af2657d..e1ae580 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -2,18 +2,24 @@
set -e
+// go level up from the workspace
cd ..
+// configure Git
git config --global user.email $GIT_USER_EMAIL
git config --global user.name $GIT_USER_NAME
+// clone the stoplight repository
git clone https://$STOPLIGHT_USERNAME:$STOPLIGHT_GIT_TOKEN@git.stoplight.io/$STOPLIGHT_ORG/$STOPLIGHT_PROJECT.git
-git checkout version/1.0
-cp ./workspace/$HUB_FILEPATH ./$STOPLIGHT_PROJECT/$HUB_FILEPATH
+// go into the stoplight repo and checkout the "version" branch
+cd $STOPLIGHT_PROJECT
+git checkout version/1.0
-cd workspace
+// copy the hub file from workspace to stoplight repo
+cp ../workspace/$HUB_FILEPATH $HUB_FILEPATH
+// add, commit and push the stoplight repo
git add -A
git commit -m "hub file update from GitHub"
git push