2019-07-11 DevOps [JENKINS] pipeline 작성 git lab 설정에서 webhook (push Event) 이후 작성 정의(pipeline)pipeline script 12345678910111213141516171819202122232425262728pipeline { agent any tools {nodejs "node"} stages { stage('Cloning Git') { steps { git url: 'https://xxx.xxxxx.com/bittorage/WebServer.git', credentialsId: 'gitlab-skarl-passwd', branch: 'develop' } } stage('Install dependencies') { steps { sh 'npm install' } } stage('Test') { steps { sh 'npm test' } } }} 실행 로그123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116Started by GitLab push by Running in Durability level: MAX_SURVIVABILITY[Pipeline] Start of Pipeline[Pipeline] nodeRunning on Jenkins in /var/lib/jenkins/workspace/pipe1[Pipeline] {[Pipeline] stage[Pipeline] { (Declarative: Tool Install)[Pipeline] tool[Pipeline] envVarsForTool[Pipeline] }[Pipeline] // stage[Pipeline] withEnv[Pipeline] {[Pipeline] stage[Pipeline] { (Cloning Git)[Pipeline] tool[Pipeline] envVarsForTool[Pipeline] withEnv[Pipeline] {[Pipeline] gitusing credential gitlab-skarl-passwd > git rev-parse --is-inside-work-tree # timeout=10Fetching changes from the remote Git repository > git config remote.origin.url https://xxx.xxxxxxx.com/bittorage/WebServer.git # timeout=10Fetching upstream changes from https://xxx.xxxxxxx.com/bittorage/WebServer.git > git --version # timeout=10using GIT_ASKPASS to set credentials gitlab-skarl-passwd > git fetch --tags --progress https://xxx.xxxxxxx.com/bittorage/WebServer.git +refs/heads/*:refs/remotes/origin/*skipping resolution of commit remotes/origin/develop, since it originates from another repository > git rev-parse refs/remotes/origin/develop^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/develop^{commit} # timeout=10Checking out Revision 449b52612009786e6e7ae37841f57b3602fc89ff (refs/remotes/origin/develop) > git config core.sparsecheckout # timeout=10 > git checkout -f 449b52612009786e6e7ae37841f57b3602fc89ff > git branch -a -v --no-abbrev # timeout=10 > git branch -D develop # timeout=10 > git checkout -b develop 449b52612009786e6e7ae37841f57b3602fc89ffCommit message: "모카 테스트 예제 추가" > git rev-list --no-walk a7271488613cc3aeb66bd06be08603e458a57c40 # timeout=10[Pipeline] }[Pipeline] // withEnv[Pipeline] }[Pipeline] // stage[Pipeline] stage[Pipeline] { (Install dependencies)[Pipeline] tool[Pipeline] envVarsForTool[Pipeline] withEnv[Pipeline] {[Pipeline] sh+ npm installnpm WARN webserver@0.1.0 No repository field.npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.6 (node_modules/fsevents):npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.6: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) audited 17564 packages in 18.837sfound 7 vulnerabilities (1 moderate, 6 high) run `npm audit fix` to fix them, or `npm audit` for details[Pipeline] }[Pipeline] // withEnv[Pipeline] }[Pipeline] // stage[Pipeline] stage[Pipeline] { (Test)[Pipeline] tool[Pipeline] envVarsForTool[Pipeline] withEnv[Pipeline] {[Pipeline] sh+ npm test > webserver@0.1.0 test /var/lib/jenkins/workspace/pipe1> mocha ./test/Websocket.test.ts --exit Sample routeServer is running in process 11973 listening on PORT 1344 Parsing session from request...no passportJHnljEKqdbSt48woI0AdXGC6IAZZnU91openundefined{"trCode":42,"message": {} }code= { trCode: 42, message: {} }setStorageSock2019-04-24 10:53:00,528 INFO [STORAGE:NOTICE:CONTROLLER] StorageNoticeController initfaq key= 42msg Cannot read property 'publish' of undefinedkey=== 42{ networkType: 0, trCode: 42, result: 0, message: [ { createDate: null, lastModifiedDate: null }] } ✓ STORAGE Test (104ms)after 1 passing (191ms) [Pipeline] }[Pipeline] // withEnv[Pipeline] }[Pipeline] // stage[Pipeline] }[Pipeline] // withEnv[Pipeline] }[Pipeline] // node[Pipeline] End of PipelineTriggering a new build of ansible-project #2Finished: SUCCESS 최신 [WEBSERVER] session/cookie or token 이전 [NODEJS] EXPRESS(node.js) to WebSocket 세션 공유