Skip to content

Commit a319f0d

Browse files
committed
[NRL-1386] Strip out manual setup instructions from README
1 parent c827871 commit a319f0d

File tree

1 file changed

+24
-218
lines changed

1 file changed

+24
-218
lines changed

README.md

Lines changed: 24 additions & 218 deletions
Original file line numberDiff line numberDiff line change
@@ -8,255 +8,61 @@ This project uses the `Makefile` to build, test and deploy. This will ensure tha
88

99
## Table of Contents
1010

11-
- [Setup](#setup)
11+
- [Before You Begin](#before-you-begin)
1212
- [Getting Started](#getting-started)
1313
- [Deploying](#deploying)
1414
- [Feature Tests](#feature-tests)
1515
- [OAuth Tokens for API request](#oauth-tokens-for-api-requests)
1616
- [Route53 & Hosted Zones](#route53--hosted-zones)
1717
- [Sandbox](#sandbox)
1818
- [Releases](#releases)
19+
- [Reports](#reports)
1920

20-
## Setup
21+
## Before You Begin
2122

22-
Before you tackle this guide, there are some more instructions here on the [Developer onboarding guide](https://nhsd-confluence.digital.nhs.uk/pages/viewpage.action?spaceKey=CLP&title=NRLF+-+Developer+Onboarding) in confluence
23+
Before you start using this repository, you will need to:
2324

24-
### 1. Prerequisites
25+
- Follow the instructions on the [Developer Onboarding Guide](https://nhsd-confluence.digital.nhs.uk/pages/viewpage.action?spaceKey=CLP&title=NRLF+-+Developer+Onboarding) in confluence
26+
- Install `asdf` using https://asdf-vm.com/guide/getting-started.html.
2527

26-
#### 1. ASDF Tool Manager
28+
Then install all the dependency packages with:
2729

28-
For an easy way to make sure your local system matches the requirements needed you can use `asdf tool manager`. This tool fetches the required versions of the libraries needed and sets the directory to use that version instead of your system's default version. To get it up and running,
29-
30-
- Install `asdf` using the instructions given here. https://asdf-vm.com/guide/getting-started.html. You can check it installed properly by using the command `asdf --version`
31-
- Install the dependencies using: `$ make asdf-install`
32-
- You should be good to go.
33-
34-
#### 2. If you prefer to get your local machine running manually the requirements are...
35-
36-
- [poetry](https://python-poetry.org/docs/) (this repository uses poetry ^1.5.1)
37-
- [pyenv](https://github.com/pyenv/pyenv) (this repository uses python ^3.9.15)
38-
- jq
39-
- terraform
40-
- [tfenv](https://github.com/tfutils/tfenv)
41-
- coreutils
42-
43-
Swagger generation requirements.
44-
45-
- curl
46-
- java runtime environment (jre) - https://www.oracle.com/java/technologies/downloads/#jdk19-mac
47-
- yq v4
48-
49-
### 2. WSL and PowerShell installation
50-
51-
If you are using Linux machine, please skip this section and go to [Linux set up](#3-linux-set-up)
52-
53-
This section will provide guidance on how to install the latest version of PowerShell and set up the Windows Subsystem for Linux (WSL) on your Windows machine.
54-
55-
PowerShell is a powerful command-line shell and scripting language, while WSL allows you to run a Linux distribution alongside your Windows installation.
56-
57-
If you wish to use the official guidance, links are below:
58-
59-
- PowerShell - https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.3
60-
- WSL - https://learn.microsoft.com/en-us/windows/wsl/install
61-
62-
#### Step 1: Install PowerShell
63-
64-
1. Open a web browser and go to the official PowerShell GitHub releases page: https://github.com/PowerShell/PowerShell/releases.
65-
66-
2. Scroll down to the "Assets" section and find the latest stable release for your system architecture (usually x64 for 64-bit systems). Download the installer package with the "msi" extension.
67-
68-
3. Run the downloaded MSI installer file.
69-
70-
4. Follow the on-screen instructions to install PowerShell. Make sure to select the "Add to PATH" option during installation so that you can easily access PowerShell from the command line.
71-
72-
5. Once the installation is complete, open a new Command Prompt or PowerShell window to verify that PowerShell is installed. You can do this by typing `powershell` and pressing Enter.
73-
74-
#### Step 2: Install Windows Subsystem for Linux (WSL)
75-
76-
1. Open PowerShell as an administrator. To do this, search for "PowerShell" in the Windows Start menu, right-click on "Windows PowerShell," and select "Run as administrator."
77-
78-
2. Run the following command to enable the WSL feature:
79-
```shell
80-
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
81-
```
82-
3. After the feature is enabled, restart your computer by running:
83-
```shell
84-
Restart-Computer
85-
```
86-
4. After your computer restarts, open PowerShell as an administrator again and run the following command to download and install a Linux distribution of your choice (e.g., Ubuntu):
87-
```shell
88-
wsl --install
89-
```
90-
5. During the installation process, you will be prompted to create a user and set a password for your Linux distribution.
91-
92-
6. Once the installation is complete, you can launch your installed Linux distribution by running:
93-
94-
```shell
95-
wsl
96-
```
97-
98-
To run a specific wsl distribution from within PowerShell or Windows Command Prompt without changing your default distribution:
99-
100-
use the command: `wsl -d <DistributionName>` , replacing `<DistributionName>` with the name of the distribution you want to use.
101-
102-
#### Step 3: Verify Your Installation
103-
104-
1. To verify that PowerShell and WSL are correctly installed, open a new PowerShell window (WSL not running) and run the following commands:
105-
106-
Check PowerShell version
107-
108-
```shell
109-
$PSVersionTable.PSVersion
110-
```
111-
112-
Check WSL distribution list
113-
114-
```shell
115-
wsl --list
116-
```
117-
118-
These commands should display the PowerShell version and list the installed WSL distributions.
119-
120-
### 3. Manually setting up Linux
121-
122-
If you're on Linux/WSL and using ASDF, you can skip these steps.
123-
124-
For those on a linux/WSL setup these are some helpful instructions:
125-
126-
- We recommend that you use the NRLF with VSCode and WSL rather than the Spine VM
127-
- There is also a plugin for VSCode called `WSL` which will help you avoid some terminal issues when opening projects in WSL
128-
129-
#### 1. Java:
130-
131-
```shell
132-
sudo apt install default-jre
133-
```
134-
135-
#### 2. Poetry:
136-
137-
```shell
138-
curl -sSL https://install.python-poetry.org | python3
139-
```
140-
141-
```shell
142-
nano ~/.bashrc
143-
```
144-
145-
add to bashrc - spineVM home dir is "/home/spineii-user/"
146-
147-
```shell
148-
export PATH="/$HOME/.local/bin:$PATH"
149-
```
150-
151-
```shell
152-
source ~/.bashrc
153-
```
154-
155-
```shell
156-
poetry --version
157-
```
158-
159-
#### 3. pyenv:
160-
161-
```shell
162-
sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
163-
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
164-
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
165-
```
166-
167-
```shell
168-
curl https://pyenv.run | bash
169-
```
170-
171-
```shell
172-
nano ~/.bashrc
173-
```
174-
175-
add to bashrc
176-
177-
```shell
178-
export PATH="$HOME/.pyenv/bin:$PATH"
179-
eval "$(pyenv init --path)"
180-
eval "$(pyenv virtualenv-init -)"
18130
```
182-
183-
```shell
184-
source ~/.bashrc
185-
```
186-
187-
```shell
188-
pyenv --version
189-
```
190-
191-
#### 4. terraform
192-
193-
```shell
194-
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
195-
```
196-
197-
```shell
198-
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
199-
```
200-
201-
```shell
202-
sudo apt update && sudo apt install terraform
203-
```
204-
205-
#### 5. yq:
206-
207-
```shell
208-
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +rx /usr/bin/yq
209-
```
210-
211-
### 4. Install python dependencies
212-
213-
At the root of the repo, run:
214-
215-
```shell
216-
poetry install
217-
poetry shell
21831
make configure
21932
```
22033

221-
NOTE
222-
223-
- You will know if you are correctly in the shell when you see the following before your command line prompt `(nrlf-api-py3.11)` (the version may change based on the version of python)
224-
- If it says (.venv) then you are not using the correct virtual environment
225-
- As mentioned above you at least need Python 3.9 installed globally to run the project, Poetry will handle the rest
226-
- The terraform version can be found in the .terraform-version file at the root
227-
22834
## Getting Started
22935

23036
To build packages:
23137

23238
```
233-
$ make
39+
make
23440
```
23541

23642
To run the linters over your changes:
23743

23844
```
239-
$ make lint
45+
make lint
24046
```
24147

24248
To run the unit tests:
24349

24450
```
245-
$ make test
51+
make test
24652
```
24753

24854
To run the local feature tests:
24955

25056
```
251-
$ make test-features
57+
make test-features
25258
```
25359

25460
### Troubleshooting
25561

25662
To check your environment:
25763

25864
```
259-
$ make check
65+
make check
26066
```
26167

26268
this will provide a report of the dependencies in your environment and should highlight the things that are not configured correctly or things that are missing.
@@ -268,34 +74,34 @@ For the integration tests, you need to have deployed your infrastructure (using
26874
To run integration tests:
26975

27076
```
271-
$ make test-integration
77+
make test-integration
27278
```
27379

27480
To run the Firehose integration tests:
27581

27682
```
277-
$ make test-firehose-integration
83+
make test-firehose-integration
27884
```
27985

28086
To run all the feature integration tests:
28187

28288
```
283-
$ make test-features-integration
89+
make test-features-integration
28490
```
28591

28692
To run indivudal feature test scenario(s) using the custom tag :
28793

288-
1. Add "@custom_tag" before each 'Scenario' that needs to be run (in each .feature file)
94+
1. Add `@custom_tag` before each 'Scenario' that needs to be run (in each .feature file)
28995
2. Run the command below:
29096

29197
```
292-
$ make integration-test-with-custom_tag
98+
make integration-test-with-custom_tag
29399
```
294100

295101
To run all the feature integration tests and generate an interactive Allure report therafter :
296102

297103
```
298-
$ make test-features-integration-report
104+
make test-features-integration-report
299105
```
300106

301107
### Smoke testing
@@ -305,19 +111,19 @@ For smoke tests, you need to have deployed your infrastructure (using Terraform)
305111
Before the first run of the smoke tests, you need to set the required permissions in your deployment. You can do this by running:
306112

307113
```
308-
$ make set-smoketest-perms
114+
make set-smoketest-perms
309115
```
310116

311117
To run the internal smoke tests against your stack, do this:
312118

313119
```
314-
$ make test-smoke-internal
120+
make test-smoke-internal
315121
```
316122

317123
To run the smoke tests against the public access endpoints (via APIGEE proxies), do this:
318124

319125
```
320-
$ make test-smoke-public
126+
make test-smoke-public
321127
```
322128

323129
## API Documentation
@@ -391,7 +197,7 @@ Clients must provide OAuth access tokens when making requests to the NRLF APIs.
391197
To create an access token for the dev environment, you can do the following:
392198

393199
```
394-
$ make get-access-token
200+
make get-access-token
395201
```
396202

397203
To create an access token for another environment:
@@ -494,10 +300,10 @@ The process to create a new release is as follows:
494300
4. Press "Generate release notes" button. This will populate the description with everything that's changed since the last release.
495301
5. Enter the version of the release into the Release Title field, say `v3.0.1`
496302
6. Arrange and update the description to accuruately represent the highlights of the release.
497-
7. Make sure the "Set as the latest release" checkbox it set
303+
7. Make sure the "Set as a pre-release" checkbox it set
498304
8. Press the "Publish release" button to complete the release process
499305

500-
Once your new release has been created, you can then deploy this release through the NRLF environments using the "Persistent Environment Deploy" Github Action.
306+
Once your new release has been created, you can then deploy this release through the NRLF environments using the "Persistent Environment Deploy" Github Action. Once your release has been deployed to prod, edit the release and set the "Set as the latest release" checkbox.
501307

502308
If the Consumer API has changed, or the documentation for that API has changed, you will also need to release [NRL Consumer API](https://github.com/NHSDigital/nrl-consumer-api).
503309

0 commit comments

Comments
 (0)