목표 - 1. vue cli 문서작성, 도은님께 전달, 질문받기
2. swagger branch master에 git push 들어오면 pipelining
1. vue cli
위 문서 작성 후 도은님께 전달!

azure pipeline
- azure portal - like gcp console
Microsoft Azure
https://portal.azure.com/#home
- azure devops git repository, pipeline site
Azure DevOps Services | Sign In
Microsoft Internet Explorer's Enhanced Security Configuration is currently enabled on your environment. This enhanced level of security prevents our web integration experiences from displaying or performing correctly. To continue with your operation please disable this configuration or contact your administrator.
https://dev.azure.com/StryxDevSln/StPano_svr_n/_apps/hub/ms.vss-build-web.ci-designer-hub?sourceProvider=tfsgit&telemetrySession=653119e6-3e83-47ca-9654-08fe24549f35&repositoryId=61656bab-3014-4434-957a-b04e4f427640&repositoryName=StPano_svr_n&branch=master&repositoryUrl=%2FStryxDevSln%2FStPano_svr_n%2F_git%2FStPano_svr_n&sourceProviderComplete=true
SSH 접속
- key
www.dropbox.com
https://www.dropbox.com/s/ltszk78r7ma2b03/stryxazureprivpubkey.zip?dl=0
여기서 ppk 키받아서 vscode로 ssh 접속하려했는데 ppk네 흠
ppk 는 putty에서 지원하는 포맷이라 vscode ssh에서는 접속이 안될 것 같은 느낌

역시 ssh 접속오류
putty 깔아서 putty gen 에서 openssh 포맷으로 바꿔줘야 다른 커맨드라인에서 ssh커맨드나 내부적으로 ssh사용하는 vscode에서 사용가능

요렇게 export해주면

vs code ssh 에서 config 해주고 접속가능으으
pipelining 찾아보는데 자료가 거의 없다... ms 공식 docs 정도


- 파이프라인에 여러 종류가 있는데 우리는 위 2개쪽에 해당한다
- 오른쪽은 에저 포털에 있는건데 app services로 클라우드 생성했으면 왼쪽에서 express web app to linux on azure라는 녀석을 사용 가능한듯?
- 근데 우리는 virtual machines 로 생성했으므로 node js 를 선택후 virtual machine으로는 수동으로 연결해줘야 할듯 하다
그 연결을 우째할지 모르겠지만!! 찾아본다

일단 node.js 를 선택하면 이런 yml이 나오는데 흠 구조는 완전 도커파일같잖아?
일단 해보자 빌드만 하는 거니 뭐가 다를 듯 한데
- 또 npm 말고 yarn 을 쓰고싶다
yaml MS-Dos 시절에는 파일의 확장자 길이가 3자로 제한됐었다. 그래서 htm이나 yml 같은 줄임말이 있는것 표준은 yaml
그리고 찾아보다 보니 ci/cd와 연권이 깊은데
Continuous Integration) / (Continuous Delivery)를 의미한다

파이프라인에 두가지 종류가 있는데
- build - ci pipeline
- release - cd pipeline
이라고 ms에서 표현한다
개념상으로 그런데 우리가 필요한건 build 파이프라인이고, release는 들어가봤는데 아직 설정이 너무 어렵...
Azure VM의 CI/CD | Microsoft Azure
Azure는 Windows 또는 Linux를 실행하는 가상 머신을 호스팅하기 위한 세계적 수준의 클라우드입니다. 애플리케이션을 개발하는 데 ASP.NET, Java, Node.js 또는 PHP 중 무엇을 사용하는지와 관계없이 변경 내용을 이러한 가상 머신으로 자동으로 푸시하려면 CI/CD(지속적인 통합 및 지속적인 배포) 파이프라인이 필요합니다.
https://azure.microsoft.com/ko-kr/solutions/architecture/cicd-for-azure-vms/
- 이게 우리가 하려는 목표 - 다양한 종류가 있다
메인 예제 링크 2개
음 그래서 정리를 하면
메인이 풀 받음 → 빌드 파이프라인 테스트 → 리눅스 머신에 배포
- 이건 앞부분 화살표 설명 예제
Build and deploy JavaScript and Node.js apps - Azure Pipelines
Use a pipeline to build and test JavaScript and Node.js apps, and then deploy or publish to targets. 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.
https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/javascript?view=azure-devops

