Commit 91118afbe227a42cd4849ce065f74f3719e89d01

Authored by Antonio Terceiro
1 parent 9e73393e
Exists in master and in 90 other branches 3.x, add_sisp_to_chef, add_super_archives_plugin, api_for_colab, automates_core_packing, backup, backup_not_prod, cdtc_configuration, changes_in_buttons_on_content_panel, colab_automated_login, colab_spb_plugin_recipe, colab_widgets_settings, design_validation, dev-lappis, dev_env_minimal, disable_email_dev, docs, fix_breadcrumbs_position, fix_categories_software_link, fix_edit_institution, fix_edit_software_with_another_license, fix_get_license_info, fix_gitlab_assets_permission, fix_list_style_inside_article, fix_list_style_on_folder_elements, fix_members_pagination, fix_merge_request_url, fix_models_translations, fix_no_license, fix_software_api, fix_software_block_migration, fix_software_communities_translations, fix_software_communities_unit_test, fix_style_create_institution_admin_panel, fix_superarchives_imports, fix_sym_links_noosfero, focus_search_field_theme, gov-user-refactoring, gov-user-refactoring-rails4, header_fix, institution_modal_on_rating, kalibro-conf-refactoring, kalibro-processor-package, lxc_settings, margin_fix, mezuro_cookbook, performance, prezento, r3, refactor_download_block, refactor_software_communities, refactor_software_for_sisp, register_page, release-process, release-process-v2, remove-unused-images, remove_backup_emails, remove_broken_theme, remove_secondary_email_from_user, remove_sisp_buttons, removing_super_archives_email, review_message, scope2method, signals_user_noosfero, sisp_catalog_header, sisp_colab_config, sisp_dev, sisp_dev_master, sisp_simple_version, software_as_organization, software_catalog_style_fix, software_communities_html_refactor, software_infos_api, spb_minimal_env, spb_to_rails4, spec_refactor, stable-4.1, stable-4.2, stable-4.x, stable-devel, support_docs, syslog, temp_soft_comm_refactoring, theme_header, theme_javascript_refactory, thread_dropdown, thread_page, update_search_by_categories, update_software_api, update_softwares_boxes

Move all vagrant stuff to a single directory

Vagrantfile
... ... @@ -12,7 +12,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
12 12 config.vm.provision 'shell', path: 'proxy.sh', args: [proxy]
13 13 end
14 14  
15   - config.vm.provision 'shell', path: 'vagrant.sh'
  15 + config.vm.provision 'shell', path: 'vagrant/provision.sh'
