Startup Scripts

SEED Workspaces and APP have the edit function and many settings can be changed for a better fit for the use case. For example, need to open the Workspace info first then click on the edit button then click again on the edit for the interested machine (in this case the workspace dev-machine)

1218

Info Icon

Installer

Installers are programs or scripts that SEED tells the workspace to execute at the start. Installers are executed early during the start of the workspace so it can do a good job for you when you need the workspace to automatically prepare projects and expose applications (eg. during a workshop or a hackathon pitch)

Installers can be added from the UI as in the next image

1594

installer add

Following the text boxes, you will need to give a friendly name to the installer, a description, a version and the script. The script in the box is in the shell (bash) format. The following image shows an example.

1426

installer details

The following is an example of a script that instructs your workspace to create an empty script named init_any.sh that will be created in the workspace under the project root directory /projects

This script, for example, will run at startup whatever instruction you will write inside of it

#!/bin/bash
INITSCRIPT="/projects/init_any.sh"
LOGFILE="/projects/init_any.log"
if [ -e $INITSCRIPT ];
then
  $INITSCRIPT 2>&1 >> $LOGFILE
else
    cat <<END > $INITSCRIPT
    #!/bin/bash
    echo "#This script will run your custom commands at the workspace startup"
END
  chmod +x $INITSCRIPT
fi

For example, you can let the workspace to automatically create a blockchain project with truffle init command
, however, you can instruct the script to execute any complex commands such as starting up the server for an existing project.

1910

example of startup script