/Perfect-Ubuntu

Install Swift and Perfect dependencies into an Ubuntu 16.04 system.

Primary LanguageShell

Install Swift 4.0.3 into an Ubuntu 16.04 System

Get Involed with Perfect!

Star Perfect On Github Stack Overflow Follow Perfect on Twitter Join the Perfect Slack

Swift 4.0 Platforms OS X | Linux License Apache PerfectlySoft Twitter Slack Status

This project includes a script which will install Swift and all major dependencies for Perfect directly into your Ubuntu system. The account using the script will require administrative privileges. You can invoke the script by using the following commands:

git clone https://github.com/PerfectlySoft/Perfect-Ubuntu.git
cd Perfect-Ubuntu/
chmod +x ./install.sh
sudo ./install.sh --sure

Note that this also includes the client libraries for sqlite3, postgres, mysql, mongodb - not the servers.

Once this has been completed, you can now build. For example:

# Optional: execute if you are still in the Perfect-Ubuntu directory!
cd ../ 

# clone a project
git clone https://github.com/PerfectExamples/Perfect-Session-PostgreSQL-Demo.git

# enter the directory
cd Perfect-Session-PostgreSQL-Demo/

# build the project
swift build -c release

Once the project has successfully built, you will see the last line is:

Linking ./.build/release/Perfect-Session-PostgreSQL-Demo

Also included in this repository is a sample Service file, perfect-app-template.service

To change this to your work for your own executable, change the file to values appropriate to your situation.

[Unit]
Description=Perfect deployed <executable-reference>

[Service]
Type=simple
WorkingDirectory=/perfect-deployed/<directory-name>
ExecStart=/perfect-deployed/<directory-name>/<executable-name>
Restart=always
PIDFile=/var/run/<executable-reference>.pid

[Install]
WantedBy=multi-user.target