16 16  
17 17 config.vm.network :forwarded_port, guest: 8000, host: 8000 # Colab (runserver)
18 18 end
... ...
vagrant.d/00-colab-generic
... ... @@ -1,7 +0,0 @@
1   -#!/bin/sh
2   -
3   -set -e
4   -
5   -# colab
6   -/vagrant/colab/vagrant/bootstrap.sh
7   -sudo -u vagrant -i /vagrant/colab/vagrant/provision.sh
vagrant.d/10-mailman-debian
... ... @@ -1,118 +0,0 @@
1   -#!/bin/sh
2   -
3   -set -e
4   -
5   -export DEBIAN_FRONTEND=noninteractive
6   -
7   -if [ ! -f /etc/apt/sources.list.d/mailman-api.list ]; then
8   - cat > /etc/apt/sources.list.d/mailman-api.list <<EOF
9   -deb http://download.opensuse.org/repositories/isv:/spb:/mailman-api/Debian_7.0/ ./
10   -deb-src http://download.opensuse.org/repositories/isv:/spb:/mailman-api/Debian_7.0/ ./
11   -EOF
12   -
13   - apt-key add - <<EOF
14   ------BEGIN PGP PUBLIC KEY BLOCK-----
15   -Version: GnuPG v2.0.15 (GNU/Linux)
16   -
17   -mQENBFRE9cMBCADl9VaZi3A4u5Fy2X9FP/18xkz2U1hsklLTgvwSuFT4gDCgtvD4
18   -r3xAxnZ/52yLdAnrBratM1uC03WWifrCE+J5rImhiwP3itUzAGi/chmfVAuMBAVN
19   -7rjBpurQoEuMDwec60XmS9XJ+BrcO+MyKaLTxKwy1KN+vaIM8Z7evpFdZghXwbL6
20   -17ENLRbvqVs7gNtiyLQb26mNMRxTzp7vGFn4Vm2b73GrKvPC4nnUBA5FYZkSclk2
21   -gpYt/QSZ7qj/YQZmzx31YSSRB8BOPGlsXV2ShWTzvVXfQoZ//ViDgYUlwh5hmaJo
22   -f1gG6MumwJOdcfGlS2BOkddcYpNTveQ4HNQdABEBAAG0MGlzdjpzcGIgT0JTIFBy
23   -b2plY3QgPGlzdjpzcGJAYnVpbGQub3BlbnN1c2Uub3JnPokBPgQTAQIAKAUCVET1
24   -wwIbAwUJBB6wAAYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQE7yUxPVcdQmz
25   -yAf/VIWhDdhOnF6XsR/USY57T1gYxFP3H+KchlCfvyFRc3lczZaDVQ57WkYlw7/2
26   -TN2TpN6JMHPbmltD0QuQg9GSulgp1A5A6R9yWolcZ0QLkSndHcjQciZ4hHcrqO+C
27   -Yb8fCMFJfejJ5FcTEVCBQgnazgI9qRyPAhEFZF3OCgQ1XOoaufojPGoKYoNXBOGI
28   -g2phdVE1glq6ZesKMagoFURGf4pm/Muq5pjK0DbF/iVOM9uVGDWLLpfVMicYiHSF
29   -YbqundUK6MzFlwuLSM0lXYuaaOF6rN3Gq03FVjNE5jbCUxJZAHSYF8KLZ57Opr8R
30   -KVogKh7j5fixFpDoydcPkS0Md4hGBBMRAgAGBQJURPXDAAoJEDswEbdrnWUjeLkA
31   -oKdP1tDhp1FzMFX+MTvEM/HyupveAKCHai4jMDBsjsoVJDobCws7IBLa3g==
32   -=v9lx
33   ------END PGP PUBLIC KEY BLOCK-----
34   -EOF
35   - apt-get update
36   -fi
37   -
38   -# pre-configure packages
39   -'debconf-set-selections' <<EOF
40   -postfix postfix/main_mailer_type select Internet Site
41   -
42   -mailman mailman/site_languages multiselect pt_BR (Brasilian Portuguese)
43   -mailman mailman/default_server_language select pt_BR (Brasilian Portuguese)
44   -EOF
45   -
46   -apt-get install -qy postfix mailman mailman-api
47   -
48   -LISTS_DOMAIN=lists.local
49   -TEST_LISTS='list01 list02 list03'
50   -
51   -#################################################################
52   -# mailman configuration
53   -#################################################################
54   -
55   -mailman_config() {
56   - local key="$1"
57   - local value="$2"
58   - local conffile=/etc/mailman/mm_cfg.py
59   - if grep -q "^$key\s*=" $conffile; then
60   - sed -i -e "s/^$key\s*=.*/$key = $value/" $conffile
61   - else
62   - echo "$key = $value" >> $conffile
63   - fi
64   -}
65   -
66   -mailman_config DEFAULT_EMAIL_HOST "'$LISTS_DOMAIN'"
67   -mailman_config MTA None
68   -mailman_config POSTFIX_STYLE_VIRTUAL_DOMAINS "['$LISTS_DOMAIN']"
69   -mailman_config DEB_LISTMASTER "'vagrant@localhost.localdomain'"
70   -
71   -# create mailman's meta-list
72   -sudo -u list newlist --quiet mailman vagrant@localhost.localdomain "pass-mailman"
73   -service mailman restart
74   -
75   -# create some sample lists
76   -for list in $TEST_LISTS; do
77   - if list_lists --bare | grep "$list"; then
78   - echo "$list already exists ..."
79   - else
80   - sudo -u list newlist --quiet "$list" vagrant@localhost.localdomain "pass-$list"
81   - echo 'vagrant@localhost.localdomain' | add_members -r - "$list"
82   - fi
83   -done
84   -
85   -#################################################################
86   -# mailman-api configuration
87   -#################################################################
88   -
89   -# FIXME binding to 0.0.0.0 is too liberal
90   -cat > /etc/default/mailman-api <<EOF
91   -OPTIONS='--bind=0.0.0.0:8010'
92   -EOF
93   -service mailman-api restart
94   -
95   -if ! grep -q MAILMAN_API_URL /etc/colab/settings.yaml; then
96   - echo "MAILMAN_API_URL: 'http://localhost:8010'" >> /etc/colab/settings.yaml
97   -fi
98   -
99   -
100   -#################################################################
101   -# postfix configuration
102   -#################################################################
103   -
104   -postconf relay_domains="$LISTS_DOMAIN"
105   -postconf transport_maps=hash:/etc/postfix/transport
106   -echo "$LISTS_DOMAIN mailman:" > /etc/postfix/transport
107   -postmap /etc/postfix/transport
108   -service postfix restart
109   -
110   -#################################################################
111   -# post a few message to each list
112   -#################################################################
113   -
114   -for list in $TEST_LISTS; do
115   - for i in $(seq 1 10); do
116   - (echo "this is a test ($i)") | mail -r vagrant@localhost.localdomain -s "test $i" "$list@lists.local"
117   - done
118   -done
vagrant.sh
... ... @@ -1,18 +0,0 @@
1   -#!/bin/sh
2   -
3   -set -e
4   -
5   -if [ -x /usr/bin/apt-get ]; then
6   - os='debian'
7   -fi
8   -
9   -if [ -x /usr/bin/yum ]; then
10   - os='centos'
11   -fi
12   -
13   -for script in $(find /vagrant/vagrant.d -name '*-generic' -or -name "*-$os" | sort); do
14   - (
15   - set -x
16   - $script
17   - )
18   -done
vagrant/provision.d/00-colab-generic 0 → 100755
... ... @@ -0,0 +1,7 @@
  1 +#!/bin/sh
  2 +
  3 +set -e
  4 +
  5 +# colab
  6 +/vagrant/colab/vagrant/bootstrap.sh
  7 +sudo -u vagrant -i /vagrant/colab/vagrant/provision.sh
