Almat.su (Almat.pro)
Блог Алмата Жандаулетова
Установка Gitlab on Windows
Как установить Gitlab в Windows? Первая же ссылка в поисковике дала ответ: Самый легкий способ установить Gitlab в Windows-е — это установить виртуальную машину Linux и уже там установить Gitlab. Пост был опубликован на официальном форуме Гитлаба. Автор кажется не шутить? Хм… А есть ли все таки способ?
Обратимся к официальной документации. Раздел требования https://docs.gitlab.com/ee/install/requirements.html , где есть список поддерживаемых ОС.
- Ubuntu
- Debian
- CentOS
- openSUSE
- Red Hat Enterprise Linux (please use the CentOS packages and instructions)
- Scientific Linux (please use the CentOS packages and instructions)
- Oracle Linux (please use the CentOS packages and instructions)
Что там написано про Windows?
GitLab is developed for Linux-based operating systems. It does not run on Microsoft Windows, and we have no plans to support it in the near future. For the latest development status view this issue. Please consider using a virtual machine to run GitLab.
Gitlab разрабатывался для Linux-based ОС. Оно не запуститься на Windows и у нас нет планов на поддержку этой ОС в ближайшее время. Следить за ходом разработки можете по ссылке. Если хотите запустить на Windows используйте виртуальную машину.
Вот те на… Но постойте, есть же Докер, философия которой заключается как раз в кросс платформенной доставке продукта. Даже есть целый раздел посвязенной установке через Docker https://docs.gitlab.com/omnibus/docker/README.html
Вот только если попытаться запустить на Windows вот этот конфиг:
Setting Up GitLab Runner on Windows
Nidhi
Aug 9, 2018 · 4 min read
Please visit my website and subscribe to my youtube channel for more articles
DevOps4solutions
Thank you for Subscribing! If you have not, Subscribe now! DevOps4Solutions helps in providing end to end solution and…
www.youtube.com
In this blog, we will Setting Up GitLab Runner on Windows to run the builds on the same system or on the another systems. Gitlab Runner concept is just like a agent/slave configuration that we use in Jenkins/Bamboo.
GitLab Runner is used to create a pipeline/job to trigger the builds.
Shared Runners are useful for jo b s that have similar requirements,
between multiple projects. Rather than having multiple Runners idling for
many projects, you can have a single or a small number of Runners that handle multiple projects. This makes it easier to maintain and update them.
Shared Runners process jobs using a fair usage queue.
In contrast to specific Runners that use a FIFO queue, this prevents
cases where projects create hundreds of jobs which can lead to eating all
available shared Runners resources. A Runner that serves all projects is called a shared Runner.
Specific Runners are useful for jobs that have special requirements or for
projects with a specific demand. If a job has certain requirements, you can set
up the specific Runner with this in mind, while not having to do this for all
Runners. For example, if you want to deploy a certain project, you can setup
a specific Runner to have the right credentials for this. The usage of tags
may be useful in this case. Specific Runners process jobs using a FIFO queue.
Group Runners are useful when you have multiple projects under one group
and would like all projects to have access to a set of Runners. Group Runners
process jobs using a FIFO queue.
Ideally, the GitLab Runner should not be installed on the same machine as GitLab.
Install GitLab Runner on Windows
For other Operating system , please refer this link
- Git installed
- A password for your user account, if you want to run it under your user account rather than the Built-in System Account
- Create a folder , ex.: C:\GitLab-Runner .
- Download the binary for x86 or amd64 and put it into the folder you created. Rename the binary to gitlab-runner.exe .
Registering a shared Runner
You can only register a shared Runner if you are an admin of the GitLab instance.
- Grab the shared-Runner token on the youtgitlaburl/ admin/runners page as shown below:
Note down the url and token
Shared Runners are enabled by default as of GitLab 8.2, but can be disabled with the Disable shared Runners button which is present under each project’s Settings ➔ CI/CD page
To register a Runner under Windows:
- Run the following command:
2. Enter your GitLab instance URL:
- Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com ) https://gitlab.com
3. Enter the token you obtained to register the Runner:
Please enter the gitlab-ci token for this runner xxx
4. Enter a description for the Runner, you can change this later in GitLab’s UI:
Please enter the gitlab-ci description for this runner [hostame] my-runner
5. Enter the tags associated with the Runner, you can change this later in GitLab’s UI:
Please enter the gitlab-ci tags for this runner (comma separated): my-tag,another-tag
Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell: docker
Run service using user account
You have to enter a valid password for the current user account, because it’s required to start the service by Windows:
If you encounter an error like The account name is invalid try to add .\ before the username:
- Go to your specific project -> Click on the last symbol ->CI/CD Setting -> you will get the below screen
2. Expand Runners — you should see 1 runner under Shared Runner as green
Setup is completed successfully. Now we will create a pipeline job.
How to Run GitLab Runner
- You have to create a .gitlab-ci.yml file at the root of your project. Sample yaml file as shown below:
- To skip the build , use [ci skip] in commit message so that pipeline/job will not triggered after every commit.
- Trigger the pipeline
Finally congratulations!! You have successfully followed each and every step for Setting Up GitLab Runner on Windows.
Install GitLab Runner on Windows
To install and run GitLab Runner on Windows you need:
- Git, which can be installed from the official site
- A password for your user account, if you want to run it under your user account rather than the Built-in System Account.
Installation
- Create a folder somewhere in your system, ex.: C:\GitLab-Runner .
- Download the binary for x86 or amd64 and put it into the folder you created. Rename the binary to gitlab-runner.exe . You can download a binary for every available version as described in Bleeding Edge — download any other tagged release.
- Run an elevated command prompt:
- Register the Runner.
Install the Runner as a service and start it. You can either run the service using the Built-in System Account (recommended) or using a user account.
Run service using Built-in System Account (under directory created in step 1. from above, ex.: C:\GitLab-Runner )
Run service using user account (under directory created in step 1. from above, ex.: C:\GitLab-Runner )
You have to enter a valid password for the current user account, because it’s required to start the service by Windows:
See the troubleshooting section if you encounter any errors during the Runner installation.
Voila! Runner is installed, running, and will start again after each system reboot. Logs are stored in Windows Event Log.
Update
Stop the service (you need an elevated command prompt as before):
Download the binary for x86 or amd64 and replace runner’s executable. You can download a binary for every available version as described in Bleeding Edge — download any other tagged release.
Uninstall
Windows version support policy
We follow the same lifecycle policy as Microsoft’s Servicing Channels.
This means that we support:
- Long-Term Servicing Channel, versions for 5 years after their release date. Note that we don’t support versions that are on extended support.
- Semi-Annual Channel versions for 18 months after their release date. We don’t support these versions after mainstream support ends.
This is the case for both the Windows binaries that we distribute, and also for the Docker executor.
After a Windows version no longer receives mainstream support from Microsoft, we officially deprecate the version and remove it in the next major change. For example, in 12.x we started supporting Windows 1803 because it came out on 2018-04-30 . Mainstream support ended on 2019-11-12 , so we deprecated Windows 1803 in 12.x and it will be removed in GitLab 13.0.
As a single source of truth we use https://support.microsoft.com/en-us/lifecycle/search which specifies both the release and mainstream support dates.
Below is a list of versions that are commonly used and their end of life date:
| OS | Mainstream support end of life date |
|---|---|
| Windows 10 1803 | November 2019 Deprecated |
| Windows 10 1809/2019 | January 2024 |
| Windows Server Datacenter 1803 | November 2019 Deprecated |
| Windows Server Datacenter 1809/2019 | January 2024 |
| Windows Server Datacenter 1903 | December 2020 |
Future releases
Microsoft releases new Windows Server products in the Semi-Annual Channel twice a year, and every 2 — 3 years a new major version of Windows Sever is released in the Long-Term Servicing Channel (LTSC).
GitLab aims to test and release new GitLab Runner helper images that include the latest Windows Server version (Semi-Annual Channel) within 1 month of the official Microsoft release date. Refer to the Windows Server current versions by servicing option list for availability dates.
Troubleshooting
Make sure that you read the FAQ section which describes some of the most common problems with GitLab Runner.
If you encounter an error like The account name is invalid try to add .\ before the username:
If you encounter a The service did not start due to a logon failure error while starting the service, please look in the FAQ to check how to resolve the problem.
If you don’t have a Windows Password, Runner’s service won’t start but you can use the Built-in System Account.
If you have issues with the Built-in System Account, please read How to Configure the Service to Start Up with the Built-in System Account on Microsoft’s support website.
- DOCS FEEDBACK
- PRODUCT FEEDBACK
- GET HELP
- GET MORE FEATURES
If there’s something you don’t like about this feature
To propose functionality that GitLab does not yet offer
To further help GitLab in shaping new features
If you didn’t find what you were looking for
If you want help with something very specific to your use case, and can use some community support
If you have problems setting up or using this feature (depending on your GitLab subscription)
To view all GitLab tiers and features or to upgrade
If you want to try all features available in GitLab.com
If you want to try all features available in GitLab self-managed
If you spot an error or a need for improvement and would like to fix it yourself in a merge request
If you would like to suggest an improvement to this doc








