Skip to content

Commit

Permalink
Merge branch 'release/6.7.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed Nov 3, 2021
2 parents 6f41285 + 8a37ade commit 0f84d30
Show file tree
Hide file tree
Showing 95 changed files with 13,579 additions and 6,769 deletions.
16 changes: 0 additions & 16 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
# Copyright 2020-2021 University of Oxford
# and Health and Social Care Information Centre, also known as NHS Digital
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# don't lint node_modules
node_modules
# don't lint build output (make sure it's set to your correct build folder name)
Expand Down
19 changes: 0 additions & 19 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,20 +1 @@
/*
Copyright 2020-2021 University of Oxford
and Health and Social Care Information Centre, also known as NHS Digital

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

SPDX-License-Identifier: Apache-2.0
*/
registry=https://registry.npmjs.org
@maurodatamapper:registry=https://npm.pkg.github.com
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.16
14.18.1
38 changes: 35 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ pipeline {
stage('Tool Versions') {
steps {
nvm('') {
// Currently npm v6 is packaged with node and we need v7+
sh 'npm install -g npm@^7.10.0'
sh 'npm i -g npm@7.24.1'
sh 'node --version'
sh 'npm --version'
}
Expand All @@ -30,12 +29,39 @@ pipeline {
}
}

stage('Install') {
stage('Install Global') {
steps {
nvm('') {
sh 'npm install -g npm-check'
sh 'npm install -g @angular/cli'
sh 'npm install -g symlinked'
}
}
}

stage('Install Dependencies') {
when {
not {
branch 'main'
}
}
steps {
nvm('') {
sh 'npm install'
sh 'npm link @maurodatamapper/mdm-resources'
sh 'symlinked names'
}
}
}

stage('Clean Install Dependencies') {
when {
branch 'main'
}
steps {
nvm('') {
sh 'npm ci'
sh 'symlinked names'
}
}
}
Expand Down Expand Up @@ -82,6 +108,12 @@ pipeline {
}

stage('Distribution Build') {
when{
anyOf{
branch 'develop'
branch 'main'
}
}
steps {
nvm('') {
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
Expand Down
53 changes: 32 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Web front-end for the Mauro Data Mapper

## Requirements

Please use [NVM](https://github.com/nvm-sh/nvm) to manage the required node/npm dependencies.
Please use [NVM](https://github.com/nvm-sh/nvm) to manage the required node dependencies, and then run `npm i -g npm@7.24.1` to update to v7 of npm

## Installation

Expand Down Expand Up @@ -54,37 +54,48 @@ Therefore if you change any dependency versions you must make sure the `package-

## MDM-Resources

We have a dependency on another repository ([mdm-resources](https://github.com/MauroDataMapper/mdm-resources))
which is not currently published to NPM .
We have a dependency on another repository ([mdm-resources](https://github.com/MauroDataMapper/mdm-resources)) which we develop.

* The `develop` branch of this repo tracks the develop branch of mdm-resources
* The `main` branch of this repo tracks a specific tagged release of mdm-resources
The package.json file is configured to use the latest release of this module into the NPM registry,
however if you are developing mdm-resources alongside mdm-ui or you know there are changes which have not yet been released you will need to
do the following

If any updates are made to the mdm-resources repo then to allow Jenkins to build successfully you will need to update the
`package-lock.json` which points to a specific commit hash for mdm-resources.
This can be done by running
1. Clone the mdm-resources repository
2. Link the mdm-resources repository into your global npm
3. Link mdm-resources into mdm-ui

```shell
$ npm update @maurodatamapper/mdm-resources
```
Once you have linked the mdm-resources repo into the global npm it will remain there until you unlink it,
you will have to re-build (`npm run build`) mdm-resources with each change for those changes to be picked up by mdm-ui,
however you dont have to re-link after the rebuild.

### `develop` branch
### Linking to mdm-resources

We have the `develop` branch set with a dependency of:
If you run `npm install` inside mdm-ui you will have to re-run the final link step below to re-link mdm-resources into mdm-ui.

```shell
# Clone mdm-resources
$ git clone git@github.com:MauroDataMapper/mdm-resources.git

```json
"@maurodatamapper/mdm-resources": "git+https://github.com/MauroDataMapper/mdm-resources.git#develop",
# Link mdm-resources to global npm
$ cd mdm-resources
$ npm install
$ npm run build
$ npm link

# Link mdm-resources into mdm-ui
$ cd mdm-ui
$ npm link @maurodatamapper/mdm-resources
```

### `main` branch
### Unlinking from mdm-resources

We have the `main` branch set with a dependency of:
This is surprisingly simple just run `npm install` or `npm ci`

```json
"@maurodatamapper/mdm-resources": "git+https://github.com/MauroDataMapper/mdm-resources.git#<RELEASE_TAG>",
```
### Useful Tool for Links

Where the `RELEASE_TAG` is the stable tagged release of mdm-resources we need for the release of mdm-ui.
There is a useful npm package ([symlinked](https://www.npmjs.com/package/symlinked)) which can list what modules are linked into your repository.
This is helpful if you want to check if mdm-resources is currently linked to mdm-ui.
We recommend installing this globally with `npm i -g symlinked` then you can call it inside mdm-ui using `symlinked names`.

## Build the application

Expand Down
50 changes: 0 additions & 50 deletions e2e/protractor.conf.js

This file was deleted.

13 changes: 0 additions & 13 deletions e2e/tsconfig.json

This file was deleted.

2 changes: 2 additions & 0 deletions license-check-and-add-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
".gitattributes",
".gitignore",
".nvmrc",
".npmrc",
".eslintignore",
"NOTICE",
"Jenkinsfile",
"**/*.xml",
Expand Down
Loading

0 comments on commit 0f84d30

Please sign in to comment.