Closed SAgiKPJH closed 7 months ago
gitlab-runner.exe
로 변경하고 폴더 위치를 C:\GitLab-Runner
에 지정합니다. 쓰기
권한 할당합니다. (보통 되어 있습니다.) C:\GitLab-Runner\gitlab-runner.exe register\
--non-interactive \
--url "https://gitlab.com/" \
--registration-token "$RUNNER_TOKEN" \
--executor "docker-windows" \
--tag-list "sampletags, windows" \
--docker-image bitnami/dotnet-sdk:6.0.420 \
--description "docker-runner"
--executor "docker-windows"
로 설정합니다.--docker-image mcr.microsoft.com/windows/servercore:1809_amd64
가 있습니다.[[runners]]
name = "PJH-Docker"
url = "~~~~URL~~~~"
id = 278
token = "~~~token~~~"
token_obtained_at = 2024-03-14T06:23:12Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "docker-windows"
shell = "pwsh"
[runners.cache]
MaxUploadedArchiveSize = 0
[runners.docker]
tls_verify = false
image = "mcr.microsoft.com/dotnet/sdk:6.0"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["c:\\cache"]
shm_size = 0
network_mtu = 0
> .\gitlab-runner.exe status
Runtime platform arch=amd64 os=windows pid=11836 revision=782c6ecb version=16.9.1
gitlab-runner: the service is not installed
> ./gitlab-runner.exe install
Runtime platform arch=amd64 os=windows pid=19044 revision=782c6ecb version=16.9.1
> ./gitlab-runner.exe status
Runtime platform arch=amd64 os=windows pid=13224 revision=782c6ecb version=16.9.1
gitlab-runner: Service has stopped
> .\gitlab-runner.exe list
Runtime platform arch=amd64 os=windows pid=9616 revision=782c6ecb version=16.9.1
Created missing unique system ID system_id=s_6429108e4109
Listing configured runners ConfigFile=C:\GitLab-Runner\config.toml
> ./gitlab-runner.exe start gitlab-runner
Runtime platform arch=amd64 os=windows pid=26136 revision=782c6ecb version=16.9.1
> ./gitlab-runner.exe status
Runtime platform arch=amd64 os=windows pid=28320 revision=782c6ecb version=16.9.1
gitlab-runner: Service is running
.gitlab-ci.yml
파일 설정합니다.
.gitlab-ci.yml
작성합니다.
stages:
- build
build: stage: build tags:
test: stage: build image: mcr.microsoft.com/dotnet/sdk:5.0-windowsservercore-ltsc2019 variables: TEST_PROJECT_PATH: ./Src/ADC/Tests/Client.Business.UnitTest/Client.Business.UnitTest.csproj script:
- 이후 Commit하여 Build가 되는지 확인합니다.
![image](https://github.com/SagiK-Repository/Learn-Git-Lab-CICD/assets/66783849/fb2c6f3b-8100-4460-a996-c08d3516369c)
- Docker에는 다음과 같이 나타납니다.
![image](https://github.com/SagiK-Repository/Learn-Git-Lab-CICD/assets/66783849/140b1c06-d3fb-4171-bce9-5a46c28b6cc2)
![image](https://github.com/SagiK-Repository/Learn-Git-Lab-CICD/assets/66783849/8337feff-9cae-4474-9242-2b0b3556d657)
![image](https://github.com/SagiK-Repository/Learn-Git-Lab-CICD/assets/66783849/d13ebfc9-c0d6-42ea-8898-ed2986db39f1)
![image](https://github.com/SagiK-Repository/Learn-Git-Lab-CICD/assets/66783849/5c728d10-0e69-44a3-830f-c629cb555c12)
전제조건