Skip to content

Commit

Permalink
Merge pull request #121 from folio-org/FOLIO-1355-Q2-2018
Browse files Browse the repository at this point in the history
Q2-2018 Release
  • Loading branch information
wafschneider authored Jul 20, 2018
2 parents 183fafd + 181c79a commit 0b2de69
Show file tree
Hide file tree
Showing 8 changed files with 415 additions and 2 deletions.
16 changes: 16 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,22 @@ Vagrant.configure(2) do |config|
end
end

config.vm.define "build_release", autostart: false do |build_release|
build_release.vm.box = "debian/contrib-jessie64"
build_release.vm.provider "virtualbox" do |vr|
vr.memory = 10240
end
build_release.vm.network "forwarded_port", guest: 9130, host: 9130
build_release.vm.network "forwarded_port", guest: 3000, host: 3000
build_release.vm.provision "ansible" do |ansible|
ansible.playbook = "folio.yml"
ansible.groups = {
"vagrant" => ["build_release"],
"release" => ["build_release"]
}
end
end

config.vm.define "build_curriculum", autostart: false do |build_curriculum|
build_curriculum.vm.box = "debian/contrib-jessie64"
build_curriculum.vm.network "forwarded_port", guest: 9130, host: 9130
Expand Down
59 changes: 57 additions & 2 deletions folio.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# Ansible playbook to deploy Okapi and FOLIO modules
# Provision a host as a backend FOLIO system
- hosts: stable:stable-backend:testing:snapshot:minimal
- hosts: stable:stable-backend:testing:snapshot:release:minimal
roles:
- common
- postgresql
Expand Down Expand Up @@ -29,6 +29,16 @@
- create-tenant-admin
- tenant-admin-permissions

- name: Configure release build
hosts: release
roles:
- docker-engine
- okapi-pull
- tenant-data
- okapi-tenant-modules
- create-tenant-admin
- tenant-admin-permissions

