diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index 141b0ced..015661a3 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -19,16 +19,16 @@ regardless of the number of packages. *Unsafe*: ```salt -buildbot-dependencies: - pip.installed: - - name: buildbot == 0.8.12 +essential-dependencies: + pkg.installed: + - name: cowsay ``` *Better*: ```salt -buildbot-dependencies: - pip.installed: +essential-dependencies: + pkg.installed: - pkgs: - - buildbot == 0.8.12 + - cowsay ``` diff --git a/android-dependencies.sls b/android-dependencies.sls index c02f9ddb..127fa32e 100644 --- a/android-dependencies.sls +++ b/android-dependencies.sls @@ -23,7 +23,10 @@ android-dependencies: - libgl1-mesa-dev - refresh: True pip.installed: - - name: s3cmd + - pkgs: + - s3cmd + - require: + - pkg: pip android-sdk: archive.extracted: diff --git a/buildbot/master.sls b/buildbot/master.sls index 481bc37c..8cc9e38a 100644 --- a/buildbot/master.sls +++ b/buildbot/master.sls @@ -1,20 +1,18 @@ -buildbot: +buildbot-master: pip.installed: - pkgs: - buildbot == 0.8.12 - service_identity == 14.0.0 - -txgithub: - pip.installed - -boto: - pip.installed - -buildbot-master: + - txgithub == 15.0.0 + - boto == 2.38.0 + - require: + - pkg: pip service.running: - enable: True - - require: - - pip: buildbot + - watch: + - pip: buildbot-master + - file: /home/servo/buildbot/master + - file: /etc/init/buildbot-master.conf /home/servo/buildbot/master: file.recurse: @@ -24,8 +22,6 @@ buildbot-master: - group: servo - dir_mode: 755 - file_mode: 644 - - watch_in: - - service: buildbot-master /etc/init/buildbot-master.conf: file.managed: @@ -33,12 +29,6 @@ buildbot-master: - user: root - group: root - mode: 644 - - watch_in: - - service: buildbot-master - -buildbot-github-listener: - service.running: - - enable: True /usr/local/bin/github_buildbot.py: file.managed: @@ -46,8 +36,6 @@ buildbot-github-listener: - user: root - group: root - mode: 755 - - watch_in: - - service: buildbot-github-listener /etc/init/buildbot-github-listener.conf: file.managed: @@ -56,5 +44,10 @@ buildbot-github-listener: - user: root - group: root - mode: 644 - - watch_in: - - service: buildbot-github-listener + +buildbot-github-listener: + service.running: + - enable: True + - watch: + - file: /usr/local/bin/github_buildbot.py + - file: /etc/init/buildbot-github-listener.conf diff --git a/buildbot/slave.sls b/buildbot/slave.sls index 83a6e9f2..f8f4ae08 100644 --- a/buildbot/slave.sls +++ b/buildbot/slave.sls @@ -1,9 +1,11 @@ {% from 'common/map.jinja' import config as common with context %} -buildbot-slave.pip: +buildbot-slave-dependencies: pip.installed: - pkgs: - buildbot-slave == 0.8.12 + - require: + - pkg: pip {{ common.servo_home }}/buildbot/slave: file.recurse: diff --git a/common/init.sls b/common/init.sls index 7aa3d317..25a353eb 100644 --- a/common/init.sls +++ b/common/init.sls @@ -1,13 +1,35 @@ {% from tpldir ~ '/map.jinja' import config with context %} -{% if grains['kernel'] != 'Darwin' %} -python-pkgs: +python2: + pkg.installed: + - pkgs: + - python + +{% if grains['os'] == 'Ubuntu' %} +python2-dev: pkg.installed: - pkgs: - - python-pip - python-dev {% endif %} +pip: + pkg.installed: + - pkgs: + {% if grains['os'] == 'Ubuntu' %} + - python-pip + {% elif grains['os'] == 'MacOS' %} + - python # pip is included with python in homebrew + {% endif %} + - reload_modules: True + +# Virtualenv package creates virtualenv and virtualenv-3.4 executables +virtualenv: + pip.installed: + - pkgs: + - virtualenv + - require: + - pkg: pip + servo: user.present: - fullname: Tom Servo diff --git a/homu/init.sls b/homu/init.sls index 74fdaaf7..01ce440c 100644 --- a/homu/init.sls +++ b/homu/init.sls @@ -1,38 +1,43 @@ -https://github.com/servo/homu: +python3: + pkg.installed: + - pkgs: + - python3 + +homu: git.latest: + - name: https://github.com/servo/homu - rev: e07f74e7a3a185768e71639d6a328ef8ea234f92 - target: /home/servo/homu - user: servo - - require_in: - - pip: install_homu - -/home/servo/homu/cfg.toml: - file.managed: - - source: salt://homu/cfg.toml - - template: jinja - - user: servo - - group: servo - - mode: 644 - - watch_in: - - service: homu - -/home/servo/homu/_venv: virtualenv.managed: + - name: /home/servo/homu/_venv - venv_bin: virtualenv-3.4 + - python: python3 - system_site_packages: False - - require_in: - - pip: install_homu - -install_homu: + - require: + - pkg: python3 + - pip: virtualenv pip.installed: - bin_env: /home/servo/homu/_venv - editable: /home/servo/homu - -homu: + - require: + - git: homu + - virtualenv: /home/servo/homu/_venv service.running: - enable: True - require: - - pip: install_homu + - pip: homu + - watch: + - file: /home/servo/homu/cfg.toml + - file: /etc/init/homu.conf + +/home/servo/homu/cfg.toml: + file.managed: + - source: salt://homu/cfg.toml + - template: jinja + - user: servo + - group: servo + - mode: 644 /etc/init/homu.conf: file.managed: @@ -40,5 +45,3 @@ homu: - user: root - group: root - mode: 644 - - watch_in: - - service: homu diff --git a/nginx/init.sls b/nginx/init.sls index 5138f4cd..94ede988 100644 --- a/nginx/init.sls +++ b/nginx/init.sls @@ -2,7 +2,7 @@ nginx: pkg.installed: [] service.running: - enable: True - - require: + - watch: - pkg: nginx /etc/nginx/sites-available/default: diff --git a/servo-dependencies.sls b/servo-dependencies.sls index ec7d70d7..e412782e 100644 --- a/servo-dependencies.sls +++ b/servo-dependencies.sls @@ -28,8 +28,10 @@ servo-dependencies: {% endif %} pip.installed: - pkgs: - - virtualenv - ghp-import + - require: + - pkg: pip + - pip: virtualenv {% if grains['kernel'] == 'Darwin' %} # Workaround for https://github.com/saltstack/salt/issues/26414 diff --git a/xvfb/init.sls b/xvfb/init.sls index 3a844dc5..30dca514 100644 --- a/xvfb/init.sls +++ b/xvfb/init.sls @@ -9,7 +9,6 @@ xvfb: pkg.installed: [] service.running: - enable: True - - require: - - pkg: xvfb - watch: + - pkg: xvfb - file: /etc/init/xvfb.conf