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

The specified command ("deploy") is invalid. #65

Closed
oleersoy opened this issue Aug 16, 2019 · 10 comments
Closed

The specified command ("deploy") is invalid. #65

oleersoy opened this issue Aug 16, 2019 · 10 comments

Comments

@oleersoy
Copy link

oleersoy commented Aug 16, 2019

Hi,
Thanks for making this awesome tool! I'm trying out the deploy command here is my sequence:

+ [email protected]
added 14 packages from 7 contributors and audited 17167 packages in 14.941s
found 0 vulnerabilities

Installed packages for tooling via npm.
UPDATE angular.json (3790 bytes)
ole@mkt:~/ghtest$ ng deploy --repo=ng deploy --repo=https://github.com/oleersoy/ghtest.git

The specified command ("deploy") is invalid. For a list of available options,
run "ng help".

Did you mean "doc"?
ole@mkt:~/ghtest$ 

Thoughts?

@fmalcher
Copy link
Member

It looks like you have installed an Angular CLI version smaller than v8.3.0-next.0.
The deploy feature came in in v8.3.0-next.0 and will finally be released in 8.3.0 in a few days.

Can you please check your version with ng version?

@oleersoy
Copy link
Author

oleersoy commented Aug 16, 2019

Hello @fmalcher . Thanks for the heads up. It's fixed now and I ran it like this:

ole@mkt:~/ghtest$ ng deploy --repo=https://github.com/oleersoy/ghtest.git
📦 Building "ghtest". Configuration: "production".

chunk {0} runtime-es2015.24b02acc1f369d9b9f37.js (runtime) 2.83 kB [entry] [rendered]
chunk {1} main-es2015.29c511e263de0b2dd44c.js (main) 368 kB [initial] [rendered]
chunk {2} polyfills-es2015.fd917e7c3ed57f282ee5.js (polyfills) 64.3 kB [initial] [rendered]
chunk {3} polyfills-es5-es2015.f24fb8cb85b392c952f0.js (polyfills-es5) 211 kB [initial] [rendered]
chunk {4} styles.09e2c710755c8867a460.css (styles) 0 bytes [initial] [rendered]
Date: 2019-08-16T17:00:14.955Z - Hash: 2e583cece561af320075 - Time: 33514ms
Generating ES5 bundles for differential loading...
ES5 bundle generation complete.
Username for 'https://github.com': oleersoy
Password for 'https://[email protected]': 
🚀 Successfully published via angular-cli-ghpages! Have a nice day!

Except I don't see the gh-pages branch in the repo:

https://github.com/oleersoy/ghtest

It looks like it's empty still. Also do you know if it's possible for angular-cli-ghpages to use the my ssh keys for the push (With a configuration option perhaps) or by using git for the protocol like this:

ng deploy [email protected]:oleersoy/ghtest.git

@fmalcher
Copy link
Member

I just tried this out with a new app and a new GitHub repo and it worked correctly.
Can you please try it again?

If it doesn't work, can you please provide some more details about your system? Best would be the complete output from ng version.

Also do you know if it's possible for angular-cli-ghpages to use the my ssh keys for the push (With a configuration option perhaps) or by using git for the protocol like this

You can also use the SSH scheme for the --repo option. It will then automatically use your SSH keys as usual.
There is no configuration option for providing SSH keys explicitly and we recommend using a GH_TOKEN when you publish from your CI pipeline.

@oleersoy
Copy link
Author

oleersoy commented Aug 16, 2019

OK I tried it again with the https based URL and with that I had to type in the user name and password (In other words I just repeated my earlier steps). When I do this it says it works, but nothing shows up in the repo.

Then I tried the git based protocol, and this works. I now have files in the repo on the gh-pages branch:

https://github.com/oleersoy/ghtest

They are not rendering when visiting the github.io site though:

https://oleersoy.github.io/ghtest/

I think it's because the base element is rendered like this:

<base href="/">

Is it supposed to be

<base href="https://github.com/oleersoy/ghtest">

My NG Version Info:

ole@mkt:~/ghtest$ ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 8.3.0-rc.0
Node: 12.6.0
OS: linux x64
Angular: 8.2.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.0-rc.0
@angular-devkit/build-angular     0.803.0-rc.0
@angular-devkit/build-optimizer   0.803.0-rc.0
@angular-devkit/build-webpack     0.803.0-rc.0
@angular-devkit/core              8.3.0-rc.0
@angular-devkit/schematics        8.3.0-rc.0
@angular/cli                      8.3.0-rc.0
@ngtools/webpack                  8.3.0-rc.0
@schematics/angular               8.3.0-rc.0
@schematics/update                0.803.0-rc.0
rxjs                              6.4.0
typescript                        3.5.3
webpack                           4.39.2

@fmalcher
Copy link
Member

In the README you will find information on how to set the base href correctly.

@oleersoy
Copy link
Author

OH - OK - Got it - I thought the base href was the same regardless of whether we were using a custom domain or not. I see that we have to provide the cname option now:

ng deploy --cname=example.org

Thanks again for all your help. This tool totally rocks!!

@oleersoy
Copy link
Author

Just curious whether it would be a good idea to derive the base href from the repo if the --cname option is not specfiied?

@oleersoy
Copy link
Author

oleersoy commented Aug 17, 2019

I tried running it with the cname option just now and it does not appear that it is over writing the previous commit:

ole@mkt:~/ghtest$ ng deploy --cname=ghtest.fireflysemantics.com
📦 Building "ghtest". Configuration: "production".

chunk {0} runtime-es2015.24b02acc1f369d9b9f37.js (runtime) 2.83 kB [entry] [rendered]
chunk {1} main-es2015.29c511e263de0b2dd44c.js (main) 368 kB [initial] [rendered]
chunk {2} polyfills-es2015.fd917e7c3ed57f282ee5.js (polyfills) 64.3 kB [initial] [rendered]
chunk {3} polyfills-es5-es2015.f24fb8cb85b392c952f0.js (polyfills-es5) 211 kB [initial] [rendered]
chunk {4} styles.09e2c710755c8867a460.css (styles) 0 bytes [initial] [rendered]
Date: 2019-08-17T02:55:36.815Z - Hash: 2e583cece561af320075 - Time: 25629ms
Generating ES5 bundles for differential loading...
ES5 bundle generation complete.
CNAME file created
🚀 Successfully published via angular-cli-ghpages! Have a nice day!

https://github.com/oleersoy/ghtest

@JohannesHoppe
Copy link
Member

Hi, thanks for the feedback.

At the moment the history is preseved. We have a feature request to change that: #46

Just curious whether it would be a good idea to derive the base href from the repo if the --cname option is not specfiied?

Indeed, this feature is the next thing that we will implement! 😃

@JohannesHoppe
Copy link
Member

see #66

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

No branches or pull requests

3 participants