Build an environment on a remote server (AWS EC2 instance)

No web browser available. Basically, need to cross compile, build on a Mac for the EC2 instance, then upload the files from Mac to EC2 instance. Definitely do not want to install on the Mac, only create.

Allan,

Welcome to the ActiveState Platform!

Your use case is one we have not considered. The only way we can partially support your use case involves creating an installation on a local Mac system, which would also create a runtime environment on the ActiveState Platform from where your EC2 instance could then pull it.

If that might work for you, here’s how you can do it assuming you’ve already created an ActiveState Platform account:

  1. Install the State Tool by running the following on the command line:
    sh <(curl -q https://platform.activestate.com/dl/cli/install.sh)
  2. Run: state init <yourORG/somePROJECTname> <Language[@version]>
    For example: state init allandgoff/perlproject perl@5.34
  3. Run: state import cpanfile
    For example: state import C:\users\temp\mycpanfile
  4. Once you receive a message indicating that the environment has been created successfully, you can then install it on your EC2 instance by running the following on a command line:
    sh <(curl -q https://platform.activestate.com/dl/cli/2080745363.1499703358_pdli01/install.sh) -c’state activate --default allandgoff/perlproject’

Hope that helps,

Apologies! Forgot the cross-compile requirement.

To make your environment available for Windows and Linux, you would do step 2.5:

  • Run: state platforms add <name[@version]>
    For example: state platform add Windows@10
    For example: state platform add Linux

The command to install the Linux version is the same as the Mac. The install command for Windows must be run at a CMD prompt:
powershell -Command “& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString(‘https://platform.activestate.com/dl/cli/2080745363.1499703358_pdli01/install.ps1’))) -c’state activate --default danac/Perl-testing123’”