Skip to content
Browse files

deploy target converted using prefix args for deploy variables

  • Loading branch information...
1 parent b183972 commit b6a1415d2241bbb95fee8418344529c2d1e8b565 @johnbender johnbender committed
Showing with 47 additions and 31 deletions.
  1. +13 −26 Makefile
  2. +11 −0 build/bin/config.sh
  3. +20 −5 build/bin/deploy.sh
  4. +3 −0 build/bin/deploy_nightlies.sh
View
39 Makefile
@@ -10,6 +10,11 @@ SED_INPLACE_EXT = "whyunowork"
deploy: VER = sed "s/v@VERSION/${VER_OFFICIAL} ${HEAD_SHA}/"
deploy: VER_MIN = "/*! jQuery Mobile v${VER_OFFICIAL} ${HEAD_SHA} jquerymobile.com | jquery.org/license */"
+# in build/bin/config.sh this setting will alter the variable definitions to match
+# the changes for the deploy target in the makefile. temp solution
+ARGS = IS_DEPLOY_TARGET=false
+deploy: ARGS = IS_DEPLOY_TARGET=true
+
# The output folder for the finished files
OUTPUT = compiled
@@ -39,14 +44,14 @@ init:
# Build and minify the CSS files
css: init
- @@bash build/bin/css.sh
+ @@${ARGS} bash build/bin/css.sh
# Build and minify the JS files
js: init
- @@bash build/bin/js.sh
+ @@${ARGS} bash build/bin/js.sh
docs: init js css
- @@bash build/bin/docs.sh
+ @@${ARGS} bash build/bin/docs.sh
# Output a message saying the process is complete
notify: init
@@ -55,7 +60,7 @@ notify: init
# Zip up the jQm files without docs
zip: init css js
- @@bash build/bin/zip.sh
+ @@${ARGS} bash build/bin/zip.sh
# -------------------------------------------------
#
@@ -64,37 +69,19 @@ zip: init css js
# -------------------------------------------------
# NOTE the clean (which removes previous build output) has been removed to prevent a gap in service
build_latest: css docs js zip
- @@bash build/bin/build_latest.sh
+ @@${ARGS} bash build/bin/build_latest.sh
# Push the latest git version to the CDN. This is done on a post commit hook
deploy_latest:
- @@bash build/bin/deploy_latest.sh
+ @@${ARGS} bash build/bin/deploy_latest.sh
# TODO target name preserved to avoid issues during refactor, latest -> deploy_latest
latest: build_latest deploy_latest
# Push the nightly backups. This is done on a server cronjob
deploy_nightlies:
- # Time to put these on the CDN
- @@scp -qr ${OUTPUT} jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/nightlies/$$(date "+%Y%m%d")
+ @@${ARGS} bash build/bin/deploy_nightlies.sh
# Deploy a finished release. This is manually done.
deploy: clean init css js docs zip
- # Deploying all the files to the CDN
- @@mkdir tmp
- @@cp -R ${OUTPUT} tmp/${VER_OFFICIAL}
- @@scp -qr tmp/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/
- @@rm -rf tmp/${VER_OFFICIAL}
- @@mv ${OUTPUT}/demos tmp/${VER_OFFICIAL}
- # Create the Demos/Docs/Tests/Tools for jQueryMobile.com
- # ... By first replacing the paths
- @@ # TODO update jQuery Version replacement on deploy
- @@find tmp/${VER_OFFICIAL} -type f \
- \( -name '*.html' -o -name '*.php' \) \
- -exec perl -pi -e \
- 's|src="(.*)${BASE_NAME}.js"|src="//code.jquery.com/mobile/${VER_OFFICIAL}/${NAME}.min.js"|g;s|href="(.*)${BASE_NAME}.css"|href="//code.jquery.com/mobile/${VER_OFFICIAL}/${NAME}.min.css"|g;s|src="(.*)jquery.js"|src="//code.jquery.com/jquery-1.7.1.min.js"|g' {} \;
- # ... So they can be copied to jquerymobile.com
- @@scp -qr tmp/* jqadmin@jquerymobile.com:/srv/jquerymobile.com/htdocs/demos/
- # Do some cleanup to wrap it up
- @@rm -rf tmp
- @@rm -rf ${OUTPUT}
+ @@${ARGS} bash build/bin/deploy.sh
View
11 build/bin/config.sh
@@ -43,3 +43,14 @@ RUN_JS='java -XX:ReservedCodeCacheSize=64m -classpath build/js.jar:build/google-
if [ -x $NODE ]; then
RUN_JS=${NODE}
fi
+
+if [ $IS_DEPLOY_TARGET = "true" ]; then
+ function ver {
+ sed "s/v@VERSION/${VER_OFFICIAL} ${HEAD_SHA}/"
+ }
+
+ VER_MIN="/*! jQuery Mobile v${VER_OFFICIAL} ${HEAD_SHA} jquerymobile.com | jquery.org/license !*/"
+ NAME="jquery.mobile-${VER_OFFICIAL}"
+ THEME_FILENAME="jquery.mobile.theme-${VER_OFFICIAL}"
+ STRUCTURE="jquery.mobile.structure-${VER_OFFICIAL}"
+fi
View
25 build/bin/deploy.sh
@@ -1,5 +1,20 @@
-VER='sed "s/v@VERSION/${VER_OFFICIAL} ${HEAD_SHA}/"'
-VER_MIN="/*! jQuery Mobile v${VER_OFFICIAL} ${HEAD_SHA} jquerymobile.com | jquery.org/license */"
-NAME="jquery.mobile-${VER_OFFICIAL}"
-THEME_FILENAME="jquery.mobile.theme-${VER_OFFICIAL}"
-STRUCTURE="jquery.mobile.structure-${VER_OFFICIAL}"
+source build/bin/config.sh
+
+# Deploying all the files to the CDN
+mkdir -p tmp
+cp -R $OUTPUT tmp/$VER_OFFICIAL
+# scp -qr tmp/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/
+rm -rf tmp/$VER_OFFICIAL
+mv $OUTPUT/demos tmp/$VER_OFFICIAL
+# Create the Demos/Docs/Tests/Tools for jQueryMobile.com
+# ... By first replacing the paths
+# TODO update jQuery Version replacement on deploy
+find tmp/$VER_OFFICIAL -type f \
+ \( -name '*.html' -o -name '*.php' \) \
+ -exec perl -pi -e \
+ "s|src=\"(.*)$BASE_NAME.js\"|src=\"//code.jquery.com/mobile/$VER_OFFICIAL/$NAME.min.js\"|g;s|href=\"(.*)$BASE_NAME.css\"|href=\"//code.jquery.com/mobile/$VER_OFFICIAL/$NAME.min.css\"|g;s|src=\"(.*)jquery.js\"|src=\"//code.jquery.com/jquery-1.7.1.min.js\"|g" {} \;
+# ... So they can be copied to jquerymobile.com
+# scp -qr tmp/* jqadmin@jquerymobile.com:/srv/jquerymobile.com/htdocs/demos/
+# Do some cleanup to wrap it up
+# rm -rf tmp
+# rm -rf $OUTPUT
View
3 build/bin/deploy_nightlies.sh
@@ -0,0 +1,3 @@
+source build/bin/config.sh
+
+scp -qr $OUTPUT jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/nightlies/$(date "+%Y%m%d")

0 comments on commit b6a1415

Please sign in to comment.
Something went wrong with that request. Please try again.