swsnu / swppfall2019

31 stars 23 forks source link

SonarCloud Unauthorized #189

Open ktaebum opened 4 years ago

ktaebum commented 4 years ago

안녕하세요

오늘 몇몇 팀들이 SonarCloud SetUp할 때

Travis-CI Build에서 Unauthorized가 떠서 당황을 많이 하신 팀들이 있는데요

원인 파악 및 해결책을 구해왔습니다

지금 travis 설정이 몇몇 팀들은 https://travis-ci.org/ 에서 가입하셔서 하셨고

몇몇 팀들은 https://travis-ci.com/ 으로 세팅이 되어 있습니다

이 차이 및 가입 관련 내용는 https://devops.stackexchange.com/questions/1201/whats-the-difference-between-travis-ci-org-and-travis-ci-com/4305를 보시면 확인하실 수 있습니다

그럼 자신들이 어떤 것을 통해서 가입했는지는 어떻게 확인할 수 있냐 라는 의문이 생길텐데요 그 의문은 image 이 사진과 같이 Travis CI가 prefix이면 travis-ci.com이구요

image 이 사진과 같이 continuous-integration/travis-ci가 prefix이면 travis-ci.org입니다

물론 build status창 들어가서 직접 domain 주소 확인해도 됩니다

travis-ci.org인 경우에는 강의 슬라이드에 나온대로 따라하면 문제 없이 동작하구요 travis-ci.com인 경우에는

https://docs.travis-ci.com/user/encryption-keys/#usage

여기에서 encryption usage를 보시면

먼저 터미널에서

travis login --pro

를 해주고

travis encrypt --pro SOMEVAR="secretvalue"

이렇게 encrypt 할 때도 --pro option을 지정해주라고 적혀있습니다

현재 이렇게 지정하면 추가적인 문제 없이 되는 것을 확인했습니다

또 하나의 팁은 secure.travis.yml에 적어놓고 싶지 않다 하시면

https://github.com/travis-ci/travis-ci/issues/10138

해당 이슈에 적힌 내용처럼 travis setting에서 SONAR_TOKEN 환경변수를 설정해주면 travis가 빌드를 할 때 export SONAR_TOKEN=[value]로 미리 쉘 환경변수를 설정하고 시작하기 때문에 똑같이 동작하게 할 수 있습니다

더 이상 SonarCloud 문제로 고민하시는 분이 없길 바랍니다 😂

ktaebum commented 4 years ago

현재 travis-ci.com에 문제가 있어서 travis-ci.com으로 등록되어있는 것 다 삭제하였습니다

혹시 자기 레포가 travis가 안 돌아간다 하시는 팀은

travis-ci.org로 가셔서 다시 설정해주시고

만약 잘 안 되면 말씀해주시면 도와드리겠습니다

nevivurn commented 4 years ago

We had a correct working setup with sonarcloud travis-ci.com, this seems to have broken our entire, working, CI setup.

Also, it seems like we can't set up the travis.org integration without approval, please confirm if this is the case.

Screen Shot 2019-11-01 at 18 06 53-fullpage

edit: Another screenshot Screen Shot 2019-11-01 at 18 14 45-fullpage

edit2: We have re-added the travis-ci.com settings. Please do not break our build before we're able to set up travis-ci.org.

ktaebum commented 4 years ago

@nevivurn Sorry for bothering 🙏 I've just activated all repositories in travis-ci.org