summaryrefslogtreecommitdiff
path: root/commands/register.go (follow)
Commit message (Expand)AuthorAgeFilesLines
* Add configuration template file support for registration commandTomasz Maczukin2019-07-311-0/+62
* Fix custom executor default config on register•••The config for the Custom executor is not being nullified so it ends up being populated for every new executor that the user registers. closes https://gitlab.com/gitlab-org/gitlab-runner/issues/4510 Steve Azzopardi2019-07-231-0/+5
* Fix some linting issuesSimon Jürgensmeyer2019-07-181-1/+4
* Only default to powershell on Windows if no other shell is specifiederushton2019-07-101-1/+1
* Make PowerShell default for Windows shell executor•••When a user registers a new Shell executor `cmd` is the default shell. In 11.11 Windows Batch was deprecated https://about.gitlab.com/2019/05/22/gitlab-11-11-released/#support-for-windows-batch-is-now-deprecated. For new registered Runners Powershell should be the default shell used to increase adoption of PowerShell, the user still has the option to go back to `cmd` if they specify it. Reference https://gitlab.com/gitlab-org/gitlab-runner/issues/4163 Steve Azzopardi2019-06-061-0/+6
* Fix default cache volume docker-windows register•••When the user specifies `docker-windows` `/cache` is still used as a default value, which is never correct in any cache. The default cache volume for `docker-windows` needs to be `c:\\cache`. With this, there is only one limitation, the detection of `c:\\cache` when the user specified volumes on registration. With the following specification `c:\\cache:c:\\User\\ContainerAdministrator\\cache` we fail to add the `c:\\cache` to be used as a cache directory and the reason for this is because a simple string match is being done. For Linux, it's easier since we can split the string with `:` but for Windows `:` is part of the volume mounting. To properly support this scenario we require to expose the volume parser from Docker which is not ideal. A note in the documnetation was added about this. closes https://gitlab.com/gitlab-org/gitlab-runner/issues/3915 Steve Azzopardi2019-06-031-5/+28
* Merge branch '4182-ask-for-docker-windows-in-registration' into 'master'•••Accept docker-windows as an option on register Closes #4182 See merge request gitlab-org/gitlab-runner!1388Tomasz Maczukin2019-05-301-35/+52
|\
| * Update docs for registering a new docker-windows•••`docker-executor` is an option when the user registers a new executor, it's only the cache that is incorrect. Steve Azzopardi2019-05-301-36/+52
| * Accept docker-windows as an option on register•••`docker-windows` is a valid executor which is not being accepted when a a user runs `gitlab-runner register`. The cache path is still `/cache` after registering. This will be solved in https://gitlab.com/gitlab-org/gitlab-runner/issues/3915. The `docker-windows` will only be viewable when using the Windows binary because the list is being generated from the registers executor https://gitlab.com/gitlab-org/gitlab-runner/blob/0634e6a5182f7c54b8849d76a2521bcc8a55b54e/commands/register.go#L86-102, and `docker-windows` is the only available for the Windows binary. This is good since we don't support `docker-windows` on Linux talking to a Windows docker daemon with this we make it clear as well. Closes https://gitlab.com/gitlab-org/gitlab-runner/issues/4182 Steve Azzopardi2019-05-291-0/+1
* | Retyped givenLevel to AccessLevelzelin-l2019-05-291-3/+3
* | Added test for access-level (tmaczukin) and renamed variableszelin-l2019-05-291-5/+4
* | Validate AccessLevel CLI flagzelin-l2019-05-291-0/+29
* | Add configuration of access_level for runners on registration•••Allow setting access_level of new runner to not_protected (default) or ref_protected Minor update to relevant docs and tests See https://gitlab.com/gitlab-org/gitlab-runner/issues/3186 zelin-l2019-05-291-0/+2
|/
* Remove support for deprecated S3 cache configurationTomasz Maczukin2019-05-281-43/+0
* Remove commands/register.go changes as they are unneededKamil Trzciński2019-04-031-7/+0
* Add custom clone path for the build•••When the user specifies `GIT_CLONE_PATH` environment variable inside of the `.gitlab-ci.yml` if the path is valid it is used to clone and build. `GIT_CLONE_PATH` takes precedence over the configured build dir and the default build dir. Closes #2211 Steve Azzopardi2019-04-031-0/+10
* Remove unnecessary log alias for logrus inport•••Some time ago [we had a discussion](https://gitlab.com/gitlab-org/gitlab-runner/merge_requests/934#note_91891281) about why we're aliasing some of the imports of `github.com/sirupsen/logrus` package with a `log` alias. At that moment we've been doing that in 17 from 68 cases when logrus was imported in Runners codebase. The conclusion was this aliasing is unnecessary, because: - we relay on logrus interface so much that moving to another logging library will be not so simple as switching the import name; - we're totally not consistent in the alias usage which makes the code even more messy. Three GitLab Runner maintainers agreeded hat there is no reason to use the aliasing and that we should just use `logrus` everywhere. But no action was don since then. The cleanup was left for a future. Unfortunately, because GitLab Runner is one of our biggest projects in Go, for some people it becomes a source of suggestions of how certain things should be handled. For example here is a discussion in a new project that creates a go-based tool for our Serverless integration: https://gitlab.com/gitlab-org/gitlabktl/merge_requests/9#note_152472275 The most important statement is: > perhaps we could leave it as is since it is how we are exposing logrus in the runner project Because we already know that it should be changed and others start to look on Runner's code to find good patterns, let's finally cleanup the `log` aliasing mess. Tomasz Maczukin2019-03-211-12/+12
* Clenup env, cli-options and deprecations of cache settingsTomasz Maczukin2018-09-111-3/+47
* Remove some questions from register interactive modeTomasz Maczukin2018-05-101-20/+2
* Add --pause option to register commandTomasz Maczukin2018-05-091-0/+8
* Merge branch 'add-support-for-runner-timeout-during-registration' into 'master'•••Add support for max_job_timeout parameter in registration See merge request gitlab-org/gitlab-runner!846Kamil Trzciński2018-04-041-1/+10
|\
| * Simplify RegisterRunner() method definitionTomasz Maczukin2018-04-041-2/+10
| * Add support for max_job_timeout parameter in registrationTomasz Maczukin2018-03-271-1/+2
* | sed 's/Sirupsen\/logrus/sirupsen\/logrus/g'Alessio Caiazza2018-02-231-1/+1
|/
* Resolve "/cache volume is always added to volumes list"Jan Christophersen2018-01-191-0/+7
* Make registration to lock Runner to project realTomasz Maczukin2017-09-151-0/+1
* Rename 2nd iteration: rename importsTomasz Maczukin2017-09-111-3/+3
* Merge branch 'zj-update-cli-dep' into 'master'•••Update cli dep See merge request !656Tomasz Maczukin2017-08-221-1/+1
|\
| * Swap codegangsta for urfaveZeger-Jan van de Weg2017-08-221-1/+1
* | Lock runners to project by default•••Given it improves security, this should be the default. Fixes: gitlab-org/gitlab-ci-multi-runner#2615 Zeger-Jan van de Weg2017-08-221-2/+2
|/
* Fix Parallels executors registration bugsTomo Masakura2017-07-011-1/+1
* Fix VirtualBox Executor registration bugTomo Masakura2017-06-271-2/+2
* Switch register, verify and unregister commands to use APIv4Tomasz Maczukin2017-03-151-3/+9
* Use NewGitLabClient() instead of explicit GitLabClient{}Tomasz Maczukin2017-03-151-1/+1
* add 'run-untagged' flag with default of 'true'•••and env var: REGISTER_RUN_UNTAGGED apply review suggestions change run-untagged default to false Matt DeBoer2017-01-121-1/+14
* Update register.goAbhijeet2016-11-101-8/+8
* Improve registration behavior•••Add missing executors support to registration command; clear config.toml from empty entries created on registration Tomasz Maczukin2016-10-201-17/+40
* Add /ci autodetection for CI Server URLTomasz Maczukin2016-08-291-1/+1
* Merge branch 'docker-machine' into 'master' ••• Runner Autoscale through docker-machine ## What is Docker Machine? > Machine lets you create Docker hosts on your computer, on cloud providers, and inside your own data center. It automatically creates hosts, installs Docker on them, then configures the docker client to talk to them. A “machine” is the combination of a Docker host and a configured client. Source: https://docs.docker.com/machine/ ## Why Docker Machine? Is easy to use. Is well documented. Is well supported and constantly extended. It supports almost any cloud provider or virtualization infrastructure. We need minimal amount of changes to support Docker Machine: machine enumeration and inspection. We don't need to implement any "cloud specific" features. ## GitLab Runner and Docker Machine sitting on tree This MR adds support for Docker Machine in GitLab Runner allowing to automatically spin-up Docker-enabled hosts on any provider supported by Docker Machine: DigitalOcean, VirtualBox, Azure... This allows to have automatically scalable cluster of runners managed by one GitLab Runner instance. You can set to have a maximum of 100 jobs running in parallel. The Docker Machine integration will create Cloud Instances on demand to accommodate the load. After defined period (it can be 1h) the machines will be destroyed and a new one will be created when needed. We use one GitLab Runner to manage all jobs. ## How it works? 1. The GitLab Runner requests the Job from coordinator 2. The GitLab Runner checks available docker machines and takes the first one free 3. If no machine is found a new one is created 4. The Job is run on provisioned machine 5. After the Job is run the disk space is checked and if it goes below certain level the machine is removed 6. Otherwise the machine is added to list of machines that can be reused for other jobs ## How to enable Docker Machine configuration The simplest `config.toml`: ``` concurrent = 50 [[runners]] url = "https://gitlab.com/ci" token = "XYZ" name = "YZX" executor = "docker+machine" limit = 10 [runners.docker] image = "ruby:2.1" [runners.machine] IdleCount = 5 IdleTime = 600 MaxBuilds = 100 MachineDriver = "digitalocean" MachineName = "auto-scale-%s" MachineOptions = [ "digitalocean-image=coreos-beta", "digitalocean-ssh-user=core", "digitalocean-access-token=DO_ACCESS_TOKEN",, "digitalocean-region=nyc2", "digitalocean-size=4gb", "digitalocean-private-networking", "engine-registry-mirror=http://10.128.11.79:34723" ] ``` The above configuration will run up to 10 jobs and it will remove machines after 600 seconds of inactivity. It leave at most 5 nodes waiting to process the jobs. The machines are created on DigitalOcean, using CoreOS image. The boot time of CoreOS VM is between 40-60s. Other MachineOptions: ``` docker-machine create -d digitalocean --help ``` ## Limitations The runner cache is tied to one node. It can be solved by exposing cache as internal runner HTTP service. **No longer true: if this is enabled: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/merge_requests/88** ## Considerations The provisioned machines should not hold any data. The machines should be disposable if not needed. Having to provision a new node should not make a difference for a running a next stage build. See merge request !53Kamil Trzciński2016-02-181-1/+2
|\
| * Introduce docker-machine support to automatically spin-up nodesKamil Trzcinski2016-02-081-1/+2
* | Fix registration questionaryKamil Trzcinski2016-02-081-1/+1
|/
* Make lint happy (serious name refactoring)Kamil Trzcinski2016-02-061-45/+45
* Reduce code complexityKamil Trzcinski2016-02-061-51/+65
* Simplify configuration file•••This commit gets rid of all indirect access to config variables and uses a new `toml` features: `omit empty` and `omit zero` Kamil Trzcinski2016-02-061-18/+7
* Don't ask for services during registration.•••We prefer to use the `.gitlab-ci.yml`. Kamil Trzcinski2016-01-231-33/+1
* Rename vbox to virtualbox•••This also changed the env vars from VBOX_BASE_NAME to VIRTUALBOX_BASE_NAME Daniel Widerin2016-01-161-12/+12
* Fixed formatting differencesMatthew Cillo2016-01-161-7/+7
* added initial support for virtual box executorMatthew Cillo2016-01-161-0/+14
* Add warnings about using runner as `user`•••Fixes #998 Kamil Trzcinski2016-01-161-0/+2
* Added exec command which allows to run build locally using the selected executorKamil Trzcinski2015-11-251-4/+6