-
Notifications
You must be signed in to change notification settings - Fork 1.3k
packaging: build and bundle UI using npm in deb and rpm packages #4605
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
Changes from all commits
047e898
0303504
be8839a
b5a92d6
f06445b
c6775b0
b668a9c
ca3dc01
a0965c5
0d2258b
23c5dab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| /etc/cloudstack/ui/config.json | ||
| /usr/share/cloudstack-ui/* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,6 +93,20 @@ override_dh_auto_install: | |
| install -m0644 packaging/systemd/$(PACKAGE)-management.service debian/$(PACKAGE)-management/lib/systemd/system/$(PACKAGE)-management.service | ||
| install -m0644 packaging/systemd/$(PACKAGE)-management.default $(DESTDIR)/$(SYSCONFDIR)/default/$(PACKAGE)-management | ||
|
|
||
| # cloudstack-ui | ||
| mkdir $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/ui | ||
| mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-ui | ||
| cd ui && npm install && npm run build && cd .. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This assumes that npn is available on the system. However, that's not a guarantee. The .deb (and .rpm) should have a build depends on 'npm'
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that adds a dependency much like jdk or mvn. I've added nodejs-12 (lts) in the container images that are used to build packages by blueorangutan. https://hub.docker.com/u/bhaisaab
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem is that nodejs may not be available in default/main repo of the distros. Should we document it on docs and install.md?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rhtyd this looks like a good point to be documented indeed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
No, we should require it in the .spec and control file as a hard requirement. The build will fail without those, so it shouldn't even start to build. The control and .spec file should exactly specify what is needed to build the packages. Without those dependencies the build should not initiate
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added, but that won't be satisfied automatically chances are somebody will install older version of nodejs. |
||
| cp -r ui/dist/config.json $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/ui/ | ||
| cp -r ui/dist/* $(DESTDIR)/usr/share/$(PACKAGE)-ui/ | ||
| rm -f $(DESTDIR)/usr/share/$(PACKAGE)-ui/config.json | ||
| ln -s /$(SYSCONFDIR)/$(PACKAGE)/ui/config.json $(DESTDIR)/usr/share/$(PACKAGE)-ui/config.json | ||
| # copy ui to cloudstack-management | ||
| cp -r ui/dist/config.json $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/ | ||
| cp -r ui/dist/* $(DESTDIR)/usr/share/$(PACKAGE)-management/webapp/ | ||
| rm -f $(DESTDIR)/usr/share/$(PACKAGE)-management/webapp/config.json | ||
| ln -s /$(SYSCONFDIR)/$(PACKAGE)/management/config.json $(DESTDIR)/usr/share/$(PACKAGE)-management/webapp/config.json | ||
|
|
||
| # cloudstack-common | ||
| mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-common | ||
| mkdir $(DESTDIR)/usr/share/$(PACKAGE)-common/scripts | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want users to be able to install just the cloudstack-ui package? If so, maybe we need to specify the actual dependencies needed for just running the UI.
Would that be cloudstack-common or is that not even needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is based on the feedback on the ML - people may just want the UI to be say hosted by nginx. One way was to ship archive, the other to just introduce a new pkg that installs it at a specific location (not in cloudstack-managment pkg, which gets UI by default for backward compatibility)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends: ${misc:Depends}That might generate a long list of dependencies for the cloudstack-ui package which aren't needed at all.
Therefor we might want to compile the list manually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix it