Generate HTML pages with information from the CloudStack database, not available using API commands, using Hugo.
Currently implemented is a list of of accounts and projects.
Install Hugo: https://gohugo.io/getting-started/installing/
Install Ruby dependencies
$ bundle install
Download a hugo theme:
$ git clone https://github.com/digitalcraftsman/hugo-material-docs.git themes/hugo-material-docs
Setup a .env file on the same level as the script named ".env" and set the following variables:
# Access to the CloudStack database
CS_DB_HOST=mycloudstack-database.int
CS_DB_USER=root
CS_DB_PASSWORD='***********'
You can generate JSON data files using the included Ruby script:
Generate accounts.json:
$ ./cloudstack.rb accounts > data/accounts.json
Generate projects.json:
$ ./cloudstack.rb projects > data/projects.json
Start hugo in dev mode:
$ hugo server
...
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
- Configure the base URL within config.toml:
baseURL = "http://example.org/"
- Deploy the the static site using rsync - one of many possible deployment options:
$ hugo
$ rsync -avz --delete public/ static-examplehost.net:/data/stackback