- 이건 뒷부분 화살표 설명 예제
Deploy nginx to a Linux VM - Azure Pipelines
We'll show you how to set up continuous deployment of your app to an nginx web server running on Ubuntu using Azure Pipelines or Team Foundation Server (TFS) 2018 and higher. You can use the steps in this quickstart for any app as long as your continuous integration pipeline publishes a web deployment package.
https://docs.microsoft.com/en-us/azure/devops/pipelines/apps/cd/deploy-linuxvm-deploygroups?view=azure-devops&tabs=java-script

이다 이렇게 진행되는 이유는 잘못된거 push 했을때 서비스 안멈추게 안정성을 위해서인듯 .. 이런이유도 있겠고 근본적으로
주변개념 설명 링크 2개
- 인데 위에서 말하는게 테스트는 윈도우 self-hosted agents
Azure Pipelines Agents - 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 build your code or deploy your software using Azure Pipelines, you need at least one agent.
https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops&tabs=browser#install

- 깃허브에 있는 놈을 서버에 보내서 실행시키기 위해 하나의 agent 가 필요하다는 말인데
Jobs in Azure Pipelines and TFS - 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. You can organize your pipeline into jobs. Every pipeline has at least one job.
https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml

이게 그놈이 하는 일인데 대충 읽어보니 클라우드 에서 pool 형태로 진행되서 굉장히 빨리 빌드되더라 그런 말인듯?
자세한 내용은 나도 안읽어봤고. .
그래서 2개를 진행해보는데
1번째 예제레포 포크해서

파이프라인 실행 돌려봤고
굉장히 간단하다 해야 하는 일 자체는 - 개념이 복잡할 뿐
2번째 deployment
ssh 접속해야 해서 접속하고 위에서 하듯

aptget 필요한거 깔아주고

deployment group에 넣어야 pipeline에 넣을 수 있기때문에
deployment gruop 생성
그리고 거기에 가상머신 추가하기 위해서 오른쪽 코드 vm 에 실행

home ~에다가 풀어주었다

이렇게 완료표시 뜸 진짜 뭔지.. 서비스 등록된건가?

어쨋든 deployment group 에 추가는 댔다
이제 빌드 파이프라인 위에서 만들어둔 놈을

release pipeline해야하는데 결국 둘다 해야하는 것이다 후..
오른쪽 위에 release를 눌러주면

이렇게 새로운 realse pipeline을 만들라 한다
크게 설정해야 하는 부분이 artifact 랑 stage의 task인데

artifact는 이거하는 레포를 말하는 듯 하고
task 는 여기서 뭘할지!

대충 echo 하고 mkdir 하는 스크립트 넣어주고 실행

워킹디렉토리 설정해주고

안에 sh 파일 만들어주면 여기서 바로 실행 가능할듯
근데 솔직히 너무 햇갈린다 후 문서도 없고 제대로 되려나
그리고 만들어둔 파이프라인 또 release 하고

deploy까지 해줘야함

근데 눈치챗겠지만 deploy 에 실패했다 후
왜지
여기서 정리를 한번 하면
1. repository git push →
2. run build pipeline (CI) →
3. release pipeline (CD) →
4. Pipeline release →
5. Deploy Release
근데 아직 4번 5번이 왜 필요한지 모르겠다 ㅠ
계속 가 봅시다

이런 에러가 문제였는데 구글링해보니 stackoverflow에서
VSTS: Directory 'd:\a\1\a' is empty. Nothing will be added to build artifact 'drop'
I am making my first build in VSTS and I have had to ask a number of questions on SO. I have now been able to restore nuget packages and build my project but now I have to ensure the artifacts are ...
https://stackoverflow.com/questions/44153600/vsts-directory-d-a-1-a-is-empty-nothing-will-be-added-to-build-artifact-dr
문제가 뭔지는 모르겠는데 artifact를 안가져와서 그런듯 하다 흠 artifact..

일단 모든 파일 copy 하기로 하고
아티팩트 담아 보내기

copying 하는 중인데 역시 무지막지하게 오래 걸린다

copy log 의 내부인데 내부적으로 docker가 쓰이나?
.dockerignore가 보이는데 2번밖에 안나오긴 함
node modules 를 전부 copy 해서 느린거같은데 우리가 하는게 결국 전부다 보내야 하니까 이렇게 항상 해야하나..?
요 두놈이 node_modules바로 전에 있는거 보니 루트 directory 같은데 흠 로그분석을 더 해봐야할듯 하다 ㅠㅠ
artifact도 너무오래걸리고 좀 줄여야 테스트가 진행될텐데 ㅠ
일단 main swagger도 미리 만들어둬야할듯 pipeline두개 그건 오늘 집가서 하는걸로!

Seonglae Cho