diff --git a/installer/build/bootable/build-main.sh b/installer/build/bootable/build-main.sh
index 3b9f5d4ba5..293381b3c1 100755
--- a/installer/build/bootable/build-main.sh
+++ b/installer/build/bootable/build-main.sh
@@ -86,6 +86,11 @@ function build_app {
SOURCE=$(jq '.['$LINE_NUM'] | .source' "${MANIFEST}" | tr -d '"')
DESTINATION=$(echo "${ROOT}/$(cat "${MANIFEST}" | jq '.['$LINE_NUM'] | .destination')" | tr -d '"' )
mkdir -p "$(dirname "$DESTINATION")" && cp -R $SOURCE "$DESTINATION"
+ if [[ "$DESTINATION" == *"fileserver/html"* ]]; then
+ pushd $DESTINATION
+ rm -fr .gitignore karma* package* js/fixtures js/specs
+ popd
+ fi
fi
LINE_NUM=$((LINE_NUM+1))
done
diff --git a/installer/build/build-ova.sh b/installer/build/build-ova.sh
index 84fd6af60e..fd13928116 100755
--- a/installer/build/build-ova.sh
+++ b/installer/build/build-ova.sh
@@ -146,6 +146,7 @@ drone deploy --param VICENGINE=${BUILD_VICENGINE_URL:-} \\
--param VIC_MACHINE_SERVER=${BUILD_VIC_MACHINE_SERVER_REVISION:-} \\
--param ADMIRAL=${BUILD_ADMIRAL_REVISION:-} \\
--param HARBOR=${BUILD_HARBOR_URL:-} \\
+ --param VICUI=${BUILD_VICUI_URL:-} \\
vmware/vic-product ${DRONE_BUILD_NUMBER:-} staging
EOF
elif [ "deployment" == "${DRONE_BUILD_EVENT}" -a "staging" == "${DRONE_DEPLOY_TO}" ]; then
@@ -156,6 +157,7 @@ drone deploy --param VICENGINE=${BUILD_VICENGINE_URL:-} \\
--param VIC_MACHINE_SERVER=${BUILD_VIC_MACHINE_SERVER_REVISION:-} \\
--param ADMIRAL=${BUILD_ADMIRAL_REVISION:-} \\
--param HARBOR=${BUILD_HARBOR_URL:-} \\
+ --param VICUI=${BUILD_VICUI_URL:-} \\
vmware/vic-product ${DRONE_BUILD_NUMBER:-} release
EOF
fi
diff --git a/installer/build/scripts/upgrade/upgrade.sh b/installer/build/scripts/upgrade/upgrade.sh
index ea72d14316..dec3382cba 100755
--- a/installer/build/scripts/upgrade/upgrade.sh
+++ b/installer/build/scripts/upgrade/upgrade.sh
@@ -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
@@ -93,11 +94,13 @@ function callPluginUpgradeEndpoint {
local preset=$1
local vc='{"target":"'"${VCENTER_TARGET}"'","user":"'"${VCENTER_USERNAME}"'","password":"'"${VCENTER_PASSWORD}"'","thumbprint":"'"${VCENTER_FINGERPRINT}"'"}'
local plugin='{"preset":"'"${preset}"'","force":true}'
- local payload='{"vc":'${vc}',"plugin":'${plugin}'}'
+ local payload='{"vc":"${vc}","plugin":"${plugin}"}'
echo "register payload - ${payload}" | sed -e 's/'${VCENTER_PASSWORD}'/***/g' >> $upgrade_log_file 2>&1
/usr/bin/curl \
-k \
- --write-out '%{http_code}' \
+ -s \
+ -o /dev/null \
+ --write-out "%{http_code}\\n" \
--header "Content-Type: application/json" \
-X POST \
--data "${payload}" \
@@ -140,10 +143,12 @@ function upgradeAppliancePlugin {
function callRegisterEndpoint {
local payload='{"target":"'"${VCENTER_TARGET}"'","user":"'"${VCENTER_USERNAME}"'","password":"'"${VCENTER_PASSWORD}"'","thumbprint":"'"${VCENTER_FINGERPRINT}"'","externalpsc":"'"${EXTERNAL_PSC}"'","pscdomain":"'"${PSC_DOMAIN}"'"}'
- echo "register payload - ${payload}" | sed -e 's/'${VCENTER_PASSWORD}'/***/g' >> $upgrade_log_file 2>&1
+ echo "register payload - ${payload}" | sed -e 's/"${VCENTER_PASSWORD}"/***/g' >> $upgrade_log_file 2>&1
/usr/bin/curl \
-k \
- --write-out '%{http_code}' \
+ -s \
+ -o /dev/null \
+ --write-out "%{http_code}\\n" \
--header "Content-Type: application/json" \
-X POST \
--data "${payload}" \
@@ -538,6 +543,9 @@ function main {
--ssh-insecure-skip-verify)
INSECURE_SKIP_VERIFY="1"
;;
+ --upgrade-ui-plugin)
+ UPGRADE_UI_PLUGIN="y"
+ ;;
-h|--help|*)
usage
exit 0
@@ -582,6 +590,7 @@ function main {
export GOVC_DATACENTER="$VCENTER_DATACENTER"
[ -z "${APPLIANCE_TARGET}" ] && read -p "Enter old VIC appliance IP: " APPLIANCE_TARGET
[ -z "${APPLIANCE_USERNAME}" ] && read -p "Enter old VIC appliance username: " APPLIANCE_USERNAME
+ [ -z "${UPGRADE_UI_PLUGIN}" ] && read -p "Upgrade VIC UI Plugin? (y/n):" UPGRADE_UI_PLUGIN
if [ -n "${DESTROY_ENABLED}" ] ; then
local resp=""
@@ -626,8 +635,10 @@ function main {
### -------------------- ###
### Component Upgrades ###
### -------------------- ###
- log "\n-------------------------\nStarting VIC UI Plugin Upgrade ${TIMESTAMP}\n"
- upgradeAppliancePlugin
+ 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
@@ -658,7 +669,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
diff --git a/installer/fileserver/html/index.html b/installer/fileserver/html/index.html
index 3d81137f69..39d48fea3f 100644
--- a/installer/fileserver/html/index.html
+++ b/installer/fileserver/html/index.html
@@ -150,7 +150,7 @@
Infrastructure Deployment Tools
diff --git a/installer/fileserver/main.go b/installer/fileserver/main.go
index 974c07d9a5..76e1114b5d 100644
--- a/installer/fileserver/main.go
+++ b/installer/fileserver/main.go
@@ -140,14 +140,14 @@ func parseServerConfig(op trace.Operation, conf *serverConfig) {
// cspMiddleware sets the Content-Security-Policy header to prevent clickjacking
// https://www.owasp.org/index.php/Content_Security_Policy_Cheat_Sheet#Preventing_Clickjacking
func cspMiddleware() func(next http.Handler) http.Handler {
- header := "Content-Security-Policy"
- value := "frame-ancestors 'none';"
- return func(next http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Header().Add(header, value)
- next.ServeHTTP(w, r)
- })
- }
+ header := "Content-Security-Policy"
+ value := "frame-ancestors 'none';"
+ return func(next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Add(header, value)
+ next.ServeHTTP(w, r)
+ })
+ }
}
func main() {
diff --git a/installer/fileserver/routes/index.go b/installer/fileserver/routes/index.go
index 4670667da8..a1b8ecdce2 100644
--- a/installer/fileserver/routes/index.go
+++ b/installer/fileserver/routes/index.go
@@ -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 new ui plugin."
} else {
html.InitSuccessFeedback = "Installation successful. Refer to the Post-install and Deployment tasks below."
}
@@ -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
diff --git a/installer/fileserver/tasks/plugin.go b/installer/fileserver/tasks/plugin.go
index 9660f452e5..0811561f31 100644
--- a/installer/fileserver/tasks/plugin.go
+++ b/installer/fileserver/tasks/plugin.go
@@ -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)
diff --git a/installer/scripts/ci-build.sh b/installer/scripts/ci-build.sh
index e97bc1ee04..0851c2d60d 100755
--- a/installer/scripts/ci-build.sh
+++ b/installer/scripts/ci-build.sh
@@ -33,7 +33,7 @@ if [ -n "${VICENGINE}" ]; then
OPTIONS="$OPTIONS --vicengine $VICENGINE"
fi
if [ -n "${VICUI}" ]; then
- OPTIONS="$OPTIONS --vicui $VICENGINE"
+ OPTIONS="$OPTIONS --vicui $VICUI"
fi
if [ -n "${VIC_MACHINE_SERVER}" ]; then
OPTIONS="$OPTIONS --vicmachineserver $VIC_MACHINE_SERVER"
@@ -61,8 +61,13 @@ if [[ ( "$DRONE_BUILD_EVENT" == "tag" && "$DRONE_TAG" != *"dev"* ) || "$DRONE_BR
OPTIONS="$OPTIONS --vicengine ${vicengine_release:?Unable to find an appropriate VIC Engine build. Is '"'$DRONE_BRANCH'"' a valid vmware/vic branch?}"
fi
if [ -z "${VICUI}" ]; then
- vicui_release=$(gsutil ls -l "gs://vic-ui-releases" | grep -v TOTAL | grep vic_ | sort -k2 -r | (trap '' PIPE; head -1) | xargs | cut -d " " -f 3 | sed 's/gs:\/\//https:\/\/storage.googleapis.com\//')
- OPTIONS="$OPTIONS --vicui $vicui_release"
+ if [[ "$DRONE_BUILD_EVENT" != "tag" || "$DRONE_TAG" == *"dev"* ]]; then
+ bucket="gs://vic-ui-builds/$DRONE_BRANCH"
+ else
+ bucket="gs://vic-ui-releases"
+ fi
+ vicui_release=$(gsutil ls -l "$bucket" | grep -v TOTAL | grep vic_ | sort -k2 -r | (trap '' PIPE; head -1) | xargs | cut -d " " -f 3 | sed 's/gs:\/\//https:\/\/storage.googleapis.com\//')
+ OPTIONS="$OPTIONS --vicui ${vicui_release:?Unable to find an appropriate VIC UI build. Is '"'$DRONE_BRANCH'"' a valid vmware/vic-ui branch?}"
fi
if [ -z "${VIC_MACHINE_SERVER}" ]; then
# Listing container tags requires permissions
diff --git a/tests/test-cases/Group2-Getting-Started/2-01-Getting-Started.robot b/tests/test-cases/Group2-Getting-Started/2-01-Getting-Started.robot
index 0fcb0e6270..a988b81176 100644
--- a/tests/test-cases/Group2-Getting-Started/2-01-Getting-Started.robot
+++ b/tests/test-cases/Group2-Getting-Started/2-01-Getting-Started.robot
@@ -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