# Sample data for stable
- name: Load sample data for stable build
hosts: stable:stable-backend
Expand Down Expand Up @@ -92,6 +102,51 @@
- { load_endpoint: /vendor, fileglob: sample-data/vendors/*.json }
- mod-auth-demo-users

# Sample data for release build
# Most of the reference data is loaded from folio-install Q2-2018 release
# There is a risk that the sample data not stored in folio-install will become incompatible
- name: Load sample data for release build
hosts: release
roles:
- role: module-sample-data
module_name: folio-install
repository: "https://github.com/folio-org/folio-install"
module_version: Q2-2018
files:
- { load_endpoint: /classification-types, fileglob: reference-data/classification-types/*.json, dup_override: 400 }
- { load_endpoint: /contributor-name-types, fileglob: reference-data/contributor-name-types/*.json, dup_override: 400 }
- { load_endpoint: /contributor-types, fileglob: reference-data/contributor-types/*.json, dup_override: 400 }
- { load_endpoint: /identifier-types, fileglob: reference-data/identifier-types/*.json, dup_override: 400 }
- { load_endpoint: /instance-formats, fileglob: reference-data/instance-formats/*.json, dup_override: 400 }
- { load_endpoint: /instance-types, fileglob: reference-data/instance-types/*.json, dup_override: 400 }
- { load_endpoint: /loan-types, fileglob: reference-data/loan-types/*.json, dup_override: 400 }
- { load_endpoint: /location-units/institutions, fileglob: reference-data/location-units/institutions/*.json }
- { load_endpoint: /location-units/campuses, fileglob: reference-data/location-units/campuses/*.json }
- { load_endpoint: /location-units/libraries, fileglob: reference-data/location-units/libraries/*.json }
- { load_endpoint: /locations, fileglob: reference-data/locations/*.json }
- { load_endpoint: /material-types, fileglob: reference-data/material-types/*.json }
- { load_endpoint: /platforms, fileglob: reference-data/platforms/*.json, dup_override: 400 }
- { load_endpoint: /service-points, fileglob: reference-data/service-points/*.json }
- { load_endpoint: /loan-policy-storage/loan-policies, fileglob: reference-data/loan-policy-storage/loan-policies/*.json, dup_override: 500 }
- { load_endpoint: /loan-rules-storage, fileglob: reference-data/loan-rules-storage/*.json, http_method: PUT, updated_code: 204 }
- role: module-sample-data
module_name: mod-inventory-storage
repository: "https://github.com/folio-org/mod-inventory-storage"
duplicate_key_error: 400
files:
- { load_endpoint: /instance-storage/instances, fileglob: sample-data/instances/*.json }
- { load_endpoint: /instance-storage/instances, fileglob: sample-data/instances/*.json }
- { load_endpoint: /holdings-storage/holdings, fileglob: sample-data/holdingsrecords/*.json }
- { load_endpoint: /item-storage/items, fileglob: sample-data/items/*.json }
- mod-inventory-mods
- mod-circulation-sample-data
- role: module-sample-data
module_name: mod-vendors
repository: "https://github.com/folio-org/mod-vendors"
files:
- { load_endpoint: /vendor, fileglob: sample-data/vendors/*.json }
- mod-auth-demo-users

# Set up stripes
- name: Build stripes webpack, assign permissions
hosts: stripes-build
Expand All @@ -107,7 +162,7 @@
- tenant-admin-permissions

- name: Build Stripes container
hosts: snapshot
hosts: snapshot:release
roles:
- stripes-docker

Expand Down
21 changes: 21 additions & 0 deletions group_vars/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# Variables for building a FOLIO release
okapi_pull: true
okapi_pull_timeout: 600
auth_required: true
load_mods_larger: true
enable_okapi: true
deploy_url: https://cdn.rawgit.com/folio-org/folio-testing-platform/Q2-2018/okapi-install.json
enable_url: https://cdn.rawgit.com/folio-org/folio-testing-platform/Q2-2018/stripes-install.json

# Variables for building UI
stripes_github_project: https://github.com/folio-org/folio-testing-platform
stripes_github_version: Q2-2018
folio_npm_repo: npm-folioci
okapi_register_modules: no
okapi_enable_modules: no
platform_remove_lock: no
with_sourcemap: no

# Metadata for CI build
version: Q2-2018
61 changes: 61 additions & 0 deletions roles/okapi-tenant-modules/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# okapi-tenant-modules

Ansible role for deploying and enabling modules for a tenant based on an install.json file.

## Prerequisites

* A running Okapi system with:
* A database available for module data (you can use the `postgresql` role to provision a database and create an admin user).
* Registered module descriptors for all modules to be deployed. All module descriptors must contain a launch descriptor telling Okapi how to deploy the module (you can use the `okapi-pull` role to populate the module registry).
* The ability to deploy modules, either using `exec` or Docker (you can use the `docker-engine` role to install Docker on the target system).
* A tenant (you can use the `tenant-data` role to create a tenant).

* An install file containing a JSON array of modules for posting to the `/_/proxy/tenants/<tenantId>/install?deploy` endpoint for deployment. This can optionally point to a URL. A [sample file](roles/okapi-install.json) is available in the `files` directory of this role.

* An install file containing a JSON array of modules for posting to the `/_/proxy/tenants/<tenantId>/install` endpoint to enable the modules without deployment. This can optionally point to a URL. A [sample file](roles/stripes-install.json) is available in the `files` directory of this role.

## Usage

Invoke the role in a playbook, e.g.:

```yaml
- hosts: my-folio-test
roles:
- postgresql
- docker-engine
- okapi-pull
- tenant-data
- okapi-tenant-modules
```
## Variables
```yaml
---
# defaults
create_db: yes
pg_admin_user: folio_admin
pg_admin_password: folio_admin
pg_host: "{{ ansible_default_ipv4.address }}"
pg_port: 5432
pg_max_pool_size: 5
module_database: okapi_modules
okapi_port: 9130
okapi_url: "http://{{ ansible_default_ipv4.address }}:{{ okapi_port }}"
module_env:
- { name: db.host, value: "{{ pg_host }}" }
- { name: db.port, value: "{{ pg_port }}" }
- { name: db.database, value: "{{ module_database }}" }
- { name: db.username, value: "{{ pg_admin_user }}" }
- { name: db.password, value: "{{ pg_admin_password }}" }
- { name: db.maxPoolSize, value: "{{ pg_max_pool_size }}" }

tenant: diku
deploy_timeout: 600

# Define one or more of these variables to post install JSON to Okapi. They are posted in the order listed here.
# deploy_file:
# deploy_url:
# enable_file:
# enable_url:
```
27 changes: 27 additions & 0 deletions roles/okapi-tenant-modules/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
# defaults
create_db: yes
pg_admin_user: folio_admin
pg_admin_password: folio_admin
pg_host: "{{ ansible_default_ipv4.address }}"
pg_port: 5432
pg_max_pool_size: 5
module_database: okapi_modules
okapi_port: 9130
okapi_url: "http://{{ ansible_default_ipv4.address }}:{{ okapi_port }}"
module_env:
- { name: db.host, value: "{{ pg_host }}" }
- { name: db.port, value: "{{ pg_port }}" }
- { name: db.database, value: "{{ module_database }}" }
- { name: db.username, value: "{{ pg_admin_user }}" }
- { name: db.password, value: "{{ pg_admin_password }}" }
- { name: db.maxPoolSize, value: "{{ pg_max_pool_size }}" }

tenant: diku
deploy_timeout: 600

# Define one or more of these variables to post install JSON to Okapi. They are posted in the order listed here.
# deploy_file:
# deploy_url:
# enable_file:
# enable_url:
78 changes: 78 additions & 0 deletions roles/okapi-tenant-modules/files/okapi-install.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
[
{
"action": "enable",
"id": "mod-permissions-5.2.5-SNAPSHOT.22"
},
{
"action": "enable",
"id": "mod-users-15.1.0-SNAPSHOT.36"
},
{
"action": "enable",
"id": "mod-login-4.1.0-SNAPSHOT.12"
},
{
"action": "enable",
"id": "mod-users-bl-3.0.0-SNAPSHOT.17"
},
{
"action": "enable",
"id": "mod-authtoken-1.4.1-SNAPSHOT.21"
},
{
"action": "enable",
"id": "mod-configuration-4.0.4-SNAPSHOT.36"
},
{
"action": "enable",
"id": "mod-calendar-1.0.0-SNAPSHOT.37"
},
{
"action": "enable",
"id": "mod-circulation-storage-5.3.0-SNAPSHOT.93"
},
{
"action": "enable",
"id": "mod-inventory-storage-12.1.0-SNAPSHOT.128"
},
{
"action": "enable",
"id": "mod-circulation-10.7.0-SNAPSHOT.160"
},
{
"action": "enable",
"id": "mod-kb-ebsco-0.1.1-SNAPSHOT.112"
},
{
"action": "enable",
"id": "mod-inventory-9.1.0-SNAPSHOT.88"
},
{
"action": "enable",
"id": "mod-login-saml-1.1.0-SNAPSHOT.23"
},
{
"action": "enable",
"id": "mod-notify-1.1.7-SNAPSHOT.46"
},
{
"action": "enable",
"id": "mod-notes-2.1.1-SNAPSHOT.57"
},
{
"action": "enable",
"id": "mod-codex-mux-2.2.2-SNAPSHOT.55"
},
{
"action": "enable",
"id": "mod-vendors-1.0.1-SNAPSHOT.20"
},
{
"action": "enable",
"id": "mod-codex-inventory-1.2.0-SNAPSHOT.53"
},
{
"action": "enable",
"id": "mod-codex-ekb-1.0.1-SNAPSHOT.64"
}
]
58 changes: 58 additions & 0 deletions roles/okapi-tenant-modules/files/stripes-install.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[
{
"action": "enable",
"id": "folio_stripes-core-2.10.2000305"
},
{
"action": "enable",
"id": "folio_calendar-1.0.100018"
},
{
"action": "enable",
"id": "folio_checkin-1.1.100049"
},
{
"action": "enable",
"id": "folio_checkout-1.1.4000158"
},
{
"action": "enable",
"id": "folio_circulation-1.1.200089"
},
{
"action": "enable",
"id": "folio_developer-1.3.100015"
},
{
"action": "enable",
"id": "folio_eholdings-0.1.1000269"
},
{
"action": "enable",
"id": "folio_inventory-1.0.3000205"
},
{
"action": "enable",
"id": "folio_organization-2.2.100088"
},
{
"action": "enable",
"id": "folio_plugin-find-user-1.1.100021"
},
{
"action": "enable",
"id": "folio_requests-1.1.4000103"
},
{
"action": "enable",
"id": "folio_search-1.1.100085"
},
{
"action": "enable",
"id": "folio_users-2.12.2000354"
},
{
"action": "enable",
"id": "folio_vendors-0.1.100016"
}
]
Loading

0 comments on commit 0b2de69

Please sign in to comment.