Notice
Recent Posts
Recent Comments
Link
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
Tags
more
Archives
Today
Total
관리 메뉴

Trikang

Jenkins와 Bitbucket, Unity3D 엔진 연결하기 본문

개발 일기

Jenkins와 Bitbucket, Unity3D 엔진 연결하기

Trikang 2018. 7. 2. 21:03

현재 Unity3D 개발 환경 구축을 위해 Jenkins와 Bitbucket을 연결 중이다. 개발하며 겪었던 시행착오를 서술해 놓았다.



-  젠킨스에서 프로젝트를 생성할 때 소스 코드 관리 옵션을 Git으로 설정하고 Bitbucket으로 생성한 저장소의 URL을 Repository URL에 넣으면 Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile. 발생


분명 SSH 발급 제대로 했다. 이게 문제인가 싶어서 Git Bash로 Clone을 해봤더니...

잘 된다.


뭐가 문제인지 찾아봤더니, Jenkins는 기본적으로 로컬 시스템 계정으로 실행됨.  이는 SSH key를 가지고 있지 않거나, known_hosts가 설정되지 않음. 그래서 Admin 계정으로 실행했던 위와 결과가 달랐던 것.



그래서 속성에서 jenkins 서비스에 들어가 로그온 할 때의 계정을 관리자로 바꾸어 줌. 그랬더니 잘 작동함.



- Jenkins 내에서 Git 경로 설정

여러 문서에서는 http://젠킨스-경로/configure 에 들어가면 git 경로를 설정할 수 있다고 하였다.() 그러나, 현재는 Global Tool Configuration, 즉 http://젠킨스-경로/configureTools 에 있다.


참고 자료

http://hkn10004.tistory.com/36
- http://simsi6.tistory.com/14
- http://la-stranger.blogspot.com/2013/10/unity-os-jenkins-1.html

ToDo

아래의 궁금증을 해소하면 해당 글 2탄에 메모를 하도록 하자.

 1. Jenkins에서 유니티 빌드를 위한 설정을 해주는데, 이 때 무슨 일이 일어나는지 정확히 파악하기

1-1. https://wiki.jenkins.io/display/JENKINS/Unity3dBuilder+Plugin의 prerequisite 절차를 보면, Editor에 Script를 적어줌. 이 스크립트가 하는 일을 정확히 파악하자

  1. using UnityEngine;
  2. using UnityEditor;
  3. using System;
  4. using System.Collections;
  5. using System.Collections.Generic;
  6. class ProjectBuilder {
  7. static string[] SCENES = FindEnabledEditorScenes();
  8. static string APP_NAME = "YourProject";
  9. [MenuItem ("Custom/CI/Build Android")]
  10. static void PerformAndroidBuild ()
  11. {
  12. string target_filename = APP_NAME + ".apk";
  13. GenericBuild(SCENES, target_filename, BuildTarget.Android ,BuildOptions.None);
  14. }
  15. private static string[] FindEnabledEditorScenes() {
  16. List<string> EditorScenes = new List<string>();
  17. foreach(EditorBuildSettingsScene scene in EditorBuildSettings.scenes) {
  18. if (!scene.enabled) continue;
  19. EditorScenes.Add(scene.path);
  20. }
  21. return EditorScenes.ToArray();
  22. }
  23. static void GenericBuild(string[] scenes, string target_filename, BuildTarget build_target, BuildOptions build_options)
  24. {
  25. EditorUserBuildSettings.SwitchActiveBuildTarget(build_target);
  26. string res = BuildPipeline.BuildPlayer(scenes, target_filename, build_target, build_options);
  27. if (res.Length > 0) {
  28. throw new Exception("BuildPlayer failure: " + res);
  29. }
  30. }
  31. }

2.


'개발 일기' 카테고리의 다른 글

Jenkins와 Bitbucket 연동하기  (2) 2018.07.27
Comments