Create builds using CircleCI, Docksal
and CI Agent

CI-

Agent

Ivan Berezhnov

Drupal Developer

I worked on:

- CIKLUM

- Aller Media DK

- SimilarWeb
- FFW
- Levi9
- Sanoma Finland & Netherlands
- DOOR3

What is CI/CD?

Continuous integration and continuous delivery

Continuous integration

Continuous integration is a coding philosophy and set of practices that drive development teams to implement small changes and check in code to version control repositories frequently. Because most modern applications require

developing code in different platforms and tools, the team needs a mechanism to integrate and validate its changes.

Continuous integration

Continuous delivery picks up where continuous integration ends. CD automates the delivery of applications to selected infrastructure environments. Most teams work with multiple environments other than the production, such as development and testing environments, and

CD ensures there is an automated way to push code changes to them. CD automation then performs any necessary service calls to web servers, databases, and other services that may need to be restarted or follow other procedures when applications are deployed.

CI & CD require testing

Continuous integration and delivery require continuous testing because the objective is to deliver quality applications and code to users. Continuous testing is often implemented as a set of automated regression, performance, and other tests that are executed in the CI/CD pipeline.

What do you need to create CI/CD?

CI-

Agent

continuous integration and delivery platform for Linux, macOS, and Android, in the cloud or self-hosted.

is a tool for defining and managing web development environments. It uses Docker and Docker Compose to create fully containerized environments for your projects.

A thin agent used to provision Docksal Sandboxes on a remote Docker host. The Docksal Sandboxes are continuous integration environments powered by Docksal.

How to start work with the CircleCI?

1. Create a config file

The config.yml we should create in  .circleci folder

2. Create jobs

Jobs include the docker container and steps to build your project.

3. Create workflows 

Workflows include order jobs and conditions for a run.

4. Add a project to GircleCI

5. Add Environment Variables 

Environment Variables help you build builds and create a project. Used in bash commands and transferred inside the docker container to run a project.

6. Finish 

The CircleCI automatically run a workflow.

What is Docksal?

A tool for defining and managing web development environments. It uses Docker and Docker Compose to create fully containerized environments for your projects.

What a project we can run in Docksal?

We can run:

Let's start with Docksal to create a Drupal project

+

1. Install Docksal

 

2. The Docksal structure

Docker containers:
CLI - includes drush and drupal commands
DB - container with MySQL server
WEB - container with Apache and host settings

Docker files in the .docker folder:

3. Init Docksal in a project

We have few ways to init:

 

1. Get prepared Drupal 7 or 8 projects from GitHub
https://github.com/docksal/boilerplate-drupal8
https://github.com/docksal/drupal8-contrib
https://github.com/docksal/boilerplate-drupal7
 

2. Create a folder and run "fin init" in a terminal then pass all questions.  https://docs.docksal.io/fin/fin-pull#initializing-project

 

3. Copy from GitHub repository .docksal folder then add composer.json
Example:
https://github.com/docksal/drupal8-contrib/tree/master/.docksal

4. Docksal configuration 

5. Useful commands 

fin p start - start a project and up all containers

fin p stop - stop all docker containers

fin p remove - remove a project
 

fin init - run to build your project

fin composer <command> - allow use composer with commands

fin exec "your command" - run some commands inside CLI container


Example:
In a theme folder,
you need to run npm 


fin exec 'npm install'  

fin exec 'gulp watch'

6. Init command

The "init" command it's the main command for creating builds.
CI-Agent automatically runs when creating builds in your server.
Here we describe all steps to build a Drupal project.

What is CI-Agent?

A thin agent used to provision Docksal Sandboxes on a remote Docker host. The Docksal Sandboxes are continuous integration environments powered by Docksal.

Let's look at documentation https://github.com/docksal/ci-agent

How much that cost?

CircleCI has a free plan but you have only 1000 minutes for running jobs also you can run 2 containers at the same time. 

 

Docksal and CI-Agent are free!

 

Server for builds
I recommend use DigitalOcean and here you can buy droplet from $5 and more its dependence from hardware

How to start using in a project?

- create simple work example for your project and show your colleagues

 

- check benefits  for your project

 

- make a presentation for your team and client with demo and don't forget explain all benefits

Links:

Q & A

Thank  you
​everyone 🤝

Create builds using CircleCI, Docksal and CI Agent

By Ivan Berezhnov

Create builds using CircleCI, Docksal and CI Agent

Create builds using CircleCI, Docksal and CI Agent

  • 674