-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
115 lines (101 loc) · 3.6 KB
/
playbook.yml
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
- hosts: '{{ hosts }}'
name: Install homebrew, rvm and packages needed for IOS CI
vars:
xcode_dmg: Xcode_7.3.dmg
xcode_dmg_path: .
rvm1_rubies:
- ruby-2.2.2
homebrew_installed_packages:
- gpg
- carthage
- ideviceinstaller
- imagemagick
- ghostscript
- argon/mas/mas
- go
- coreutils
# - cask install java
roles:
- { role: geerlingguy.homebrew, tags: [ 'brew', 'ruby' ] }
- { role: rvm_io.rvm1-ruby, tags: ruby, sudo: True, rvm1_install_flags: '--auto-dotfiles --user-install', rvm1_install_path: '/Users/{{local_username.stdout}}/.rvm', rvm1_user: '{{local_username.stdout}}' }
pre_tasks:
- name: get my username
command: whoami
register: local_username
tags: ruby, xcode
- name: add /usr/local/bin to bashrc
lineinfile: dest=/Users/{{local_username.stdout}}/.bashrc line='export PATH=$PATH:/usr/local/bin' insertafter='EOF' regexp='export PATH=\$PATH:/usr/local/bin' state=present create=true
tags: ruby, xcode
- name: make sure root does not own HomeBrew cache
file: recurse=yes path='/Library/Caches/Homebrew' owner={{local_username.stdout}} group=staff
become: yes
become_method: sudo
tags: ruby
- name: make sure root does not own homebrew-cask cache
file: recurse=yes path='/opt/homebrew-cask/' owner={{local_username.stdout}} group=staff
become: yes
become_method: sudo
tags: ruby
post_tasks:
- name: make sure root does not own .rvm
file: recurse=yes path='/Users/{{local_username.stdout}}/.rvm' owner={{local_username.stdout}} group=staff
become: yes
become_method: sudo
tags: ruby
- name: install gems with rvm
command: bash -lc "gem install {{ item }}"
with_items:
- activesupport
- fastlane
- scan
- gym
- xcpretty
- cocoapods
tags: ruby
- name: Check if we already have the dmg
stat: path="/Users/{{local_username.stdout}}/{{ xcode_dmg }}"
register: xcode_download_path
tags: xcode
- name: Upload dmg
copy: src={{ xcode_dmg_path}}/{{ xcode_dmg }} dest=/Users/{{local_username.stdout}}
when: xcode_download_path.stat.exists == False
tags: xcode
- name: Mount the dmg with hdiutil
command: "hdiutil attach /Users/{{ local_username.stdout }}/{{ xcode_dmg }}"
args:
creates: /Volumes/Xcode/
tags: xcode
- name: copy files in place
synchronize:
src: /Volumes/Xcode/Xcode.app
dest: /Applications2
delegate_to: "{{ inventory_hostname }}"
become: yes
become_method: sudo
tags: xcode
# - name: Install Xcode
# command: cp -r /Volumes/Xcode/Xcode.app /Applications/
# shell: tar cf - . | ( cd /Applications; tar xfp -)
# args:
# creates: /Applications/Xcode.app/
# chdir: /Volumes/Xcode/Xcode.app
# tags: xcode
- name: Accept license agreement
command: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -license accept
become: yes
become_method: sudo
tags: xcode
- name: install "additional components" part 1
command: /usr/sbin/installer -pkg /Applications/Xcode.app/Contents/Resources/Packages/MobileDevice.pkg -target /
become: yes
become_method: sudo
tags: xcode
- name: install "additional components" part 2
command: /usr/sbin/installer -pkg /Applications/Xcode.app/Contents/Resources/Packages/MobileDeviceDevelopment.pkg -target /
become: yes
become_method: sudo
tags: xcode
# TODO:
#
# - python modules PIP!!