Running builds on Linux

AppVeyor BYOC allows connecting an existing Linux computer (your workstation, cloud VM or the server in your LAN) and running builds directly on the host operating system.

Requirements

  • Supported operating system:
    • Ubuntu 18.04
  • Computer must be connected to the internet;
  • Git, Mercurial or Subversion depending on the repository of your choice.

Assisted setup

Following cloud configuration wizard is the fastest and the easiest way to configure Linux computer to run your builds. At the end of the wizard you’ll be given a few commands that you run on the target computer to get it up and running in AppVeyor.

In AppVeyor web portal:

  • Select Self-hosted jobs in the top menu;
  • Click Add cloud to start “Add your own cloud” wizard;
  • Choose Your computer, Linux and click Next;
  • Follow the instructions. Connect-AppVeyorToComputer cmdlet (source) will configure a new cloud, install AppVeyor Host Agent on the computer and connect it to the cloud.
  • Click Finish to return to BYOC page and make sure the status of created cloud is Active meaning Host Agent was able to connect to AppVeyor.
  • Update project settings to run builds on your computer.

Manual setup

For better understanding/control of the process or troubleshooting below are the instructions for manual configuration of builds on Linux computer.

Add new build cloud

In AppVeyor web portal:

  • Select Self-hosted jobs in the top menu;
  • Click Add cloud then choose Add cloud manually;
  • Choose Process cloud type.
  • Specify Cloud name, for example Build VM and generate Host agent authorization token (or provide your own - it’s basically AppVeyor Host Agent identifier and the password it connects to AppVeyor with);
  • Click Add to create the cloud.

Add new build worker image

  • On BYOC page navigate to Images and click Add image;
  • Specify Linux as Name and choose Linux in OS type dropdown;
  • Click Add to create the image.

Install AppVeyor Host Agent

AppVeyor Host Agent is a lightweight daemon (systemd service) running on your Linux machine that connects to AppVeyor and runs your builds.

Download the latest AppVeyor Host Agent:

curl -fsSL https://www.appveyor.com/downloads/appveyor/appveyor-host-agent.deb -o appveyor-host-agent.deb

Install Host Agent service with your <host-authorization-token> and AppVeyor URL (if connecting to a self-hosted AppVeyor Server installation):

APPVEYOR_URL=https://ci.appveyor.com HOST_AUTH_TOKEN=<host-authorization-token> dpkg -i appveyor-host-agent.deb

Make sure the service is running:

systemctl status appveyor-host-agent

Changing Host Agent authorization token

If you need to change Host Agent authorization token to connect the agent to a different cloud you can update its value in /etc/opt/appveyor/host-agent/appsettings.json file.

After changing authorization token stop Host Agent daemon:

sudo systemctl stop appveyor-host-agent

delete Host Agent database file host-agent.db in /var/opt/appveyor/host-agent directory and start Host Agent service again:

sudo systemctl start appveyor-host-agent
Did you know that you can edit this page on GitHub and send us a Pull Request?