Selaa lähdekoodia

Since Makefile no longer handles deploy, variables need to be placed in dedicated deploy script

Kevin van Zonneveld 9 vuotta sitten
vanhempi
commit
86ba32b6a7
2 muutettua tiedostoa jossa 13 lisäystä ja 13 poistoa
  1. 1 4
      Makefile
  2. 12 9
      bin/website-deploy

+ 1 - 4
Makefile

@@ -1,7 +1,4 @@
-SHELL          := /usr/bin/env bash
-ghpages_repo   := "transloadit/uppy"
-ghpages_branch := "gh-pages"
-ghpages_url    := "git@github.com:$(ghpages_repo).git"
+SHELL := /usr/bin/env bash
 
 .PHONY: web-install
 web-install:

+ 12 - 9
bin/website-deploy

@@ -1,7 +1,10 @@
 #!/bin/bash
+ghpages_repo=${GHPAGES_REPO:-"transloadit/uppy"}
+ghpages_branch=${GHPAGES_BRANCH:-"gh-pages"}
+ghpages_url=${GHPAGES_URL:-"git@github.com:${ghpages_repo}.git"}
 
 echo "--> Deploying to GitHub pages.."
-mkdir -p /tmp/deploy-$(ghpages_repo)
+mkdir -p /tmp/deploy-${ghpages_repo}
 
 # Custom steps
 rsync \
@@ -16,14 +19,14 @@ rsync \
   --no-group \
   --no-motd \
   --no-owner \
-./website/public/ /tmp/deploy-$(ghpages_repo)
+./website/public/ /tmp/deploy-${ghpages_repo}
 
-echo 'This branch is just a deploy target. Do not edit. You changes will be lost.' > /tmp/deploy-$(ghpages_repo)/README.md
+echo 'This branch is just a deploy target. Do not edit. You changes will be lost.' > /tmp/deploy-${ghpages_repo}/README.md
 
-cd /tmp/deploy-$(ghpages_repo) \
-  && git init && git checkout -B $(ghpages_branch) && git add --all . \
-  && git commit -nm "Update $(ghpages_repo) website by $${USER}" \
-  && (git remote add origin $(ghpages_url)|| true)  \
-  && git push origin $(ghpages_branch):refs/heads/$(ghpages_branch) --force
+cd /tmp/deploy-${ghpages_repo} \
+  && git init && git checkout -B ${ghpages_branch} && git add --all . \
+  && git commit -nm "Update ${ghpages_repo} website by $${USER}" \
+  && (git remote add origin ${ghpages_url}|| true)  \
+  && git push origin ${ghpages_branch}:refs/heads/${ghpages_branch} --force
 
-rm -rf /tmp/deploy-$(ghpages_repo)
+rm -rf /tmp/deploy-${ghpages_repo}