Skip to content

Commit

Permalink
Add ui plugin installation as an option
Browse files Browse the repository at this point in the history
  • Loading branch information
wjun committed Aug 27, 2018
1 parent 37b4a5a commit c33d39d
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 17 deletions.
17 changes: 14 additions & 3 deletions installer/build/scripts/upgrade/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ DESTROY_ENABLED=""
MANUAL_DISK_MOVE=""
EMBEDDED_PSC=""
INSECURE_SKIP_VERIFY=""
UPGRADE_UI_PLUGIN=""

TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S %z %Z")
export REDIRECT_ENABLED=0
Expand Down Expand Up @@ -538,6 +539,9 @@ function main {
--ssh-insecure-skip-verify)
INSECURE_SKIP_VERIFY="1"
;;
--upgrade-ui-plugin)
UPGRADE_UI_PLUGIN="y"
;;
-h|--help|*)
usage
exit 0
Expand Down Expand Up @@ -626,8 +630,11 @@ function main {
### -------------------- ###
### Component Upgrades ###
### -------------------- ###
log "\n-------------------------\nStarting VIC UI Plugin Upgrade ${TIMESTAMP}\n"
upgradeAppliancePlugin
[ -z "${UPGRADE_UI_PLUGIN}" ] && read -p "Upgrade VIC UI Plugin?: (y/n) " UPGRADE_UI_PLUGIN
if [ "$UPGRADE_UI_PLUGIN" == "y" ]; then
log "\n-------------------------\nStarting VIC UI Plugin Upgrade ${TIMESTAMP}\n"
upgradeAppliancePlugin
fi

log "\n-------------------------\nStarting Admiral Upgrade ${TIMESTAMP}\n"
upgradeAdmiral
Expand Down Expand Up @@ -658,7 +665,11 @@ function finish() {
if [ "$rc" -eq 0 ]; then
log ""
log "-------------------------"
log "Upgrade completed successfully. Exiting."
if [ "$UPGRADE_UI_PLUGIN" == "y" ]; then
log "Upgrade completed successfully. Exiting. Please logout and login vCenter Server twice to view the upgraded ui plugin."
else
log "Upgrade completed successfully. Exiting."
fi
log "-------------------------"
log ""
else
Expand Down
3 changes: 2 additions & 1 deletion installer/fileserver/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ <h4>Infrastructure Deployment Tools</h4>
<div class="modal-dialog" role="dialog"aria-hidden="false">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Complete VIC plugin installation</h3>
<h3 class="modal-title">Complete VIC appliance installation</h3>
</div>
<div id="plugin-spinner" style="display: none;text-align: center">
<div class="spinner"></div>
Expand Down Expand Up @@ -229,6 +229,7 @@ <h3 class="modal-title">Complete VIC appliance installation</h3>
<label for="pscDomain">External PSC Admin Domain</label>
<input id="pscDomain" type="text" name="pscDomain" placeholder="vsphere.local">
</div>
Install UI Plugin <input id="needuiplugin" type="checkbox" name="needuiplugin" value="true" checked>
<input id="thumbprint" type="hidden" name="thumbprint" placeholder="">
</div>
<div class="text-sm-right">
Expand Down
22 changes: 13 additions & 9 deletions installer/fileserver/routes/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ func (i *IndexHTMLRenderer) IndexHandler(resp http.ResponseWriter, req *http.Req
if err := indexFormHandler(op, req, html); err != nil {
op.Errorf("Install failed: %s", err.Error())
html.InitErrorFeedback = fmt.Sprintf("Installation failed: %s", err.Error())
} else if req.FormValue("needuiplugin") == "true" {
html.InitSuccessFeedback = "Installation successful. Refer to the Post-install and Deployment tasks below. Please logout and login vCenter Server twice to view the latest ui plugin."
} else {
html.InitSuccessFeedback = "Installation successful. Refer to the Post-install and Deployment tasks below."
}
Expand Down Expand Up @@ -99,16 +101,18 @@ func indexFormHandler(op trace.Operation, req *http.Request, html *IndexHTMLOpti
return err
}

h5 := tasks.NewH5UIPlugin(PSCConfig.Admin)
h5.Force = true
if err := h5.Install(op); err != nil {
return err
}
if req.FormValue("needuiplugin") == "true" {
h5 := tasks.NewH5UIPlugin(PSCConfig.Admin)
h5.Force = true
if err := h5.Install(op); err != nil {
return err
}

flex := tasks.NewFlexUIPlugin(PSCConfig.Admin)
flex.Force = true
if err := flex.Install(op); err != nil {
return err
flex := tasks.NewFlexUIPlugin(PSCConfig.Admin)
flex.Force = true
if err := flex.Install(op); err != nil {
return err
}
}

return nil
Expand Down
5 changes: 2 additions & 3 deletions installer/fileserver/tasks/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,8 @@ func (p *Plugin) Install(op trace.Operation) error {
}
vCenterVersion := p.Target.Session.Client.ServiceContent.About.Version
if p.denyInstall(op, vCenterVersion) {
err := errors.Errorf("Refusing to install Flex plugin on vSphere %s", vCenterVersion)
op.Error(err)
return err
op.Warnf("Refusing to install Flex plugin on vSphere %s", vCenterVersion)
return nil
}

op.Infof("### Installing UI Plugin against vSphere %s ####", vCenterVersion)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Verify Getting Started page
Log To Console Initializing the OVA using the getting started ui...
Navigate To Getting Started Page
Verify Getting Started Page Title
Log In And Complete OVA Installation
#Log In And Complete OVA Installation

0 comments on commit c33d39d

Please sign in to comment.