'Line 연동'에 해당되는 글 1건

[사전작업]

빌드 환경 구성

테스트 환경 구성

 

 

테스트 JOB 생성

E2E 테스트이기 때문에 환경을 Jenkins Agent(윈도우)에서 실행하도록 아래와 같이 추가

General

빌드 JOB 결과 내려받은 APK 파일 위치를 지정해놓은 테스트 환경에 맞춰 변경

Build#1

 

테스트 실행 스크립트 작성

Build#1

 

파이프라인 생성

아래와 같이 파이프 라인 생성

필자는 테스트 결과를 라인으로 받고 싶어서 아래와 같이 수정함

node {
    try{
        stage("Build"){
            build job: 'build'
        }
        stage("TestAPP"){
            build job: 'test'
            currentBuild.result = 'SUCCESS'
        }
    }catch (err) {
        currentBuild.result = 'FAILURE'
    }
  
    stage 'Notify'
        notifyLINE('DRYSTdTkv4OsQAXOsJoChPmUTqj9aR99wwIv3OFCdJl', currentBuild.result)
}
  
def notifyLINE(token, result) {
    def isFailure = result == 'FAILURE'
      
    def url = 'https://notify-api.line.me/api/notify'
    def message = "Result is ${result}. \n${env.BUILD_URL}"
    def imageThumbnail = isFailure ? 'FAILED_IMAGE_THUMBNAIL' : ''
    def imageFullsize = isFailure ? 'FAILED_IMAGE_FULLSIZE' : ''
      
    sh "curl ${url} -H 'Authorization: Bearer ${token}' -F 'message=${message}' -F 'imageThumbnail=${imageThumbnail}' -F 'imageFullsize=${imageFullsize}'"
}

 

 

테스트

생성된 파이프라인 실행

Build > Test 순으로 동작함을 해당 에뮬레이터에서 확인 및 라인알람 확인

 

 

Jenkins 라인 연동 관련 참고 URL

https://notify-bot.line.me/doc/en/

 

LINE Notify

LINE Notify allows you to send web notifications from GitHub, IFTTT, Mackerel, and more directly to your LINE chats.

notify-bot.line.me

https://engineering.linecorp.com/ko/blog/using-line-notify-to-send-messages-to-line-from-the-command-line/

 

커맨드 라인에서 LINE에 메시지를 보낼 수 있는 LINE Notify - LINE ENGINEERING

들어가며 LINE Notify 개발을 담당하고 있는 Watanabe입니다. 개발자를 대상으로 LINE Notify를 사용하여 커맨드 라인에서 메시지를 보내는 방법을 소개하겠습니다. 기존에는 시스템적으로 LINE에 메시지

engineering.linecorp.com

 

'APP Test > 테스트 환경구성' 카테고리의 다른 글

Android Stuido Emulator  (0) 2020.08.13
Appium 구축  (0) 2020.08.13
빌드 환경 구성(Jenkins-Android-Docker)  (0) 2020.08.10
블로그 이미지

정신차려이각박한세상속에서

,