How to build a Pharo web application and publish it online with a bash script
Ephemeric cloud is a REST API based cloud solution that allows you to put your Smalltalk application online using a simple bash script. In this article, I'll propose a template for the script which you may modify and use to build and publish your own projects.
Official Pharo download pages offers a Zeroconf bash script which automatically downloads the latest Pharo Image and VM from a repository. With a little effort, we can add to the script routines to build a project and to publish it in Ephemeric cloud.
The script is tested on Linux and Mac OS X; however, I'm sure it can be run on any system which meet the following dependencies:
curlconsole utilities must be installed.
2 Bash script
Save the contents of the script in a file named
3 How to run
To run the script open a console, change a directory to a catalog where you saved the file
build_publish.sh and execute the following command:
webfiledemois a name of the temporary folder and a publish name of your Image.
ephemeric_auth_tokenare configuration of your Ephemeric Cloud account. Activate a free Ephemeric cloud account to get that configuration. Refer to the following instruction: Ephemeric Cloud Tutorial.
The building and publishing process may take some time up to 10 minutes. After the process finishes you should see a hostname where the project is published on the last line of the output.
4 How it works
The script creates a temporary folder in the current directory, downloads a Pharo Image and a VM and installs a project in the Image.
After installation is complete the script starts a web server on
8080 port, performs project initialization and saves the Image.
On the last step script creates an Image Archive (using
tar utility) and publishes it in the Ephemeric cloud.
It is possible to add files to the tar archive if they are required for your project to run (ex.: like static resources).