Coverage for lib/libgitlabrunner.py : 92%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
"""GitLab Runner helper library for charm operations."""
"""Provide various charm helper methods to installing and configuring GitLab Runner."""
"""Bootstrap the class.""" self.gitlab_token = self.charm_config["gitlab-token"] self.gitlab_uri = self.charm_config["gitlab-uri"]
"""Ensure services (docker, gitlab-runner) are enabled and running when installed and registered."""
"""Register this GitLab runner with the GitLab CI server.""" self.gitlab_token and self.gitlab_uri and not self.kv.get("registered", False) ): "/usr/bin/gitlab-runner", "register", "--non-interactive", "--url", "{}".format(self.gitlab_uri), "--registration-token", "{}".format(self.gitlab_token), "--name", "{}".format(self.hostname), "--tag-list", "juju,docker", "--executor", "docker", "--docker-image", "ubuntu:latest", ] hookenv.log("Already registered, ignoring request to register") else:
"""Add APT sources to allow installation of GitLab Runner from GitLab's packages.""" # https://packages.gitlab.com/runner/gitlab-runner/gpgkey # https://packages.gitlab.com/runner/gitlab-runner/ubuntu/ bionic main distro ) "Installing and updating apt source for gitlab-runner: {} key {})".format( apt_line, apt_key ) )
"""Install Docker which is required for running jobs.""" apt_install("docker.io")
"""Install or upgrade the GitLab runner packages, adding APT sources as needed."""
"""Upgrade and register GitLab Runner, perform configuration changes when charm configuration is modified.""" |