The Ubuntu 18.04 platform is based on Ubuntu 18.04 LTS and optimized for CI/CD. It comes with a set of preinstalled languages, databases, and utility tools commonly used for CI/CD workflows.
The user in the environment, named runner, has full sudo access.
The Ubuntu 18.04 platform uses an APT mirror that is in the same data center as Semaphore's build cluster, which means that caching packages will have little effect.
Versions are now configured with a built-in sem-version command. This new approach enables you to configure versions of different languages and it also enables us to add new versions faster.
With sem-version you can configure versions of the following programming languages: PHP, Ruby, Erlang, Go, Java, C/C++, Python, Elixir, Scala, Node.js. For information about available versions check documentation.
Example of commands that you can add to your job, or to Setup commands that will be executed as a part of every job: bash sem-version ruby 2.6.3 sem-version node 10.1
For more information about using sem-version, check documentation.
Start only services that you need with the built-in sem-service command. Databases are no longer running by default so you can use the desired versions and more resources are left for running your workloads.
With sem-service you can start the desired version of the following databases and services: MySQL, PostgreSQL, Redis, memcached, MongoDB, ElasticSearch and RabbitMQ.
Example of commands that you can add to your job, or to Setup commands that will be executed before every job:
sem-service start mysql sem-service start rabbitmq sem-service start postgres 11.5
For the list of all databases, services and available versions, check the Ubuntu 18.04 platform documentation.
If your application requires software packages that are not pre-installed, be aware that versions available in Ubuntu 18.04 might differ. The best way to go about this is to check the list of pre-installed packages before installing software manually.
Ubuntu 14.04 and Ubuntu 18.04 have mostly the same components with newer versions.
- Background services are now managed with systemd, while in Ubuntu 14.04 it was managed by init.d and upstart. - AppArmor is started by default. It’s likely that this will not affect your application unless you are using KVM or QEMU.
The sem-version utility is used for changing the version of a programming language. You can find a list of all available programming languages with available versions here.
The supported programming languages are Elixir, Erlang, Go, Java, PHP, Ruby, Python, Scala and Node.js. The general form of the sem-version utility is:
sem-version [LANGUAGE] [VERSION]
where [LANGUAGE] is one of elixir, erlang, go, java, php, ruby, python, scala and node. The value of the [VERSION] parameter depends on the programming language used. Example of the sem-version in your job setup:
sem-version go 1.9
The sem-service is a utility for starting, stopping and getting the status of background services. Started services will listen on 0.0.0.0 and their default port. The 0.0.0.0 IP address includes all available network interfaces. For MySQL and Postgres it’s also possible to access them via the usual socket. Essentially, you will be using services as if they were natively installed in the Operating System.
The general form of a sem-service command is as follows:
sem-service start [mysql | postgres | postgis | redis | memcached | mongodb | elasticsearch | rabbitmq | rethinkdb | cassandra] [version] [--username=username] [--password=password] [--db=databasename]
Therefore, each sem-service command requires at least two parameters: the first one is the task you want to perform and the second parameter is the name of the service that will be used for the task. The third parameter is optional and is the version of the service that you want to start.
For MySQL,PostgreSQL and PostGIS it is possible to provide a username via --username=username, the password for the new username via --password=password and a database name for which the user will be granted admin access via --db=dbname.
If no version value is given, a default value will be used according to the following list:
sem-service uses images from Docker Hub and supports all versions that are available in Docker Hub. You can find the list of available versions at the following URLs:
sem-service start mysql sem-service start postgres sem-service start mysql 8.0.19 --username=demo --password=asdf --db=mydb sem-service start postgres 11 --username=demo --password=asdf --db=mydb sem-service start postgis 12-3.0 --username=demo --password=asdf --db=mydb sem-service start redis sem-service start redis 5 sem-service start memcached sem-service start elasticsearch sem-service start elasticsearch 6.5.2 sem-service start mongodb sem-service start mongodb 3.2
The following version control tools are pre-installed:
Chrome and Firefox both support headless mode. You shouldn't need to do more than install and use the relevant Selenium library for your language. Refer to the documentation of associated libraries when configuring your project.
Docker toolset is installed and the following versions are available:
Node.js versions are managed by nvm. You can install any version you need with nvm install [version].
PHP versions are managed by phpbrew.
The default installed PHP version is 7.2.29.
Python versions are installed and managed by virtualenv.
Semaphore Docs are open source — Edit on GitHub