2015년 4월 30일 목요일

TestFlight beta testing


작업 후 간단한 정리 내용

버전
Xcode 6.3
iOS 8.x

테스트 시 어플 배포할 수 있는 여러가지 방법 중 하나
(usb 연결을 통한 배포가 가장 흔한 방법이지만 내부에 여러명의 테스터에게 배포할 때는 좋지 않은 방법이다)

iOS 8 이상 부터 지원하는 테스트 배포 시스템이다

1. Apple 개발자 콘솔에서 (itunes connect) 내부 테스트 추가하기
https://itunesconnect.apple.com/
멤버 관리를 하는데 앱개발자로 등록되지 않았더라도 멤버로 초대할 수가 있다
app id로 초대 메일을 보내고 당사자가 메일에서 수락 링크를 클릭하면 초대가 완료된다

2. 나의 App으로 등록하기
참고
https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/UploadingBinariesforanApp.html

등록은 비교적 간단한 입력으로 수월하게 진행가능했다
하지만 xcode로 업로드를 하라는 부분에서 막혔는데...

우선 bundle id 와 app name 등이 개발자 센터에서 정식 등록되어야 한다
https://developer.apple.com/membercenter/index.action

빌드 바이너리 업로드를 하는데
xcode 메뉴 중에 Product->scheme->Edit 로 배포정보를 정확히 하고
Product->Archive 해서 Organizer 창에서 빌드를 itunes connect 서버로 업로드 할 수 있다
# 등록 후 웹콘솔에서 빌드 정보가 업데이트 되기까지는 시간이 좀 더 걸린다

빌드가 웹콘솔에 업데이트 된 이후 버전 정보 리스트 화면 오른쪽 상단에 TestFlight 베타 테스트 스위치를 On시키면 테스트 가능한 상태가 된다

3. 테스트 계정을 선택하기
itunes connect 에서 나의 App 하위 메뉴에 [사전 출시] -> [내부 테스터] 를 통해서 테스터를 등록할 수 있다
그리고 테스터 계정으로 디바이스에서 TestFlight 앱을 설치하고 테스트 초대 메일에서 링크를 클릭해야 비로소 테스트앱을 설치하고 테스트를 할 수 있게 된다!


2015년 4월 14일 화요일

Centos 6 / yum error PYCURL ERROR 7 with ipv6 address right after minimal installation


Version
CentOS 6.6 minimal install

Error
Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock error was
14: PYCURL ERROR 7 - "Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: 네트워크가 접근 불가능합니다"
Error: Cannot find a valid baseurl for repo: base
Ref
https://www.centos.org/forums/viewtopic.php?t=4122 

Solved
It's because that gateway wasn't set 
I modified /etc/sysconfig/network-scripts/ifcfg-eth0
added "GATEWAY=(x.x.x.x)"
or it's also possible that modify /etc/sysconfig/network



2015년 4월 12일 일요일

chef - solo


버전
chef server 12, CentOS 6.5

참고 링크
http://gettingstartedwithchef.com/first-steps-with-chef.html
https://docs.chef.io/chef_solo.html
http://docs.chef.io/ctl_chef_client.html#run-in-local-mode

chef-solo 혹은 chef-client -z (or --local-mode)
레시피를 만들고 테스트를 할 때 유용함

