-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 58275bc
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM ubuntu as builder | ||
RUN apt-get update && apt-get install -y curl tar jq | ||
WORKDIR /build | ||
RUN curl -sLo hetzner.tar.gz $(curl --silent https://api.github.com/repos/JonasProgrammer/docker-machine-driver-hetzner/releases | jq -r '. | first | .assets[] | select(.name|contains("linux_amd64")).browser_download_url') | ||
RUN tar xf hetzner.tar.gz && chmod +x docker-machine-driver-hetzner | ||
|
||
FROM gitlab/gitlab-runner:latest | ||
COPY --from=builder /build/docker-machine-driver-hetzner /usr/bin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Gitlab ci runner with hetzner docker machine plugin | ||
|
||
Run your tests on Hetzner cloud with the help of gitlab ci and the [docker-machine-driver-hetzner](https://github.com/JonasProgrammer/docker-machine-driver-hetzner). | ||
|
||
## Usage | ||
|
||
Use this image instead of the `gitlab/gitlab-runner` image and set `MachineDriver` to `hetzner` in your runner configuration. | ||
|
||
Example config.toml: | ||
|
||
```toml | ||
concurrent = 1 | ||
check_interval = 0 | ||
|
||
[session_server] | ||
session_timeout = 1800 | ||
|
||
[[runners]] | ||
name = "docker-machine" | ||
url = "https://gitlab.com" | ||
token = "your-token" | ||
executor = "docker+machine" | ||
[runners.docker] | ||
tls_verify = false | ||
image = "docker:latest" | ||
privileged = true | ||
disable_cache = false | ||
volumes = ["/cache"] | ||
shm_size = 536870912 | ||
[runners.cache] | ||
[runners.machine] | ||
IdleCount = 0 | ||
IdleTime = 1800 | ||
MaxBuilds = 10 | ||
MachineDriver = "hetzner" | ||
MachineName = "runner-%s" | ||
MachineOptions = [ | ||
"hetzner-api-token=hetzner-api-token", | ||
"hetzner-image=ubuntu-18.04", | ||
"hetzner-server-type=cx31", | ||
] | ||
``` | ||
|
||
## License | ||
|
||
MIT | ||
|