-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deploy): allow gh-pages deploy to user/org page
- Loading branch information
1 parent
196855f
commit d6b78ea
Showing
3 changed files
with
45 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ describe('Acceptance: ng github-pages:deploy', function() { | |
let project = 'foo', | ||
initialBranch = 'master', | ||
branch = 'gh-pages', | ||
ghPagesBranch = 'gh-pages', | ||
message = 'new gh-pages version', | ||
remote = 'origin [email protected]:username/project.git (fetch)'; | ||
|
||
|
@@ -71,11 +72,11 @@ describe('Acceptance: ng github-pages:deploy', function() { | |
execStub.addExecSuccess('git status --porcelain') | ||
.addExecSuccess('git rev-parse --abbrev-ref HEAD', initialBranch) | ||
.addExecSuccess('git remote -v', remote) | ||
.addExecSuccess(`git checkout ${branch}`) | ||
.addExecSuccess(`git checkout ${ghPagesBranch}`) | ||
.addExecSuccess('git add .') | ||
.addExecSuccess(`git commit -m "${message}"`) | ||
.addExecSuccess(`git checkout ${initialBranch}`) | ||
.addExecSuccess(`git push origin ${branch}`) | ||
.addExecSuccess(`git push origin ${ghPagesBranch}:${ghPagesBranch}`) | ||
.addExecSuccess('git remote -v', remote); | ||
|
||
return ng(['github-pages:deploy', '--skip-build']) | ||
|
@@ -87,21 +88,21 @@ describe('Acceptance: ng github-pages:deploy', function() { | |
}); | ||
|
||
it('should deploy with changed defaults', function() { | ||
let branch = 'not-gh-pages', | ||
let userPageBranch = 'master', | ||
message = 'not new gh-pages version'; | ||
|
||
execStub.addExecSuccess('git status --porcelain') | ||
.addExecSuccess('git rev-parse --abbrev-ref HEAD', initialBranch) | ||
.addExecSuccess('git remote -v', remote) | ||
.addExecSuccess(`git checkout ${branch}`) | ||
.addExecSuccess(`git checkout ${ghPagesBranch}`) | ||
.addExecSuccess('git add .') | ||
.addExecSuccess(`git commit -m "${message}"`) | ||
.addExecSuccess(`git checkout ${initialBranch}`) | ||
.addExecSuccess(`git push origin ${branch}`) | ||
.addExecSuccess(`git push origin ${userPageBranch}:${userPageBranch}`) | ||
.addExecSuccess('git remote -v', remote); | ||
|
||
return ng(['github-pages:deploy', '--skip-build', `--message=${message}`, | ||
`--branch=${branch}`]) | ||
'--user-page']) | ||
.then(() => { | ||
let indexHtml = path.join(process.cwd(), 'index.html'); | ||
return fsReadFile(indexHtml, 'utf8'); | ||
|
@@ -113,16 +114,16 @@ describe('Acceptance: ng github-pages:deploy', function() { | |
execStub.addExecSuccess('git status --porcelain') | ||
.addExecSuccess('git rev-parse --abbrev-ref HEAD', initialBranch) | ||
.addExecSuccess('git remote -v', remote) | ||
.addExecError(`git checkout ${branch}`) | ||
.addExecSuccess(`git checkout --orphan ${branch}`) | ||
.addExecError(`git checkout ${ghPagesBranch}`) | ||
.addExecSuccess(`git checkout --orphan ${ghPagesBranch}`) | ||
.addExecSuccess('git rm --cached -r .') | ||
.addExecSuccess('git add .gitignore') | ||
.addExecSuccess('git clean -f -d') | ||
.addExecSuccess(`git commit -m \"initial ${branch} commit\"`) | ||
.addExecSuccess(`git commit -m \"initial ${ghPagesBranch} commit\"`) | ||
.addExecSuccess('git add .') | ||
.addExecSuccess(`git commit -m "${message}"`) | ||
.addExecSuccess(`git checkout ${initialBranch}`) | ||
.addExecSuccess(`git push origin ${branch}`) | ||
.addExecSuccess(`git push origin ${ghPagesBranch}:${ghPagesBranch}`) | ||
.addExecSuccess('git remote -v', remote); | ||
|
||
return ng(['github-pages:deploy', '--skip-build']) | ||
|
@@ -143,11 +144,11 @@ describe('Acceptance: ng github-pages:deploy', function() { | |
.addExecSuccess('git remote -v', noRemote) | ||
.addExecSuccess(`git remote add origin [email protected]:${username}/${project}.git`) | ||
.addExecSuccess(`git push -u origin ${initialBranch}`) | ||
.addExecSuccess(`git checkout ${branch}`) | ||
.addExecSuccess(`git checkout ${ghPagesBranch}`) | ||
.addExecSuccess('git add .') | ||
.addExecSuccess(`git commit -m "${message}"`) | ||
.addExecSuccess(`git checkout ${initialBranch}`) | ||
.addExecSuccess(`git push origin ${branch}`) | ||
.addExecSuccess(`git push origin ${ghPagesBranch}:${ghPagesBranch}`) | ||
.addExecSuccess('git remote -v', remote); | ||
|
||
var httpsStub = sinon.stub(https, 'request', httpsRequestStubFunc); | ||
|
@@ -246,7 +247,7 @@ describe('Acceptance: ng github-pages:deploy', function() { | |
execStub.addExecSuccess('git status --porcelain') | ||
.addExecSuccess('git rev-parse --abbrev-ref HEAD', initialBranch) | ||
.addExecSuccess('git remote -v', remote) | ||
.addExecSuccess(`git checkout ${branch}`) | ||
.addExecSuccess(`git checkout ${ghPagesBranch}`) | ||
.addExecSuccess('git add .') | ||
.addExecSuccess(`git commit -m "${message}"`) | ||
.addExecError(`git checkout ${initialBranch}`, 'error: cannot stat \'src/client\': Permission denied'); | ||
|