4e26538d3c080db3fd7fd9cdaca48bd3ded819c6
[arvados-formula.git] / arvados / ruby / package / install.sls
1 # -*- coding: utf-8 -*-
2 # vim: ft=sls
3
4 # Copyright (C) The Arvados Authors. All rights reserved.
5 #
6 # SPDX-License-Identifier: Apache-2.0
7
8 {#- Get the `tplroot` from `tpldir` #}
9 {%- set tplroot = tpldir.split('/')[0] %}
10 {%- from tplroot ~ "/map.jinja" import arvados with context %}
11
12 {%- if arvados.ruby.manage_ruby %}
13
14   {%- if arvados.ruby.use_rvm %}
15   # Centos 7 has no python3-gnupg package, so using gpg.present
16   # will fail when it can't list the existing keys.
17   # Doing it the hard way
18 arvados-ruby-package-install-gpg-cmd-run-gpg-michal-papis:
19   cmd.run:
20     - name: /bin/gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
21     - unless:
22       - /bin/gpg --list-keys 409B6B1796C275462A1703113804BB82D39DC0E3
23
24 arvados-ruby-package-install-gpg-cmd-run-gpg-piotr-kuczynski:
25   cmd.run:
26     - name: /bin/gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
27     - unless:
28       - /bin/gpg --list-keys 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
29
30 arvados-ruby-package-install-rvm-cmd-run-curl:
31   cmd.run:
32     - name: curl -s -L http://get.rvm.io | bash -s stable
33     - unless: test -f /usr/local/rvm/bin/rvm
34     - require:
35       - cmd: arvados-ruby-package-install-gpg-cmd-run-gpg-michal-papis
36       - cmd: arvados-ruby-package-install-gpg-cmd-run-gpg-piotr-kuczynski
37
38 arvados-ruby-package-install-ruby-rvm-installed:
39   rvm.installed:
40     - name: {{ arvados.ruby.pkg }}
41     - default: true
42     - require:
43       - cmd: arvados-ruby-package-install-rvm-cmd-run-curl
44
45   {%- else %}
46
47 arvados-ruby-package-install-ruby-pkg-installed:
48   pkg.installed:
49     - name: {{ arvados.ruby.pkg }}
50   {%- endif %}
51 {%- endif %}