Skip to content
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

feat(ng-deploy): add option for buildTarget #2281

Merged
merged 3 commits into from
Jan 21, 2020
Merged

feat(ng-deploy): add option for buildTarget #2281

merged 3 commits into from
Jan 21, 2020

Conversation

wagnermaciel
Copy link
Contributor

Checklist

Description

Add an option for buildTarget so that any builder can be scheduled.

Code sample

ng deploy --buildTarget=project:browser:staging

or

"deploy": {
    "builder": "@angular/fire:deploy,
    "options": {
        "buildTarget": "project:browser:staging"
    }
}

@@ -33,12 +36,15 @@ export default createBuilder<any>(
context.target.project
);

const buildTarget = options.buildTarget || `build:${context.target.project}:production`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note

I'm not sure this is the best approach. Ideally ng add @angular/fire would automatically define project.architect.deploy.options.buildTarget in angular.json.

This could easily be done here schematics / ng-add.ts #L231.

Pros

We could make buildTarget required and make configuration more obvious for developers.

Cons

This could cause backwards compatibility issues.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, it should be automatically defined on ng add. However, backwards compatibility should be maintained ie a default fallback value.

@jamesdaniels
Copy link
Member

LGTM, will bring into the next release this week.

@jamesdaniels jamesdaniels merged commit 266f2ec into angular:master Jan 21, 2020
jamesdaniels added a commit that referenced this pull request Feb 2, 2020
Co-authored-by: James Daniels <james@jamesdaniels.net>
@jamesdaniels
Copy link
Member

This has been released in both 5.4 and 6.0-rc.0 FYI

@Splaktar
Copy link
Member

Thank you for adding this! It would be great to get some documentation for it in https://github.com/angular/angularfire/blob/master/docs/deploy/getting-started.md

@Splaktar
Copy link
Member

The description mentions using ng deploy --buildTarget=project:browser:staging, but I had to do the following to get this to work ng deploy --buildTarget=<workspace-project-name>:build:staging or ng deploy --buildTarget=<workspace-project-name>:build:production.

@mgechev
Copy link
Member

mgechev commented Feb 11, 2020

@Splaktar feel free to open a PR with your findings to update the docs. I'll be happy to review & merge.

@george43g
Copy link
Contributor

george43g commented Mar 29, 2020

The description mentions using ng deploy --buildTarget=project:browser:staging, but I had to do the following to get this to work ng deploy --buildTarget=<workspace-project-name>:build:staging or ng deploy --buildTarget=<workspace-project-name>:build:production.

This is correct - the original description has a mistake - it's projectName:build:target - (target is production, staging, etc...)

Also, I'm assuming projectName:build falls back to the default development build.
As far as I know, there aren't any docs at all describing this feature.

PS: I've added the ability to specify a firebase project deploy target in PR #2366

EDIT: I've committed a docs update to my last pull request describing these features/options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants