This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
samvera-hyrax-ubuntu.json
154 lines (154 loc) · 6.69 KB
/
samvera-hyrax-ubuntu.json
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
{
"variables": {
"build_version": "",
"aws_access_key": "",
"aws_secret_key": "",
"aws_region": "",
"timezone": "",
"hostname": "",
"domain": "",
"project_name": "",
"project_owner": "",
"project_version": "",
"geonames_username": "",
"cap_deployment": "",
"vagrant_cloud_token": "",
"vagrant_cloud_user": "",
"linux_distro": "",
"aws_source_ami": "{{ user `project_name` }}-base-{{ user `linux_distro` }} *",
"aws_ami_owner": "self",
"vb_memory": "4096",
"vb_cpu_cores": "2"
},
"builders": [{
"type": "amazon-ebs",
"name": "ami",
"access_key": "{{ user `aws_access_key` }}",
"secret_key": "{{ user `aws_secret_key` }}",
"region": "{{ user `aws_region` }}",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "{{ user `aws_source_ami` }}",
"root-device-type": "ebs"
},
"owners": ["{{ user `aws_ami_owner` }}"],
"most_recent": true
},
"force_deregister": true,
"force_delete_snapshot": true,
"instance_type": "t2.medium",
"ssh_username": "ubuntu",
"ami_name": "{{ user `project_name` }}-hyrax-{{ user `linux_distro` }} {{ timestamp }}",
"ami_description": "A Hyrax AMI for {{ user `project_name` }} ({{ user `linux_distro` }})"
},
{
"type": "virtualbox-ovf",
"name": "box",
"source_path": "builds/virtualbox/{{ user `project_name` }}-base-{{ user `linux_distro` }}.ovf",
"headless": true,
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_pty": true,
"ssh_wait_timeout": "10000s",
"shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",
"vm_name": "{{ user `project_name` }}-hyrax-{{ user `linux_distro` }}",
"guest_additions_mode": "disable",
"vboxmanage": [
["modifyvm", "{{ .Name }}", "--memory", "{{ user `vb_memory` }}"],
["modifyvm", "{{ .Name }}", "--cpus", "{{ user `vb_cpu_cores` }}"]
]
}
],
"provisioners": [{
"type": "shell",
"only": ["ami", "box"],
"execute_command": "echo 'vagrant' | {{ .Vars }} /usr/bin/sudo -S -E bash '{{ .Path }}'",
"script": "scripts/setup-hyrax.sh",
"environment_vars": [
"SECRET_KEY_BASE=asdf",
"DB_USERNAME={{ user `samvera_db_user` }}",
"DB_PASSWORD={{ user `samvera_db_password` }}",
"DB_NAME={{ user `project_name` }}",
"PROJECT_OWNER={{ user `project_owner` }}",
"PROJECT_NAME={{ user `project_name` }}",
"GITHUB_BRANCH={{ user `project_version` }}",
"GEONAMES_USERNAME={{ user `geonames_username` }}",
"ADMIN_PASSWORD={{ user `samvera_admin_password` }}",
"FEDORA_URL=http://localhost:8080/fedora/rest",
"SOLR_URL=http://localhost:8983/solr/{{ user `project_name` }}"
]
},
{
"type": "ansible-local",
"only": ["box"],
"playbook_file": "ansible/playbooks/samvera-hyrax-ubuntu.yml",
"galaxy_file": "ansible/requirements/ubuntu.yml",
"extra_arguments": [
"-e \" samvera_db_user={{ user `samvera_db_user` }} samvera_db_password={{ user `samvera_db_password` }}\"",
"-e \"postgres_pass={{ user `root_db_password` }} timezone={{ user `timezone` }} hostname={{ user `hostname` }}\"",
"-e \"domain={{ user `domain` }} project_name={{ user `project_name` }} project_owner={{ user `project_owner` }}\"",
"-e \"cap_deployment={{ user `cap_deployment` }} project_version={{ user `project_version` }}\"",
"-e \"ansible_sudo_pass=vagrant\""
]
},
{
"type": "ansible-local",
"only": ["ami"],
"playbook_file": "ansible/playbooks/samvera-hyrax-ubuntu.yml",
"galaxy_file": "ansible/requirements/ubuntu.yml",
"extra_arguments": [
"-e \"samvera_db_user={{ user `samvera_db_user` }} samvera_db_password={{ user `samvera_db_password` }}\"",
"-e \"postgres_pass={{ user `root_db_password` }} timezone={{ user `timezone` }} hostname={{ user `hostname` }}\"",
"-e \"domain={{ user `domain` }} project_name={{ user `project_name` }} project_owner={{ user `project_owner` }}\"",
"-e \"cap_deployment={{ user `cap_deployment` }} project_version={{ user `project_version` }}\"", "--sudo"
]
},
{
"type": "shell",
"only": ["box"],
"execute_command": "echo 'vagrant' | {{ .Vars }} /usr/bin/sudo -S -E bash '{{ .Path }}'",
"scripts": [
"scripts/hyrax-dev-config.sh",
"scripts/git-config-ssh.sh"
],
"environment_vars": [
"PROJECT_NAME={{ user `project_name` }}",
"ROOT_DB_PASSWORD={{ user `root_db_password` }}",
"ADMIN_PASSWORD={{ user `samvera_admin_password` }}"
]
},
{
"type": "shell",
"only": ["ami", "box"],
"execute_command": "echo 'vagrant' | {{ .Vars }} /usr/bin/sudo -S -E bash '{{ .Path }}'",
"scripts": [
"scripts/cleanup.sh"
],
"environment_vars": ["PROJECT_NAME={{ user `project_name` }}"]
},
{
"type": "shell-local",
"only": ["box"],
"command": "PROJECT_NAME={{ user `project_name` }} PROJECT_OWNER={{ user `project_owner` }} scripts/vagrant-config.sh"
}
],
"post-processors": [
[{
"type": "vagrant",
"only": ["box"],
"include": "vagrant/hyrax/vagrant-config.yaml",
"output": "builds/vagrant/{{ user `project_name` }}-{{ user `linux_distro` }}.box",
"vagrantfile_template": "vagrant/hyrax/Vagrantfile"
},
{
"type": "vagrant-cloud",
"only": ["box"],
"box_tag": "{{ user `vagrant_cloud_user` }}/{{ user `project_name` }}-{{ user `linux_distro` }}",
"access_token": "{{ user `vagrant_cloud_token` }}",
"version": "{{ user `build_version` }}-{{ timestamp }}"
}
]
]
}