et_full_system 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rspec +3 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +115 -0
- data/LICENSE.txt +21 -0
- data/README.md +194 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docker/Dockerfile +103 -0
- data/docker/docker-compose.yml +95 -0
- data/et_full_system.gemspec +41 -0
- data/exe/et_full_system +22 -0
- data/foreman/.env +32 -0
- data/foreman/.foreman +1 -0
- data/foreman/Procfile +12 -0
- data/foreman/et1.env +16 -0
- data/foreman/et3.env +3 -0
- data/foreman/et_admin.env +8 -0
- data/foreman/et_api.env +7 -0
- data/foreman/et_atos.env +3 -0
- data/foreman/mailhog.env +3 -0
- data/foreman/minio.env +2 -0
- data/foreman/ports.env +4 -0
- data/foreman/s3/.env +5 -0
- data/foreman/traefik.json +188 -0
- data/foreman/traefik.toml +38 -0
- data/lib/et_full_system/cli/docker/server.rb +33 -0
- data/lib/et_full_system/cli/docker.rb +64 -0
- data/lib/et_full_system/cli/local/file_storage.rb +60 -0
- data/lib/et_full_system/cli/local.rb +303 -0
- data/lib/et_full_system/cli.rb +2 -0
- data/lib/et_full_system/version.rb +3 -0
- data/lib/et_full_system.rb +5 -0
- data/shell_scripts/docker_bootstrap.sh +20 -0
- data/shell_scripts/run_foreman +32 -0
- metadata +188 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: da3986668454b7fc15815045d987a9d673de349f70d36e54ff479c8045bfd180
|
4
|
+
data.tar.gz: 3ad3959a8f1a3e3d82677cad4a0a164e58eb6a6e29931e1f6e2fe33c3ab589a1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0e8d1c984052513bb0f779a95f885cc1cc822fb338accc100fb4893ed5beb7287eed3584109e727b5dd2aa0bac0f9e30bffd7bcf420906c0e84919ed78241482
|
7
|
+
data.tar.gz: bdb4d8160d744f838af89ff06e8f75accac3a66195a39ca4ed40bb86ab61280dd8917617694f755ba7be2b8c00005b73211fc338fa6f8e88e00e6ca6c36a5c54
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.1
|
data/.travis.yml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
deploy:
|
2
|
+
provider: rubygems
|
3
|
+
api_key:
|
4
|
+
secure: ayNLN94W/7OLlrbpOgszFYfx7cvhAYHLcW9NZG/gN4N0kUiwZ5f7vGGT2YDPSjiXdxLDnZfCdO5gmMjP59XyWqq4n3HxG5PipsZ5HjOp+nuUh/PzPB7YXizFCjGm9ggIUrBcE3pdrD7hYuKmMlnDjnAcgOQn+zw+QHNGmV3mJhSNuo+Vp/GotU8aAITHCQZUsSMQZQMGjoGG5yf+BAhJSf+mpPBNIoqdI/di8W2rzynwQJeN19/O7M1evAyt/vFVgNlwBE2YaEc7RWn3fhWV6O7nJSFTbGEv5gsMZYPRRWrw2DvBfnhCD4T3jC/hfuMybOUNbF9waktaxKeWVvKiYqQsDPYoh/3H/PViU/sFwKbU2jsxqAUkIBA5yhQXYk4FcKBUInHAIQE3dGy0eBa+hGC0u6sC9mwy3OFWiAfIPU8Fq+dW6e8N7ebJ1NW2UOxJLZjO2AS4LB2A2pMn/wTwm+ru3gVWqM3CF6vr4nc/hpj7DIFuI0OVDLNLeBzfV0Q8frxW8HoYgO2S/7RKXlT5PvwE+6pES2EEADa6LblZCVv6pu0VzVmuUNJ51HkUNYuCHIubXpyJBJGaFpG35q+u05Dh6MPVb+ZtSdNlG9Mw4Rcwpn6rE77+Mkh0TQ1q39SSO1odI6wONi6KTatuK56tV4tTL1fQBgtzYA4Gfl6z+OA=
|
5
|
+
on:
|
6
|
+
tags: true
|
7
|
+
gem: et_full_system
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at gary.taylor@hismessages.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in et_full_system.gemspec
|
6
|
+
gem 'et_fake_acas_server', git: 'https://github.com/ministryofjustice/et_fake_acas_server.git', ref: 'bca2a727c0bd8a16915eee499d0bb3e97ddc5cf0'
|
7
|
+
gemspec
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
GIT
|
2
|
+
remote: https://github.com/ministryofjustice/et_fake_acas_server.git
|
3
|
+
revision: bca2a727c0bd8a16915eee499d0bb3e97ddc5cf0
|
4
|
+
ref: bca2a727c0bd8a16915eee499d0bb3e97ddc5cf0
|
5
|
+
specs:
|
6
|
+
et_fake_acas_server (0.1.0)
|
7
|
+
activesupport (~> 5.2)
|
8
|
+
nokogiri (~> 1.8, >= 1.8.2)
|
9
|
+
puma (~> 3.12)
|
10
|
+
ruby-mcrypt (~> 0.2)
|
11
|
+
sinatra (~> 2.0, >= 2.0.3)
|
12
|
+
sinatra-contrib (~> 2.0)
|
13
|
+
|
14
|
+
PATH
|
15
|
+
remote: .
|
16
|
+
specs:
|
17
|
+
et_full_system (0.1.23)
|
18
|
+
aws-sdk-s3 (~> 1.9)
|
19
|
+
azure-storage (~> 0.15.0.preview)
|
20
|
+
dotenv (~> 2.7, >= 2.7.2)
|
21
|
+
httparty (~> 0.16)
|
22
|
+
thor (~> 0.20)
|
23
|
+
|
24
|
+
GEM
|
25
|
+
remote: https://rubygems.org/
|
26
|
+
specs:
|
27
|
+
activesupport (5.2.3)
|
28
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
29
|
+
i18n (>= 0.7, < 2)
|
30
|
+
minitest (~> 5.1)
|
31
|
+
tzinfo (~> 1.1)
|
32
|
+
aws-eventstream (1.0.3)
|
33
|
+
aws-partitions (1.154.0)
|
34
|
+
aws-sdk-core (3.48.6)
|
35
|
+
aws-eventstream (~> 1.0, >= 1.0.2)
|
36
|
+
aws-partitions (~> 1.0)
|
37
|
+
aws-sigv4 (~> 1.1)
|
38
|
+
jmespath (~> 1.0)
|
39
|
+
aws-sdk-kms (1.17.0)
|
40
|
+
aws-sdk-core (~> 3, >= 3.48.2)
|
41
|
+
aws-sigv4 (~> 1.1)
|
42
|
+
aws-sdk-s3 (1.36.1)
|
43
|
+
aws-sdk-core (~> 3, >= 3.48.2)
|
44
|
+
aws-sdk-kms (~> 1)
|
45
|
+
aws-sigv4 (~> 1.0)
|
46
|
+
aws-sigv4 (1.1.0)
|
47
|
+
aws-eventstream (~> 1.0, >= 1.0.2)
|
48
|
+
azure-core (0.1.15)
|
49
|
+
faraday (~> 0.9)
|
50
|
+
faraday_middleware (~> 0.10)
|
51
|
+
nokogiri (~> 1.6)
|
52
|
+
azure-storage (0.15.0.preview)
|
53
|
+
azure-core (~> 0.1)
|
54
|
+
faraday (~> 0.9)
|
55
|
+
faraday_middleware (~> 0.10)
|
56
|
+
nokogiri (~> 1.6, >= 1.6.8)
|
57
|
+
backports (3.13.0)
|
58
|
+
concurrent-ruby (1.1.5)
|
59
|
+
dotenv (2.7.2)
|
60
|
+
faraday (0.15.4)
|
61
|
+
multipart-post (>= 1.2, < 3)
|
62
|
+
faraday_middleware (0.13.1)
|
63
|
+
faraday (>= 0.7.4, < 1.0)
|
64
|
+
httparty (0.17.0)
|
65
|
+
mime-types (~> 3.0)
|
66
|
+
multi_xml (>= 0.5.2)
|
67
|
+
i18n (1.6.0)
|
68
|
+
concurrent-ruby (~> 1.0)
|
69
|
+
jmespath (1.4.0)
|
70
|
+
mime-types (3.2.2)
|
71
|
+
mime-types-data (~> 3.2015)
|
72
|
+
mime-types-data (3.2019.0331)
|
73
|
+
mini_portile2 (2.4.0)
|
74
|
+
minitest (5.11.3)
|
75
|
+
multi_json (1.13.1)
|
76
|
+
multi_xml (0.6.0)
|
77
|
+
multipart-post (2.0.0)
|
78
|
+
mustermann (1.0.3)
|
79
|
+
nokogiri (1.10.2)
|
80
|
+
mini_portile2 (~> 2.4.0)
|
81
|
+
puma (3.12.1)
|
82
|
+
rack (2.0.7)
|
83
|
+
rack-protection (2.0.5)
|
84
|
+
rack
|
85
|
+
rake (10.5.0)
|
86
|
+
ruby-mcrypt (0.2.0)
|
87
|
+
sinatra (2.0.5)
|
88
|
+
mustermann (~> 1.0)
|
89
|
+
rack (~> 2.0)
|
90
|
+
rack-protection (= 2.0.5)
|
91
|
+
tilt (~> 2.0)
|
92
|
+
sinatra-contrib (2.0.5)
|
93
|
+
backports (>= 2.8.2)
|
94
|
+
multi_json
|
95
|
+
mustermann (~> 1.0)
|
96
|
+
rack-protection (= 2.0.5)
|
97
|
+
sinatra (= 2.0.5)
|
98
|
+
tilt (>= 1.3, < 3)
|
99
|
+
thor (0.20.3)
|
100
|
+
thread_safe (0.3.6)
|
101
|
+
tilt (2.0.9)
|
102
|
+
tzinfo (1.2.5)
|
103
|
+
thread_safe (~> 0.1)
|
104
|
+
|
105
|
+
PLATFORMS
|
106
|
+
ruby
|
107
|
+
|
108
|
+
DEPENDENCIES
|
109
|
+
bundler (~> 1.16)
|
110
|
+
et_fake_acas_server!
|
111
|
+
et_full_system!
|
112
|
+
rake (~> 10.0)
|
113
|
+
|
114
|
+
BUNDLED WITH
|
115
|
+
1.17.3
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Gary Taylor
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,194 @@
|
|
1
|
+
# EtFullSystem
|
2
|
+
|
3
|
+
This gem is used to boot up all of the components of the Employment Tribunals system ready for testing or other purposes.
|
4
|
+
|
5
|
+
It can be used in the root directory of the 'et full system' repository (https://github.com/ministryofjustice/et-full-system) to run
|
6
|
+
the server side to allow automated testing.
|
7
|
+
|
8
|
+
But, in general - it can be used anywhere - as long as a certain file structure exists for the 5 services. This structure is
|
9
|
+
|
10
|
+
systems/et1 (https://github.com/ministryofjustice/atet)
|
11
|
+
systems/et3 (https://github.com/ministryofjustice/et3)
|
12
|
+
systems/admin (https://github.com/ministryofjustice/et-admin)
|
13
|
+
systems/atos (https://github.com/ministryofjustice/et_atos_file_transfer)
|
14
|
+
systems/api (https://github.com/ministryofjustice/et_api)
|
15
|
+
|
16
|
+
The system works by placing a reverse proxy (traefik https://github.com/containous/traefik) in front of the 5 services
|
17
|
+
so that all services can be accessed using a standard subdomain based url system which looks like this
|
18
|
+
|
19
|
+
et1.et.127.0.0.1.nip.io:3100 For ET1
|
20
|
+
et3.et.127.0.0.1.nip.io:3100 For ET3
|
21
|
+
admin.et.127.0.0.1.nip.io:3100 For Admin
|
22
|
+
et1.et.127.0.0.1.nip.io:3100 For ET1
|
23
|
+
et1.et.127.0.0.1.nip.io:3100 For ET1
|
24
|
+
|
25
|
+
The services are run all together using 'forego' (like foreman - runs a Procfile) and once the port number for each
|
26
|
+
service is known, traefik is told about it - so it all just works.
|
27
|
+
|
28
|
+
There are other services as well that are run - which are there for testing - these are :-
|
29
|
+
|
30
|
+
* et-fake-acas-server (https://github.com/ministryofjustice/et_fake_acas_server) - Provides a fake ACAS server with predictable responses based on various special certificate numbers
|
31
|
+
* mailhog (https://github.com/mailhog/MailHog) - Captures all emails sent to allow the test suite or the developer to view them and check them
|
32
|
+
* minio (https://github.com/minio/minio) - A local amazon S3 server to avoid having S3 credentials for every environment
|
33
|
+
* azurite (https://github.com/Azure/Azurite) - A local azure blob server to avoid having azure credentials for every environment
|
34
|
+
|
35
|
+
|
36
|
+
## Pre Requisites
|
37
|
+
|
38
|
+
### Running With Docker
|
39
|
+
|
40
|
+
If you want to use the docker setup, it keeps everything inside a container and therefore doesnt interfere with your
|
41
|
+
system configuration at all. All you need is
|
42
|
+
|
43
|
+
* Docker
|
44
|
+
* Docker Compose
|
45
|
+
|
46
|
+
### Running Without Docker
|
47
|
+
|
48
|
+
To run without docker, you need a few tools
|
49
|
+
|
50
|
+
* Traefik (https://traefik.io)
|
51
|
+
* Mailhog (https://github.com/mailhog/MailHog)
|
52
|
+
* Minio (https://github.com/minio/minio)
|
53
|
+
* Azurite (https://github.com/Azure/Azurite)
|
54
|
+
|
55
|
+
I will not include installation instructions here for them - please visit their web sites and install them on your platform.
|
56
|
+
For OSX users check out the homebrew repository - there are formulas for some of these.
|
57
|
+
|
58
|
+
## Installation
|
59
|
+
|
60
|
+
At the moment, this gem is not published anywhere - it is too specific to be published to rubygems.
|
61
|
+
|
62
|
+
So, there are 2 ways of installing it - using bundler from an existing project (et_full_system uses it) and installing from
|
63
|
+
github directly.
|
64
|
+
|
65
|
+
### Using Bundler
|
66
|
+
|
67
|
+
Add this line to your application's Gemfile:
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
gem 'et_full_system', '0.1.17', git: 'https://github.com/hmcts/et_full_system_gem.git', ref: '2b684106ae42affaffe454ac190f65d55d9baab9'
|
71
|
+
```
|
72
|
+
|
73
|
+
Replacing the version numbers and git ref according to the latest version.
|
74
|
+
|
75
|
+
And then execute:
|
76
|
+
|
77
|
+
$ bundle
|
78
|
+
|
79
|
+
And if you want to install a binstub (do bundle help binstubs for more options you might want)
|
80
|
+
|
81
|
+
$ bundle binstubs et_full_system --standalone
|
82
|
+
|
83
|
+
### Installing Direct From Github
|
84
|
+
|
85
|
+
Or install it yourself directly from github as follows:
|
86
|
+
|
87
|
+
$ git checkout git@github.com:hmcts/et_full_system_gem.git
|
88
|
+
$ cd et_full_system_gem
|
89
|
+
$ gem build et_full_system -o et_full_system.gem
|
90
|
+
$ gem install et_full_system.gem
|
91
|
+
$ rm et_full_system.gem
|
92
|
+
|
93
|
+
## Usage (using docker)
|
94
|
+
|
95
|
+
To setup the docker system
|
96
|
+
|
97
|
+
$ et_full_system docker setup
|
98
|
+
|
99
|
+
To start the server (Must have been setup with the command above - for the first time and after changing gems etc.. in the services)
|
100
|
+
|
101
|
+
$ et_full_system docker server
|
102
|
+
|
103
|
+
To reset the server (Note: no other docker containers should be sharing the network - such as a test container)
|
104
|
+
|
105
|
+
$ et_full_system docker reset
|
106
|
+
|
107
|
+
To setup and start the server in detached mode (i.e showing no logs etc..)
|
108
|
+
|
109
|
+
$ et_full_system docker server -d
|
110
|
+
|
111
|
+
To watch the logs of an existing running server
|
112
|
+
|
113
|
+
$ et_full_system docker compose logs -f
|
114
|
+
|
115
|
+
To do any other docker compose commands
|
116
|
+
|
117
|
+
$ et_full_system docker compose <command> <command args>
|
118
|
+
|
119
|
+
To redirect a service to your own hosted version
|
120
|
+
|
121
|
+
If you want to host a service yourself for debugging or other purposes - you must setup the service yourself with all
|
122
|
+
the relevant environment variables (see the service_env command), then, to point the full system url's to your hosted service, use the following command
|
123
|
+
|
124
|
+
$ et_full_system docker update_service_url <service_name> <service_url>
|
125
|
+
|
126
|
+
Where <service_name> is either et1, et3, admin, api or atos
|
127
|
+
and <service_url> must be a URL that is reachable from the docker container - you may need to use the special 'host.docker.internal'
|
128
|
+
or in general checkout this page https://docs.docker.com/docker-for-mac/networking/ or https://docs.docker.com/docker-for-windows/networking/
|
129
|
+
|
130
|
+
|
131
|
+
## Usage (Without docker)
|
132
|
+
|
133
|
+
To setup the local system
|
134
|
+
|
135
|
+
$ et_full_system local setup
|
136
|
+
|
137
|
+
To start the server (Must have been setup with the command above - for the first time and after changing gems etc.. in the services)
|
138
|
+
|
139
|
+
$ et_full_system local server
|
140
|
+
|
141
|
+
To reset the server - this will drop and recreate the database, empty redis etc.. so VERY destructive
|
142
|
+
|
143
|
+
$ et_full_system local reset
|
144
|
+
|
145
|
+
To redirect a service to your own hosted version
|
146
|
+
|
147
|
+
If you want to host a service yourself for debugging or other purposes - you must setup the service yourself with all
|
148
|
+
the relevant environment variables (see the service_env command), then, to point the full system url's to your hosted service, use the following command
|
149
|
+
|
150
|
+
$ et_full_system local update_service_url <service_name> <service_url>
|
151
|
+
|
152
|
+
Where <service_name> is either et1, et3, admin, api or atos
|
153
|
+
|
154
|
+
To setup the environment variables in the current shell to allow you to run a service manually for debugging for example
|
155
|
+
|
156
|
+
$ export $(et_full_system local service_env <service_name>)
|
157
|
+
|
158
|
+
|
159
|
+
Where <service_name> is either et1, et3, admin, api or atos
|
160
|
+
|
161
|
+
If for any reason, there are services that you don't want - you might just want to save resources and are not interested in
|
162
|
+
every part of the system, you can use the --without option on the server command as follows
|
163
|
+
|
164
|
+
$ et_full_system local server --without=et3_web fake_acas_web
|
165
|
+
|
166
|
+
To see all options - do
|
167
|
+
|
168
|
+
$ et_full_system local server --help
|
169
|
+
|
170
|
+
### Upgrading
|
171
|
+
|
172
|
+
Note that docker caches stuff for the better and for the worse. So, the command in the Dockerfile that installs the version
|
173
|
+
of the gem that you have - but inside docker - will be cached forever - only if the command changes in the Dockerfile is this
|
174
|
+
cache busted.
|
175
|
+
|
176
|
+
So, for now - until there is a more automated solution to this, whenever a new version of this gem is installed - simply reset using the following command
|
177
|
+
|
178
|
+
$ et_full_system docker reset
|
179
|
+
|
180
|
+
Which will re build it from scratch - then just use the gem as normal (it will have been setup by this command so you can
|
181
|
+
go straight to using the server command)
|
182
|
+
|
183
|
+
|
184
|
+
## Contributing
|
185
|
+
|
186
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/hmcts/et_full_system_gem. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
187
|
+
|
188
|
+
## License
|
189
|
+
|
190
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
191
|
+
|
192
|
+
## Code of Conduct
|
193
|
+
|
194
|
+
Everyone interacting in the EtFullSystem project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/hmcts/et_full_system_gem/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "et_full_system"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/docker/Dockerfile
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
FROM phusion/passenger-customizable:0.9.34
|
2
|
+
# Set correct environment variables.
|
3
|
+
ENV HOME /root
|
4
|
+
|
5
|
+
# Use baseimage-docker's init process.
|
6
|
+
CMD ["/sbin/my_init"]
|
7
|
+
|
8
|
+
# If you're using the 'customizable' variant, you need to explicitly opt-in
|
9
|
+
# for features.
|
10
|
+
#
|
11
|
+
# N.B. these images are based on https://github.com/phusion/baseimage-docker,
|
12
|
+
# so anything it provides is also automatically on board in the images below
|
13
|
+
# (e.g. older versions of Ruby, Node, Python).
|
14
|
+
#
|
15
|
+
# Uncomment the features you want:
|
16
|
+
#
|
17
|
+
# Ruby support
|
18
|
+
|
19
|
+
# The following 2 lines are temporary - see https://github.com/phusion/passenger-docker/issues/234
|
20
|
+
# Try to remove and build from scratch maybe after january 2019
|
21
|
+
RUN curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
|
22
|
+
RUN curl -sSL https://rvm.io/mpapis.asc -o /pd_build/ruby_support/mpapis-pubkey.asc
|
23
|
+
#RUN /pd_build/ruby-2.0.*.sh
|
24
|
+
#RUN /pd_build/ruby-2.1.*.sh
|
25
|
+
#RUN /pd_build/ruby-2.2.*.sh
|
26
|
+
#RUN /pd_build/ruby-2.3.*.sh
|
27
|
+
#RUN /pd_build/ruby-2.4.*.sh
|
28
|
+
RUN /pd_build/ruby-2.5.*.sh
|
29
|
+
#RUN /pd_build/jruby-9.1.*.sh
|
30
|
+
# Python support.
|
31
|
+
#RUN /pd_build/python.sh
|
32
|
+
# Node.js and Meteor standalone support.
|
33
|
+
# (not needed if you already have the above Ruby support)
|
34
|
+
#RUN /pd_build/nodejs.sh
|
35
|
+
|
36
|
+
# Get latest rubygems
|
37
|
+
RUN bash --login -c "rvm --default use 2.5.1"
|
38
|
+
RUN gem update --system
|
39
|
+
|
40
|
+
# ...put your own build instructions here...
|
41
|
+
RUN apt-get update && apt-get -y install pdftk tzdata postgresql gettext-base wget sudo libmcrypt-dev mcrypt
|
42
|
+
|
43
|
+
RUN /pd_build/nodejs.sh
|
44
|
+
|
45
|
+
# Enable the Redis service.
|
46
|
+
RUN rm -f /etc/service/redis/down
|
47
|
+
|
48
|
+
# Install forego (for Procfile running)
|
49
|
+
RUN bash -lc "wget https://bin.equinox.io/c/ekMN3bCZFUn/forego-stable-linux-amd64.deb && apt install ./forego-stable-linux-amd64.deb && rm ./forego-stable-linux-amd64.deb"
|
50
|
+
|
51
|
+
# Install traefik (For front end reverse proxy)
|
52
|
+
RUN bash -lc "wget https://github.com/containous/traefik/releases/download/v1.7.10/traefik_linux-amd64 && mv ./traefik_linux-amd64 /usr/bin/traefik && chmod +x /usr/bin/traefik"
|
53
|
+
|
54
|
+
# Install minio
|
55
|
+
RUN bash -lc "cd /usr/local/bin && wget https://dl.minio.io/server/minio/release/linux-amd64/minio && chmod +x minio"
|
56
|
+
|
57
|
+
# Install azurite
|
58
|
+
RUN bash -lc "npm install -g azurite"
|
59
|
+
|
60
|
+
# Install Mailhog
|
61
|
+
RUN bash -lc "cd /usr/local/bin && wget https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64 -O mailhog && chmod +x mailhog"
|
62
|
+
|
63
|
+
# Create the minio_data directory for the minio server
|
64
|
+
RUN mkdir -p /home/app/minio_data; chown app:app /home/app/minio_data; chmod 0777 /home/app/minio_data
|
65
|
+
|
66
|
+
# Create the azure_storage_data directory for the azure storage server
|
67
|
+
RUN mkdir -p /home/app/azure_storage_data; chown app:app /home/app/azure_storage_data; chmod 0777 /home/app/azure_storage_data
|
68
|
+
|
69
|
+
# Clean up APT when done.
|
70
|
+
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
71
|
+
|
72
|
+
RUN mkdir -p /home/app/full_system; chown app:app /home/app/full_system
|
73
|
+
# Install gems and binstubs to run without bundler
|
74
|
+
RUN mkdir -p /home/app/system_gems/et_full_system && chmod 0777 /home/app/system_gems/et_full_system && chown -R app:app /home/app/system_gems
|
75
|
+
|
76
|
+
RUN usermod -o -u 1000 app
|
77
|
+
RUN groupmod -o -g 1000 app
|
78
|
+
WORKDIR /home/app/full_system
|
79
|
+
RUN echo "app ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && chmod 0440 /etc/sudoers.d/user
|
80
|
+
USER app
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
RUN bash --login -c "rvm --default use 2.5.1"
|
85
|
+
RUN bash --login -c "gem install bundler"
|
86
|
+
|
87
|
+
# Bundle install the gem itself to fetch all its dependencies defined in the Gemfile (git deps - hence the complex stuff) - then build and install the full system gem and fake acas server so they are available
|
88
|
+
# as commands not needing bundle exec etc...
|
89
|
+
COPY . /home/app/system_gems/et_full_system
|
90
|
+
WORKDIR /home/app/system_gems/et_full_system
|
91
|
+
RUN sudo chown -R app:app .
|
92
|
+
RUN bash --login -c "ls -al /home/app/system_gems/et_full_system"
|
93
|
+
RUN bash --login -c "rvm use && bundle install"
|
94
|
+
RUN bash --login -c "rvm use && gem install dotenv"
|
95
|
+
|
96
|
+
RUN bash --login -c "rvm use && gem build et_full_system -o /tmp/et_full_system.gem && gem install /tmp/et_full_system.gem && rm /tmp/et_full_system.gem"
|
97
|
+
RUN bash --login -c "rvm use && cd /usr/local/rvm/gems/ruby-2.5.1/bundler/gems/et_fake_acas_server* && gem build et_fake_acas_server -o /tmp/et_fake_acas_server.gem && gem install /tmp/et_fake_acas_server.gem && rm //tmp/et_fake_acas_server.gem"
|
98
|
+
|
99
|
+
WORKDIR /home/app/full_system
|
100
|
+
|
101
|
+
|
102
|
+
RUN cd /home/app
|
103
|
+
ENV HOME /home/app
|