소스 검색

Added script to push premium resources to sandbox (#5196)

Jason Crist 3 년 전
부모
커밋
7e0d5a4297
2개의 변경된 파일22개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      package.json
  2. 21 0
      theme-utils.mjs

+ 1 - 0
package.json

@@ -21,6 +21,7 @@
 		"deploy:version-bump": "node ./theme-utils.mjs version-bump-themes",
 		"deploy:version-bump": "node ./theme-utils.mjs version-bump-themes",
 		"deploy:push:all": "node ./theme-utils.mjs push-to-sandbox",
 		"deploy:push:all": "node ./theme-utils.mjs push-to-sandbox",
 		"deploy:push:changes": "node ./theme-utils.mjs push-changes-to-sandbox",
 		"deploy:push:changes": "node ./theme-utils.mjs push-changes-to-sandbox",
+		"deploy:push:premium": "node ./theme-utils.mjs push-premium-to-sandbox",
 		"deploy:git": "node ./theme-utils.mjs push-button-deploy-git",
 		"deploy:git": "node ./theme-utils.mjs push-button-deploy-git",
 		"deploy:svn": "node ./theme-utils.mjs push-button-deploy-svn",
 		"deploy:svn": "node ./theme-utils.mjs push-button-deploy-svn",
 		"deploy:preview": "node ./theme-utils.mjs deploy-preview",
 		"deploy:preview": "node ./theme-utils.mjs deploy-preview",

+ 21 - 0
theme-utils.mjs

@@ -21,6 +21,7 @@ const directoriesToIgnore = [ 'variations', 'videomaker', 'videomaker-white' ];
 		case "clean-all-sandbox-svn": return cleanAllSandboxSvn();
 		case "clean-all-sandbox-svn": return cleanAllSandboxSvn();
 		case "push-to-sandbox": return pushToSandbox();
 		case "push-to-sandbox": return pushToSandbox();
 		case "push-changes-to-sandbox": return pushChangesToSandbox();
 		case "push-changes-to-sandbox": return pushChangesToSandbox();
+		case "push-premium-to-sandbox": return pushPremiumToSandbox();
 		case "version-bump-themes": return versionBumpThemes();
 		case "version-bump-themes": return versionBumpThemes();
 		case "land-diff-git": return landChangesGit(args?.[1]);
 		case "land-diff-git": return landChangesGit(args?.[1]);
 		case "land-diff-svn": return landChangesSvn(args?.[1]);
 		case "land-diff-svn": return landChangesSvn(args?.[1]);
@@ -557,6 +558,26 @@ function pushToSandbox() {
 	`);
 	`);
 }
 }
 
 
+/*
+  Push exactly what is here (all files) up to the sandbox (with the exclusion of files noted in .sandbox-ignore)
+  This pushes only the folders noted as "premiumThemes" into the premium themes directory.
+
+  This is the only part of the deploy process that is automated; the rest must be done manually including:
+   * Creating a Phabricator Diff
+   * Landing (comitting) the change
+   * Deploying the theme
+   * Triggering the .zip builds
+*/
+function pushPremiumToSandbox() {
+	const premiumThemes = [
+		'videomaker',
+		'videomaker-white'
+	]
+	executeCommand(`
+		rsync -av --no-p --no-times --exclude-from='.sandbox-ignore' ./${premiumThemes.join(' ./')} wpcom-sandbox:${sandboxRootFolder}/wp-content/themes/premium/
+	`, true);
+}
+
 /*
 /*
   Push only (and every) change since the point-of-diversion from /trunk
   Push only (and every) change since the point-of-diversion from /trunk
   Remove files from the sandbox that have been removed since the last deployed hash
   Remove files from the sandbox that have been removed since the last deployed hash