- Basic Smalltalk Dev Environment Concepts
- Installing Seaside, and Squeak/Pharo Basics (saving and exiting, basic navigation)
- “Setting It Up Right” – Loading Useful Extensions (Except it turns out, not really)
- Creating a Seaside “Hello World”, localhost
- Interlude: Getting a Remote Server
- Packaging Your Image for Deployment
- Installing Pharo on the Server
- Closing the Loop – Deployed Pharo Hello World On Your Domain
There are two schools of thought, as far as preparing a Smalltalk image for deployment to a remote server:
1) Start with a minimal clean image, and only load the libraries and classes that you’re actually using to run your application.
2) Take your development image, and strip out unnecessary applications, GUIs, and the development environment itself
The first method is slightly more difficult but very rewarding, especially if you’re going to go the Continuous Integration route (via Hudson/Jenkins), because it requires you to know exactly which packages you’re using, what they depend on, the load order, and so on. We will explore this approach in later posts.
For this tutorial, though, we’ll use method #2, with help from the Preparing for Deployment chapter of the Seaside book.
Things to Remove for Deployment
- The Developer Toolbar
- All the default applications (except our Hello World one).
First off, what is the Developer Toolbar? It’s the dev mode menu that Seaside automatically inserts at the bottom of your applications, to help you with configuration, session resetting, and so on, and it looks like this:
You definitely want to disable it when deploying your application to a production type server. Fortunately, the code that unregisters all of the extraneous default applications (see below) also removes the dev toolbar.
First, unregister all applications with Seaside (to view the list of the applications that are installed, pull up http://localhost:8080/browse)
WADispatcher default handlers do: [ :each | WADispatcher default unregister: each ].
Next, re-register our Hello World app, since that’s what we actually want to deploy:
WAAdmin register: RHelloWorldComponent asApplicationAt: 'helloworld'
The last step is to save the image. I recommend the Save As route, so as not to overwrite your development image — left-click on the Pharo desktop to bring up the World menu, select Save As:
Now your image is ready to be shipped to a remote server for deployment.