뚜벅이!
Mobile :)
뚜벅이!
전체 방문자
오늘
어제
  • 분류 전체보기 (53)
    • 코딩테스트 (16)
      • programmers level1 (7)
      • codility (9)
    • 프로그래밍 공부 (31)
      • Spring Boot (6)
      • Nuxt.js (5)
      • Node.js (3)
      • Etc (11)
      • Android (6)
    • 잡다한 글 (4)
    • 토이프로젝트 (1)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • 초보자
  • nuxt
  • lesson2
  • Kotlin
  • firebase
  • level1
  • node
  • nuxt.js
  • 부트
  • Spring
  • 연습
  • NavBar
  • Vue
  • token
  • lesson3
  • Jetpack
  • Notification
  • node.js
  • Vue.js
  • Spring boot
  • docker
  • codillity
  • 프로그래머스
  • JS
  • programmers
  • javascript
  • lesson4
  • 스킬체크테스트
  • AndroidX
  • ad

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
뚜벅이!

Mobile :)

[Centos7] gitlab-runner 설치 및 연결
프로그래밍 공부/Etc

[Centos7] gitlab-runner 설치 및 연결

2021. 12. 20. 10:14
728x90
$ curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | sudo bash
//repository setup
$ sudo yum -y install gitlab-runner
//install gitlab-runner

깃랩을 설치해주고..

 

$ sudo gitlab-runner registor

연결을 해주기위해 레지스터 등록을 해준다.

 

Enter the GitLab instance URL (for example, https://gitlab.com/):

Enter the registration token:

Enter a description for the runner:

Enter tags for the runner (comma-separated):

Registering runner... succeeded                     runner=

Enter an executor: custom, docker, docker-ssh, shell, ssh, 

kubernetes, parallels, virtualbox, docker+machine, docker-ssh+machine:     

Runner registered successfully. 
Feel free to start it, 
but if it's running already the config should be automatically reloaded!

여러가지 입력하라고 하는데, 첫번째 URL과 token은 gitlab에서 확인 가능하다.

register가 정상적으로 등록이 되었다면,

 

옆에 연필모양을 누르고 잠금을 풀어줘야 사용이 가능하다.

참고로 여기서 녹색 연결표시가 아닌 느낌표 표시가 떳다면, 방화벽 때문에 접근이 불가능하거나

sudo로 register를 실행하지 않았기 때문이다.

 

sudo로 register를 실행했을시 config가 /etc/gitlab-runner/config.toml 에 생성되지만,

사용자 계정으로 실행한다면 ~/gltlab-runner/config.toml에 생성된다.

 

sudo로 다시하거나, cp로 옮겨주고 verify 옵션을 주어 실행하도록 하자.

 

stages:
  - build 
  - deploy
스테이지 단계설정. 빌드하고 베포정도면 괜찮지않나..?

before_script:
  - 스크립트 실행하기전 명령

build to test:
  stage: build //빌드단계에서 실행하는 부분
  script:
    - ...
    - ...
    - ...
  after_script: //스크립트 끝나고
    - echo 'build success!'
  tags: // 해당 태그
    - test
  only: // 마스터만 실행가능
    - master
  when: manual // 수동동작

deploy to test:
  stage: deploy  //배포단계에서 실행하는 부분
  script:
    - ...
    - ...
  after_script:
    - echo 'deploy success!'
  tags:
    - test
  only:
    - master
  when: manual

요런식으로 gitlab.ci를 작성해서 프로젝트에 붙여넣어주면

 

 

이런식으로 스태이지가 나뉘게되어 손쉽게 CI/CD를 구성할 수 있다!

728x90
저작자표시 (새창열림)

'프로그래밍 공부 > Etc' 카테고리의 다른 글

naver cloud platform - MSA  (0) 2022.07.19
[osx/mac] wordpress local test  (0) 2022.03.07
[Centos7 x86_64] Docker 다운로드 및 연결  (0) 2021.12.16
[Vault] KMS  (0) 2021.11.04
audio tag에서 seekbar가 작동하지 않을때  (0) 2021.09.17
    '프로그래밍 공부/Etc' 카테고리의 다른 글
    • naver cloud platform - MSA
    • [osx/mac] wordpress local test
    • [Centos7 x86_64] Docker 다운로드 및 연결
    • [Vault] KMS
    뚜벅이!
    뚜벅이!
    2022. 4년차 안드로이드 개발자 wndnjs19@gmail.com

    티스토리툴바