Skip to content

Commit

Permalink
build docfx site in e2e test (dotnet#7285)
Browse files Browse the repository at this point in the history
  • Loading branch information
superyyrrzz authored Apr 10, 2021
1 parent 3440854 commit e8b760c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
16 changes: 9 additions & 7 deletions tools/Deployment/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@ gulp.task("e2eTest:buildSeed", () => {
return Common.execAsync(path.resolve(config.docfx["exe"]), ["docfx.json"], config.docfx.docfxSeedHome);
});

gulp.task("e2eTest", gulp.series("e2eTest:restoreSeed", "e2eTest:buildSeed"));
gulp.task("e2eTest:buildDocfxSite", () => {
Guard.argumentNotNullOrEmpty(config.docfx.exe, "config.docfx.exe", "Can't find docfx.exe in configuration.");
Guard.argumentNotNullOrEmpty(config.docfx.docfxSeedHome, "config.docfx.docfxSeedHome", "Can't find docfx-seed in configuration.");

return Common.execAsync(path.resolve(config.docfx["exe"]), [path.resolve(config.docfx.docfxJson)]);
});

gulp.task("e2eTest", gulp.series("e2eTest:restoreSeed", "e2eTest:buildSeed", "e2eTest:buildDocfxSite"));

gulp.task("publish:azdevops-perf-login", () => {
return Common.execAsync(process.env.NUGETEXE, ["sources", "add", "-name", "docs-build-v2-perf", "-source", config.azdevops["perfUrl"], "-username", "anything", "-password", process.env.AZDEVOPSPAT]);
Expand Down Expand Up @@ -137,17 +144,12 @@ gulp.task("publish:nuget", () => {
gulp.task("updateGhPage", () => {
Guard.argumentNotNullOrEmpty(config.docfx.httpsRepoUrl, "config.docfx.httpsRepoUrl", "Can't find docfx repo url in configuration.");
Guard.argumentNotNullOrEmpty(config.docfx.siteFolder, "config.docfx.siteFolder", "Can't find docfx site folder in configuration.");
Guard.argumentNotNullOrEmpty(config.docfx.exe, "config.docfx.exe", "Can't find docfx exe in configuration.");
Guard.argumentNotNullOrEmpty(config.docfx.docfxJson, "config.docfx.docfxJson", "Can't find docfx.json in configuration.");
Guard.argumentNotNullOrEmpty(config.git.name, "config.git.name", "Can't find git user name in configuration");
Guard.argumentNotNullOrEmpty(config.git.email, "config.git.email", "Can't find git user email in configuration");
Guard.argumentNotNullOrEmpty(config.git.message, "config.git.message", "Can't find git commit message in configuration");
Guard.argumentNotNullOrEmpty(process.env.TOKEN, "process.env.TOKEN", "No github account token in the environment.");

let docfxExe = path.resolve(config.docfx.exe);
let docfxJson = path.resolve(config.docfx.docfxJson);

return Github.updateGhPagesAsync(config.docfx.httpsRepoUrl, config.docfx.siteFolder, docfxExe, docfxJson, config.git.name, config.git.email, config.git.message, process.env.TOKEN);
return Github.updateGhPagesAsync(config.docfx.httpsRepoUrl, config.docfx.siteFolder, config.git.name, config.git.email, config.git.message, process.env.TOKEN);
});

gulp.task("packAssetZip", () => {
Expand Down
6 changes: 0 additions & 6 deletions tools/Deployment/lib/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,18 @@ export class Github {
static async updateGhPagesAsync(
repoUrl: string,
siteFolder: string,
docfxExe: string,
docfxJson: string,
gitUserName: string,
gitUserEmail: string,
gitCommitMessage: string,
githubToken: string) {

Guard.argumentNotNullOrEmpty(repoUrl, "repoUrl");
Guard.argumentNotNullOrEmpty(siteFolder, "siteFolder");
Guard.argumentNotNullOrEmpty(docfxExe, "docfxExe");
Guard.argumentNotNullOrEmpty(docfxJson, "docfxJson");
Guard.argumentNotNullOrEmpty(gitUserName, "gitUserName");
Guard.argumentNotNullOrEmpty(gitUserEmail, "gitUserEmail");
Guard.argumentNotNullOrEmpty(gitCommitMessage, "gitCommitMessage");
Guard.argumentNotNullOrEmpty(githubToken, "githubToken");

await Common.execAsync(docfxExe, [docfxJson]);

let branch = "gh-pages";
let targetDir = "docfxsite";

Expand Down

0 comments on commit e8b760c

Please sign in to comment.