# CI/CD

You can set up a vmr environment to use it in CI/CD pipelines.

vmrStart()
# do what you want
vmrTakeSnapshot("cicdversionR")

## GitLab Runner CI/CD

Using gitlab-runner >= 15.0.0 the option [runners.ssh.disable_strict_host_key_checking] have to be set to true.

Then you can get the command to run, to add it as a GitLab Runner (this will also configure the guest VM) :

virtualboxGitlabRunner(vmr_env,
gitlab_url = "gitlab.com",
gt_token = "<mytoken>",
snapshot_name = "cicdversionR",
vm_name = <VirtualBox VM Name>)

Copy and paste the return command in a terminal where GitLab Runner and the vmr environment are installed (be careful with user right on Gitlab Runner and vmr environment).

## Snapshot

Once you set up your vmr environment and configure CI/CD take a snapshot of it (snapshot name as to be the same as given into virtualboxGitlabRunner).

vmrTakeSnapshot("cicdversionR")
vmrStop()