Skip to content

Updating assets on an appliance

Martin Hradil edited this page Oct 30, 2019 · 18 revisions

Instructions for recompiling assets on ManageIQ appliances. (Older: gaprindashvili)

Please note that these instructions are explicitly not supported, follow at your own risk.

This is needed for any changes more advanced than altering public/custom.css, such as changing our Javascript code, images or css.

Dependencies - tools

(downstream only: You have to use the normal process to register the appliance, then the correct repos will be there. Otherwise, installing gcc will fail.)

# install yarn
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | 
  sudo tee /etc/yum.repos.d/yarn.repo
curl --silent --location https://rpm.nodesource.com/setup_8.x |
  bash - # hammer only, not needed in ivanchuk+
dnf -y install yarn

# install build tools
dnf -y install gcc gcc-c++ make

npm packages for each UI plugin

vmdb
rake update:yarn

Actual asset compilation

# now, assets can be precompiled
vmdb
rake assets:precompile
rake evm:restart

manageiq-ui-service

dnf -y install bzip2   # needed to unpack phantomjs
cd /var/www/miq
ln -s vmdb manageiq
git clone https://github.com/ManageIQ/manageiq-ui-service.git # this will clone master, not the right version
cd manageiq-ui-service
git checkout ivanchuk-1 # choose the right version
yarn
yarn run build

(yarn run build outputs to ../manageiq/public/, so, it really needs to be cloned in /var/www/miq, or symlinked right)