... ...
vagrant/provision.d/10-mailman-debian 0 → 100755
... ... @@ -0,0 +1,118 @@
  1 +#!/bin/sh
  2 +
  3 +set -e
  4 +
  5 +export DEBIAN_FRONTEND=noninteractive
  6 +
  7 +if [ ! -f /etc/apt/sources.list.d/mailman-api.list ]; then
  8 + cat > /etc/apt/sources.list.d/mailman-api.list <<EOF
  9 +deb http://download.opensuse.org/repositories/isv:/spb:/mailman-api/Debian_7.0/ ./
  10 +deb-src http://download.opensuse.org/repositories/isv:/spb:/mailman-api/Debian_7.0/ ./
  11 +EOF
  12 +
  13 + apt-key add - <<EOF
  14 +-----BEGIN PGP PUBLIC KEY BLOCK-----
  15 +Version: GnuPG v2.0.15 (GNU/Linux)
  16 +
  17 +mQENBFRE9cMBCADl9VaZi3A4u5Fy2X9FP/18xkz2U1hsklLTgvwSuFT4gDCgtvD4
  18 +r3xAxnZ/52yLdAnrBratM1uC03WWifrCE+J5rImhiwP3itUzAGi/chmfVAuMBAVN
  19 +7rjBpurQoEuMDwec60XmS9XJ+BrcO+MyKaLTxKwy1KN+vaIM8Z7evpFdZghXwbL6
  20 +17ENLRbvqVs7gNtiyLQb26mNMRxTzp7vGFn4Vm2b73GrKvPC4nnUBA5FYZkSclk2
  21 +gpYt/QSZ7qj/YQZmzx31YSSRB8BOPGlsXV2ShWTzvVXfQoZ//ViDgYUlwh5hmaJo
  22 +f1gG6MumwJOdcfGlS2BOkddcYpNTveQ4HNQdABEBAAG0MGlzdjpzcGIgT0JTIFBy
  23 +b2plY3QgPGlzdjpzcGJAYnVpbGQub3BlbnN1c2Uub3JnPokBPgQTAQIAKAUCVET1
  24 +wwIbAwUJBB6wAAYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQE7yUxPVcdQmz
  25 +yAf/VIWhDdhOnF6XsR/USY57T1gYxFP3H+KchlCfvyFRc3lczZaDVQ57WkYlw7/2
  26 +TN2TpN6JMHPbmltD0QuQg9GSulgp1A5A6R9yWolcZ0QLkSndHcjQciZ4hHcrqO+C
  27 +Yb8fCMFJfejJ5FcTEVCBQgnazgI9qRyPAhEFZF3OCgQ1XOoaufojPGoKYoNXBOGI
  28 +g2phdVE1glq6ZesKMagoFURGf4pm/Muq5pjK0DbF/iVOM9uVGDWLLpfVMicYiHSF
  29 +YbqundUK6MzFlwuLSM0lXYuaaOF6rN3Gq03FVjNE5jbCUxJZAHSYF8KLZ57Opr8R
  30 +KVogKh7j5fixFpDoydcPkS0Md4hGBBMRAgAGBQJURPXDAAoJEDswEbdrnWUjeLkA
  31 +oKdP1tDhp1FzMFX+MTvEM/HyupveAKCHai4jMDBsjsoVJDobCws7IBLa3g==
  32 +=v9lx
  33 +-----END PGP PUBLIC KEY BLOCK-----
  34 +EOF
  35 + apt-get update
  36 +fi
  37 +
  38 +# pre-configure packages
  39 +'debconf-set-selections' <<EOF
  40 +postfix postfix/main_mailer_type select Internet Site
  41 +
  42 +mailman mailman/site_languages multiselect pt_BR (Brasilian Portuguese)
  43 +mailman mailman/default_server_language select pt_BR (Brasilian Portuguese)
  44 +EOF
  45 +
  46 +apt-get install -qy postfix mailman mailman-api
  47 +
  48 +LISTS_DOMAIN=lists.local
  49 +TEST_LISTS='list01 list02 list03'
  50 +
  51 +#################################################################
  52 +# mailman configuration
  53 +#################################################################
  54 +
  55 +mailman_config() {
  56 + local key="$1"
  57 + local value="$2"
  58 + local conffile=/etc/mailman/mm_cfg.py
  59 + if grep -q "^$key\s*=" $conffile; then
  60 + sed -i -e "s/^$key\s*=.*/$key = $value/" $conffile
  61 + else
  62 + echo "$key = $value" >> $conffile
  63 + fi
  64 +}
  65 +
  66 +mailman_config DEFAULT_EMAIL_HOST "'$LISTS_DOMAIN'"
  67 +mailman_config MTA None
  68 +mailman_config POSTFIX_STYLE_VIRTUAL_DOMAINS "['$LISTS_DOMAIN']"
  69 +mailman_config DEB_LISTMASTER "'vagrant@localhost.localdomain'"
  70 +
  71 +# create mailman's meta-list
  72 +sudo -u list newlist --quiet mailman vagrant@localhost.localdomain "pass-mailman"
  73 +service mailman restart
  74 +
  75 +# create some sample lists
  76 +for list in $TEST_LISTS; do
  77 + if list_lists --bare | grep "$list"; then
  78 + echo "$list already exists ..."
  79 + else
  80 + sudo -u list newlist --quiet "$list" vagrant@localhost.localdomain "pass-$list"
  81 + echo 'vagrant@localhost.localdomain' | add_members -r - "$list"
  82 + fi
  83 +done
  84 +
  85 +#################################################################
  86 +# mailman-api configuration
  87 +#################################################################
  88 +
  89 +# FIXME binding to 0.0.0.0 is too liberal
  90 +cat > /etc/default/mailman-api <<EOF
  91 +OPTIONS='--bind=0.0.0.0:8010'
  92 +EOF
  93 +service mailman-api restart
  94 +
  95 +if ! grep -q MAILMAN_API_URL /etc/colab/settings.yaml; then
  96 + echo "MAILMAN_API_URL: 'http://localhost:8010'" >> /etc/colab/settings.yaml
  97 +fi
  98 +
  99 +
  100 +#################################################################
  101 +# postfix configuration
  102 +#################################################################
  103 +
  104 +postconf relay_domains="$LISTS_DOMAIN"
  105 +postconf transport_maps=hash:/etc/postfix/transport
  106 +echo "$LISTS_DOMAIN mailman:" > /etc/postfix/transport
  107 +postmap /etc/postfix/transport
  108 +service postfix restart
  109 +
  110 +#################################################################
  111 +# post a few message to each list
  112 +#################################################################
  113 +
  114 +for list in $TEST_LISTS; do
  115 + for i in $(seq 1 10); do
  116 + (echo "this is a test ($i)") | mail -r vagrant@localhost.localdomain -s "test $i" "$list@lists.local"
  117 + done
  118 +done
... ...
vagrant/provision.sh 0 → 100755
... ... @@ -0,0 +1,18 @@
  1 +#!/bin/sh
  2 +
  3 +set -e
  4 +
  5 +if [ -x /usr/bin/apt-get ]; then
  6 + os='debian'
  7 +fi
  8 +
  9 +if [ -x /usr/bin/yum ]; then
  10 + os='centos'
  11 +fi
  12 +
  13 +for script in $(find /vagrant/vagrant/provision.d -name '*-generic' -or -name "*-$os" | sort); do
  14 + (
  15 + set -x
  16 + $script
  17 + )
  18 +done
... ...