Deployment of automation scripts

DevNote generalize this and move away from automation scripts only.

To use your automation scripts, it is necessary to make them available to the Corredor server, either locally or on the server.

When running Corredor without Docker (from the source code), you can skip any Docker related steps.

We assume that:
  • your current working directory is where your extension is,

  • your Corteza is located inside /opt/deploy/test-project,

  • your /opt/deploy/test-project file structure looks like this:

data/
docker-compose.yml
.env
In order to deploy your automation scripts:
  1. Create a new directory for your extension; we name it corredor, but the name is inconsequential.

  2. Transfer the extension into the newly created directory (see below sections for tips).

  3. Add a new volume to the docker-compose.yaml file, which contains the extension, under the corredor service, volumes: [ "./corredor:/corredor/test-extension", …​other volumes you might have…​ ].

  4. Edit the .env (CORREDOR_EXT_SEARCH_PATHS variable) file in order to register the new extension CORREDOR_EXT_SEARCH_PATHS=/extensions:/extensions/*:/corredor/test-extension.

  5. Reload the configurations (docker-compose up -d).

At the end, your file structure should look like the following:
data/
docker-compose.yml
.env
corredor/
  test-extension/
    server-scripts/
      /...
    client-scripts/
      /...

CORREDOR_EXT_SEARCH_PATHS may contain multiple paths separated by a colon (:).

You can use docker-compose logs -t --tail 100 -f corredor to see whether the extension was registered and processed correctly.

Transfer of extensions using git

If using Git to version control your extension, clone the repository onto your server (into the volume mentioned above). You can then pull the changes whenever the source code changes.

If the repository is private, make sure that the Git client on your server has access to it.

Manual transfer of extensions

You can use scp, rsync or any other client to transfer the extension onto your server (into the volume mentioned earlier).

We usually use rsync, as it is somewhat better at detecting file changes.

Here is an example of a rsync command following the above assumptions.
rsync -av -e ssh --exclude="node_modules/*" ./* SSH_USERNAME_HERE@ssh.remote.tld:/opt/deploy/test-project/corredor --delete;

Make sure to change the parameters before executing the above command.