Loading views...
pipeline round-checker linux porting

pipeline round-checker linux porting

Date
Date
2020 Jan 3 0:0
Created by
Created by
Seonglae ChoSeonglae Cho
Created time
Created time
2023 Feb 28 12:39
Last edited by
Last edited by
Seonglae ChoSeonglae Cho
Last edited time
Last edited time
2023 Apr 15 16:51
Refs
Refs
Deploy a Azure Pipelines agent on Linux - Azure Pipelines
Note In Microsoft Team Foundation Server (TFS) 2018 and previous versions, run and release pipelines are called definitions, runs are called builds, service connections are called service endpoints, stages are called environments, and jobs are called phases. To run your jobs, you'll need at least one agent.
Deploy a Azure Pipelines agent on Linux - Azure Pipelines
self hosted agent server에 pipeline이 되는 지 모르겠는데 일단 문서상으로는 된다고 한다

1. agent pool 에 agent 생성 부터 시작!


notion image
 
/var/www/azagent 에 돌리고
 
 
notion image
이런 에러가 뜸 - 저번에 우째 했더라
 
 
notion image
이걸 안해줘서 그런가 yum install 로 하니까 안뜨고 문서 더 읽어보자 이런건 없는데
 
notion image
이렇게 떠야 정상- 아직 안댐
 
notion image
agent 선택을 안해서인듯!! organigation setting 에서 할 수 있다
Allow root user for `config.sh` · Issue #1481 · microsoft/azure-pipelines-agent
You can't perform that action at this time. You signed in with another tab or window. You signed out in another tab or window. Reload to refresh your session. Reload to refresh your session.
Allow root user for `config.sh` · Issue #1481 · microsoft/azure-pipelines-agent
 
notion image
그냥 sh 파일 수정하고 config.sh실행
(왼쪽 체크 지움)
notion image
 
notion image
근데 pat 인증에서 막힌다
가 아니라 agent pool 입력이었군!
 
notion image
personal access tokens 인데 막힘!막힘!
권한 전부 all로 줘도 안대... 뭐지
 
 
 
 
 
notion image
이거 실행은 sudo 로 해야함!!!
 
 
notion image
그리고 나서 권한까지 추가해주니 agent 등록 잘댐
 
notion image
run.sh 도 지워주고 실행
 
notion image
listen 형태로 실행되서 system service 로 등록해줘야할듯
 
 
다행히 바로 document 에 있다 ㅎ
notion image
 
 
심지어 이건 svc.sh 는 sudo 로 해야해서 script 수정도 필요없 ㅎ
 
 
notion image
잘 등록되어있다!
 
 

2. build pipeline


notion image
빌드 파이프라인 간단하게 만들어주고 - 예전에는 몰랐는데 앤서블과 굉장히 흡사
 
 

3. Deployment Group


 
notion image
script 롤 등록해야함
 
근데 이게 알고보니 agent group 하고 deployment group 하고 등록방법이 비슷한데 deployment group 이 훨씬 할수 있는 게 많다
 
notion image
왜 굳이 나뉜 줄은 모르겠지만 대강 builds 에서는 agents 만 쓸수 있고
releases에서는 depolyment group을 쓰는 것
  • build pipeline 이 쉬우니 거기서 그거만 쓰려면 agent
  • release pipeline이 어렵지만 기능 많아서 그거 쓰려면 deployment group - configure가 다른듯

그래서 agent 에 지우고 deployment group에 넣음

 
 

4. release pipeline


  1. artifact
  1. trigger
  1. job of deployment group
  1. task of job
 
artifact 는 여러가지 있는데
 
notion image
여기서는 build artifact 사용
 
notion image
트리거는 pull request trigger 형태로
 
notion image
job은 deployment group 에 매칭해주는 용도라 생각하면 편하고 실제로 하는 일은 task 로 일어난다
 
notion image
job 에는 이런 종류가 있지만 task는 으마으마하게 많다
 
그렇게 하고
 

Create Release 이후 Deploy

  • Create Release 는 일종의 Commit 인데 버전관리같이 전부 저장된다
  • Deploy 는 commit 을 실행하는 녀석인데 한번 배포하는 release라고 생각하면댐
 
 
notion image
그렇게 deploy했는데 error났다
아마 경로문제..인거같은데 temp로 가네
 
 
notion image
첫줄 안나와서 추가하고 밑에 오류나서 날림 - 없었어도 작동 하니 자동 delete 되는듯
쉘 스크립트의 처음 #!/bin/bash 에 대하여.
쉘 스크립트를 만들때, 가장 첫 라인에 를 왜 써야 하는지에 대하여 알아 보도록 하겠습니다. 쉘 스크립트의 가장 첫 라인에 !/bain/bash 를 쓰게 됨으로 해서, 내가 사용 하려는 명령어 해석기가 bash 쉘 임을 미리 알려주는 것입니다. 일반적으로 스크립트에서 #는 주석기호이지만, 첫라인의 #!/bin/bash 에서의 #은 주석기호가 아닙니다. 스크립트의 가장 첫라인에 있는 #!
 
 
pm2 가 안되서 확인해보니
pm2 - Startup script for non-root user permission denied
I just installed pm2 (on Debian 9) and I need to run NodeJS server of few users. Every user have own NodeJS server what I need to run under them. Not under root. For example I have user "user1": ...
pm2 - Startup script for non-root user permission denied
무조건 sudo 넣고!
 
 
 
 
 
 
전체 구조 정리는 여기에!
 

Recommendations