-c, --config (파일경로)
configuration 파일, 내용은 다음처럼
(https://docs.chef.io/config_rb_client.html 참고)
file_cache_path "/home/vagrant/chef-solo-repo"
cookbook_path "/home/vagrant/chef-solo-repo/cookbooks"
-j, --json-attributes (파일경로)
사용할 레시피를 설정하는 JSON 데이타 파일, 내용은 다음처럼
{
  "run_list": [ "recipe[basic-packages]", "recipe[hello]" ]
}

테스트 실행
$ chef-client -z -c client.rb -j sample1.json

만들어진 cookbooks 를 git, svn을 통해서 커밋하거나
같은 장비에서 knife로 작업이 가능하다면 서버로 업로드

2015년 4월 6일 월요일

chef - server



설치 버전
chef server 12 / CentOS 6.5

참고 링크
http://docs.chef.io/server/install_server.html
[Standalone] 단락
http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/cloud/automation/chefInstall

## VM사양
메모리 사용량이 이전 버전에 비해 많이 늘어난 듯 함 (1.5G 이상 되어야 쓸만함)

설치 이미지 다운로드
https://downloads.chef.io/chef-server/

다운로드 후 rpm 설치
$ yum install chef-server-core-{version}.rpm
설치 후 실행
$ chef-server-ctl reconfigure

계정 만들기
$ chef-server-ctl user-create (user_id) (first_name) (last_name) (email) (password) --filename pem_filename
조직(organization) 만들기
$ chef-server-ctl org-create (org_short_name) (full_organization_name) --association_user user_name (user_id list) --filename org_short_name.pem
## 계정이나 조직을 만들면서 생성한 pem (private key) 파일들은 이후에 필요할 때가 있다

웹관리콘솔 설치
$ chef-server-ctl install opscode-manage
$ opscode-manage-ctl reconfigure
$ chef-server-ctl reconfigure

설치 후 https://chef-server-ip 로 접속해서 콘솔 로그인을 해보자

## 참고로 hostname FQDN 설정하기는
https://github.com/DigitalOcean-User-Projects/Articles-and-Tutorials/blob/master/set_hostname_fqdn_on_ubuntu_centos.md#setting-the-hostname

chef - workstation


버전
chef server 12, CentOS 6.5

참고 링크
http://docs.chef.io/client/

Chef-repo 만들기
설명은 git으로 하라고 되어 있지만
$ git clone git://github.com/chef/chef-repo.git
해당 git 페이지에 가보면 deprecated 라고 함
ChefDK 설치 후 chef generate repo 를 사용하라고 함

ChefDK 설치 참조
https://docs.chef.io/#chef-dk-title
$ chef generate repo (repo폴더명)

.chef 폴더 만들기
이 폴더에는 chef 서버 연결과 관련한 3개의 파일이 있어야 하는데
1.knife.rb
2.ORGANIZATION-validator.pem
3.USER.pem
* knife 설정파일 -- 웹콘솔의 Organizations 메뉴에서 다운로드 한다
* 인증키는 서버에서 유저 및 그룹 계정을 생성하면서 만들어 둔 파일을 가져와서 사용하거나
웹콘솔에서 Organizations->private key와 Account Management->Change password에서 초기화 및 다운로드하면 된다

knife 설정 중
ssl 인증서 가져오기
$ knife ssl fetch

Chef-repo 는 svn이나 git 같은 버전 관리 시스템으로 관리하는 것을 권장함
git으로 할 때 .gitignore 에는 다음과 같이 했다
# Chef
.chef/*.pem
.chef/encrypted_data_bag_secret

# Ruby
.rake_test_cache

client 설치
$ knife bootstrap node_hostname -x [account] -P [password] --sudo --run-list "recipes"



2015년 4월 5일 일요일

chef cookbook recipe


설치 버전
chef 12 / CentOS 6.5

새로운 요리책 (레서피) 만들기
(workstation 에서 ChefDK 설치했다는 전제에서 설명)
$ knife cookbook create (요리책이름)

cookbooks/some-chapter/
├── attributes
├── CHANGELOG.md
├── definitions
├── files
│   └── default
├── libraries
├── metadata.rb
├── providers
├── README.md
├── recipes
│   └── default.rb
├── resources
└── templates
    └── default

위와 같은 형태로 폴더 구조 및 파일이 생성이 된다

recipe나 template, attribute, metadata 작업을 한 후에 간단한 검증을 하려면
$ knife cookbook test (요리명) [-o (cookbooks 경로)]
$ foodcritic (요리책경로)

참고 링크
https://docs.chef.io/foodcritic.html
http://neverstopbuilding.com/chef-broiler-plate

요리책을 서버에 등록
$ knife upload cookbooks

참고 링크
https://docs.chef.io/knife_upload.html

client를 요리하기
client에 요리목록 추가/제거하기
$ knife node run_list add (node name) 'recipe[요리명]'
$ knife node run_list remove (node name) 'recipe[요리명]'
전체 수정도 가능
$ knife node edit (node name)
(에디터가 설정되지 않았다는 에러가 뜬다면 [$ export EDITOR=vi] 정도로 해결) 
edit 화면에서 
run-list 부분에 요리책이름을 추가/수정한다
"run_list": [
  "recipe[요리명]"
]

노드에 run_list 작업 지시
$ knife ssh 'name:(node name)' 'sudo chef-client --server https://chef-server [-N (node name)]'