|
@@ -4,8 +4,8 @@ import runci.Config.*;
|
|
|
import runci.System.*;
|
|
|
import sys.io.File;
|
|
|
import sys.FileSystem;
|
|
|
-
|
|
|
-import haxe.Template;
|
|
|
+import haxe.*;
|
|
|
+import haxe.io.*;
|
|
|
using StringTools;
|
|
|
|
|
|
class Deployment {
|
|
@@ -90,8 +90,7 @@ class Deployment {
|
|
|
|
|
|
static function isDeployApiDocsRequired () {
|
|
|
return gitInfo.branch == "development" &&
|
|
|
- Sys.getEnv("DEPLOY_API_DOCS") != null &&
|
|
|
- Sys.getEnv("deploy_key_decrypt") != null;
|
|
|
+ Sys.getEnv("DEPLOY_API_DOCS") != null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -99,12 +98,19 @@ class Deployment {
|
|
|
*/
|
|
|
|
|
|
static function deployApiDoc():Void {
|
|
|
- // setup deploy_key
|
|
|
- runCommand("openssl aes-256-cbc -k \"$deploy_key_decrypt\" -in extra/deploy_key.enc -out extra/deploy_key -d");
|
|
|
- runCommand("chmod 600 extra/deploy_key");
|
|
|
- runCommand("ssh-add extra/deploy_key");
|
|
|
-
|
|
|
- runCommand("make", ["-s", "deploy_doc"]);
|
|
|
+ changeDirectory(repoDir);
|
|
|
+ File.saveContent("extra/doc/info.json", Json.stringify({
|
|
|
+ "commit": gitInfo.commit,
|
|
|
+ "branch": gitInfo.branch,
|
|
|
+ }));
|
|
|
+ switch (Sys.getEnv("GHP_REMOTE")) { // should be in the form of https://[email protected]/account/repo.git
|
|
|
+ case null:
|
|
|
+ infoMsg('Missing GHP_REMOTE, skip api doc deploy.');
|
|
|
+ case remoteRepo:
|
|
|
+ var localRepo = "extra/api.haxe.org";
|
|
|
+ runCommand("git", ["clone", remoteRepo, localRepo]);
|
|
|
+ runCommand("haxe", ["--cwd", localRepo, "--run", "ImportXml", FileSystem.absolutePath("extra/doc")]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -304,16 +310,15 @@ class Deployment {
|
|
|
|
|
|
static public function deploy():Void {
|
|
|
var doDocs = isDeployApiDocsRequired();
|
|
|
- var doNightlies = isDeployNightlies(),
|
|
|
- doInstaller = doNightlies && shouldDeployInstaller();
|
|
|
+ var doNightlies = isDeployNightlies();
|
|
|
+ var doInstaller = doNightlies && shouldDeployInstaller();
|
|
|
|
|
|
if (doDocs || doNightlies) {
|
|
|
changeDirectory(repoDir);
|
|
|
if (doDocs) {
|
|
|
if (systemName != 'Windows') {
|
|
|
// generate doc
|
|
|
- runCommand("make", ["-s", "install_dox"]);
|
|
|
- runCommand("make", ["-s", "package_doc"]);
|
|
|
+ runCommand("make", ["xmldoc"]);
|
|
|
// deployBintray();
|
|
|
deployApiDoc();
|
|
|
// disable deployment to ppa:haxe/snapshots for now
|
|
@@ -322,11 +327,6 @@ class Deployment {
|
|
|
}
|
|
|
}
|
|
|
if (doNightlies) {
|
|
|
- if (doInstaller && !doDocs && systemName != 'Windows') {
|
|
|
- // generate doc
|
|
|
- runCommand("make", ["-s", "install_dox"]);
|
|
|
- runCommand("make", ["-s", "package_doc"]);
|
|
|
- }
|
|
|
deployNightlies(doInstaller);
|
|
|
}
|
|
|
}
|