Skip to content

feat(deploy): add custom-domain support for gh-pages deployment (#1781) #3392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 13, 2017
Merged

feat(deploy): add custom-domain support for gh-pages deployment (#1781) #3392

merged 1 commit into from
Jan 13, 2017

Conversation

austingreendev
Copy link
Contributor

feature for (#1781)

This PR adds the new --custom-domain flag to the github-pages:deploy command to create a CNAME file to support Github Pages custom domains.

I am looking for some guidance on the testing for this since github-pages-deploy.spec.js doesn't contain any logic/acceptance criteria to ensure that certain files are created. It is only checking
git related commands and http requests.

Currently the similar method createNotFoundPage() is not tested either. Either way, all tests and linting pass. I also have some spare domains and tested that Github's DNS picks the CNAME up with a new branch correctly.

@austingreendev austingreendev changed the title feat(Deploy): add custom-domain support for gh-pages deployment (#1781) feat(deploy): add custom-domain support for gh-pages deployment (#1781) Dec 5, 2016
@hansl
Copy link
Contributor

hansl commented Dec 6, 2016

@filipesilva could you review this please?

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@googlebot googlebot added cla: no and removed cla: yes labels Dec 9, 2016
@hansl
Copy link
Contributor

hansl commented Dec 9, 2016

The CLA is good, we just merged the master branch.

@hansl
Copy link
Contributor

hansl commented Dec 9, 2016

Seems I cannot add reviewers to this PR, not sure why.

@filipesilva
Copy link
Contributor

@Austin94 it is true we don't have tests for createNotFoundPage(). That's because most of what goes within the github-pages:deploy command happens in a separate branch, and should be an atomic operation.

The current branch should have no changes and that makes it hard to make an e2e test for it. The current test mostly mocks exec calls.

Adding a test to verify these two calls would require a way to interrupt (and resume) the command, which would require a lot of work. This is also a feature I want to re-do from scratch in the coming months as it's very complex and hard to test currently.

So personally I'm fine with not having these two function calls not tested and letting the PR in, as the changes are not breaking. @hansl if you disagree let me know.

@austingreendev
Copy link
Contributor Author

@filipesilva that makes perfect sense to me. Thanks for taking the time to explain the reasoning behind it.

@@ -76,6 +78,11 @@ const githubPagesDeployCommand = Command.extend({
type: String,
default: null,
aliases: ['bh']
}, {
name: 'custom-domain',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have an alias cd for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added!

@googlebot
Copy link

CLAs look good, thanks!

@hansl
Copy link
Contributor

hansl commented Jan 12, 2017

I'll merge this when the PR is rebased and the conflicts resolved.

@austingreendev
Copy link
Contributor Author

austingreendev commented Jan 12, 2017 via email

Creates CNAME file if --custom-domain flag is provided.

addresses (#1781)
@austingreendev
Copy link
Contributor Author

Ok, everything should be playing nicely now. The addition of the *.run.ts file made me move the logic around some.

@filipesilva filipesilva merged commit a54bc16 into angular:master Jan 13, 2017
@filipesilva
Copy link
Contributor

@Austin94 cheers for adding this!

MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this pull request Feb 9, 2017
…lar#1781) (angular#3392)

Creates CNAME file if --custom-domain flag is provided.

addresses (angular#1781)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants