Merge branch 'master' into feat/new-modal-service
This commit is contained in:
commit
244e822afc
@ -62,7 +62,7 @@ echo "Done generating documentation output"
|
|||||||
echo 'STARTING PUBLISH'
|
echo 'STARTING PUBLISH'
|
||||||
|
|
||||||
# WILL ALWAYS FAIL IF INITIATED FROM PR BRANCH
|
# WILL ALWAYS FAIL IF INITIATED FROM PR BRANCH
|
||||||
./node_modules/.bin/gh-pages \
|
npx gh-pages \
|
||||||
--silent \
|
--silent \
|
||||||
--repo https://$GITHUB_TOKEN@github.com/OHIF/Viewers.git \
|
--repo https://$GITHUB_TOKEN@github.com/OHIF/Viewers.git \
|
||||||
--message 'Autogenerated Message: [ci skip]' \
|
--message 'Autogenerated Message: [ci skip]' \
|
||||||
|
|||||||
@ -14,6 +14,13 @@ version: 2.1
|
|||||||
orbs:
|
orbs:
|
||||||
codecov: codecov/codecov@1.0.5
|
codecov: codecov/codecov@1.0.5
|
||||||
cypress: cypress-io/cypress@1.11.0
|
cypress: cypress-io/cypress@1.11.0
|
||||||
|
executors:
|
||||||
|
# Custom executor to override Cypress config
|
||||||
|
deploy-to-prod-executor:
|
||||||
|
docker:
|
||||||
|
- image: 'cypress/browsers:node10.16.0-chrome77'
|
||||||
|
environment:
|
||||||
|
CYPRESS_BASE_URL: https://ohif-staging.netlify.com/
|
||||||
|
|
||||||
defaults: &defaults
|
defaults: &defaults
|
||||||
docker:
|
docker:
|
||||||
@ -186,7 +193,7 @@ jobs:
|
|||||||
- image: circleci/node:12.9.1
|
- image: circleci/node:12.9.1
|
||||||
environment:
|
environment:
|
||||||
TERM: xterm
|
TERM: xterm
|
||||||
NETLIFY_SITE_ID: 32708787-c9b0-4634-b50f-7ca41952da77
|
NETLIFY_SITE_ID: c7502ae3-b150-493c-8422-05701e44a969
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@ -199,7 +206,7 @@ jobs:
|
|||||||
- image: circleci/node:12.9.1
|
- image: circleci/node:12.9.1
|
||||||
environment:
|
environment:
|
||||||
TERM: xterm
|
TERM: xterm
|
||||||
NETLIFY_SITE_ID: 32708787-c9b0-4634-b50f-7ca41952da77
|
NETLIFY_SITE_ID: 79c4a5da-5c95-4dc9-84f7-45fd9dfe21b0
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@ -213,16 +220,15 @@ jobs:
|
|||||||
NPM_PUBLISH:
|
NPM_PUBLISH:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
steps:
|
steps:
|
||||||
# Update yarn
|
|
||||||
- run: yarn -v
|
- run: yarn -v
|
||||||
# Checkout code and ALL Git Tags
|
# Checkout code and ALL Git Tags
|
||||||
- checkout:
|
- checkout:
|
||||||
post:
|
post:
|
||||||
- git fetch --all
|
- git fetch --all
|
||||||
|
# Use increasingly general patterns to restore cache
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
name: Restore Yarn and Cypress Package Cache
|
name: Restore Yarn and Cypress Package Cache
|
||||||
keys:
|
keys:
|
||||||
# when lock file changes, use increasingly general patterns to restore cache
|
|
||||||
- yarn-packages-{{ checksum "yarn.lock" }}
|
- yarn-packages-{{ checksum "yarn.lock" }}
|
||||||
- yarn-packages-
|
- yarn-packages-
|
||||||
- run:
|
- run:
|
||||||
@ -231,23 +237,22 @@ jobs:
|
|||||||
- save_cache:
|
- save_cache:
|
||||||
name: Save Yarn Package Cache
|
name: Save Yarn Package Cache
|
||||||
paths:
|
paths:
|
||||||
- ~/.cache ## Cache yarn and Cypress
|
- ~/.cache/yarn
|
||||||
key: yarn-packages-{{ checksum "yarn.lock" }}
|
key: yarn-packages-{{ checksum "yarn.lock" }}
|
||||||
- run:
|
- run:
|
||||||
name: Avoid hosts unknown for github
|
name: Avoid hosts unknown for github
|
||||||
command:
|
command: |
|
||||||
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking
|
rm -rf ~/.ssh
|
||||||
no\n" > ~/.ssh/config
|
mkdir ~/.ssh/
|
||||||
- run: git config --global user.email "danny.ri.brown+ohif-bot@gmail.com"
|
echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
|
||||||
- run: git config --global user.name "ohif-bot"
|
git config --global user.email "danny.ri.brown+ohif-bot@gmail.com"
|
||||||
|
git config --global user.name "ohif-bot"
|
||||||
- run:
|
- run:
|
||||||
name: Authenticate with registry
|
name: Authenticate with NPM registry
|
||||||
command:
|
command:
|
||||||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
|
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
|
||||||
- run: npx lerna version
|
- run: npx lerna version
|
||||||
- run: npx lerna publish from-package
|
- run: npx lerna publish from-package
|
||||||
|
|
||||||
# Persist :+1:
|
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: ~/repo
|
root: ~/repo
|
||||||
paths: .
|
paths: .
|
||||||
@ -255,17 +260,16 @@ jobs:
|
|||||||
DOCS_PUBLISH:
|
DOCS_PUBLISH:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- checkout
|
||||||
at: ~/repo
|
|
||||||
- run:
|
- run:
|
||||||
name: Avoid hosts unknown for github
|
name: Avoid hosts unknown for github
|
||||||
command:
|
command: |
|
||||||
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking
|
rm -rf ~/.ssh
|
||||||
no\n" > ~/.ssh/config
|
mkdir ~/.ssh/
|
||||||
- run: git config --global user.email "danny.ri.brown+ohif-bot@gmail.com"
|
echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
|
||||||
- run: git config --global user.name "ohif-bot"
|
git config --global user.email "danny.ri.brown+ohif-bot@gmail.com"
|
||||||
- run: yarn global add gitbook-cli
|
git config --global user.name "ohif-bot"
|
||||||
- run: yarn global add gh-pages
|
- run: yarn global add gitbook-cli gh-pages
|
||||||
- run: chmod +x ~/repo/.circleci/build-and-publish-docs.sh
|
- run: chmod +x ~/repo/.circleci/build-and-publish-docs.sh
|
||||||
- run: ~/repo/.circleci/build-and-publish-docs.sh
|
- run: ~/repo/.circleci/build-and-publish-docs.sh
|
||||||
|
|
||||||
@ -280,7 +284,8 @@ jobs:
|
|||||||
name: Build and push Docker image
|
name: Build and push Docker image
|
||||||
command: |
|
command: |
|
||||||
# This file will exist if a new version was published by
|
# This file will exist if a new version was published by
|
||||||
# our `semantic-release` command in the previous job
|
# our command in the previous job. Created in npm postpublish hook
|
||||||
|
# in the `platform/viewer` project.
|
||||||
if [[ ! -e platform/viewer/success_version.txt ]]; then
|
if [[ ! -e platform/viewer/success_version.txt ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
@ -370,7 +375,7 @@ workflows:
|
|||||||
###
|
###
|
||||||
# Our workflow for building, deploying, and promoting builds across our
|
# Our workflow for building, deploying, and promoting builds across our
|
||||||
# development, staging, and production environments.
|
# development, staging, and production environments.
|
||||||
##
|
###
|
||||||
DEPLOY:
|
DEPLOY:
|
||||||
jobs:
|
jobs:
|
||||||
- BUILD:
|
- BUILD:
|
||||||
@ -384,61 +389,9 @@ workflows:
|
|||||||
type: approval
|
type: approval
|
||||||
requires:
|
requires:
|
||||||
- DEPLOY_TO_DEV
|
- DEPLOY_TO_DEV
|
||||||
# TODO: PWA E2E Test against demo site
|
|
||||||
# E2E: PWA
|
|
||||||
- cypress/run:
|
|
||||||
name: 'E2E: PWA'
|
|
||||||
executor: cypress/browsers-chrome76
|
|
||||||
browser: chrome
|
|
||||||
pre-steps:
|
|
||||||
- run: 'rm -rf ~/.yarn && npm i -g yarn && yarn -v && yarn global
|
|
||||||
add wait-on' # Use yarn latest
|
|
||||||
yarn: true
|
|
||||||
record: false
|
|
||||||
store_artifacts: true
|
|
||||||
working_directory: platform/viewer
|
|
||||||
build: npx cross-env QUICK_BUILD=true yarn run build
|
|
||||||
start: yarn run test:e2e:serve
|
|
||||||
wait-on: 'http://localhost:3000'
|
|
||||||
command: 'yarn run test:e2e:ci'
|
|
||||||
cache-key: 'yarn-packages-{{ checksum "yarn.lock" }}'
|
|
||||||
no-workspace: true # Don't persist workspace
|
|
||||||
post-steps:
|
|
||||||
- store_artifacts:
|
|
||||||
path: platform/viewer/cypress/screenshots
|
|
||||||
- store_test_results:
|
|
||||||
path: cypress/results
|
|
||||||
requires:
|
|
||||||
- PROMOTE_TO_STAGING
|
|
||||||
# E2E: script-tag
|
|
||||||
- cypress/run:
|
|
||||||
name: 'E2E: Script Tag'
|
|
||||||
executor: cypress/browsers-chrome76
|
|
||||||
browser: chrome
|
|
||||||
pre-steps:
|
|
||||||
- run: 'rm -rf ~/.yarn && npm i -g yarn && yarn -v && yarn global
|
|
||||||
add wait-on' # Use yarn latest
|
|
||||||
yarn: true
|
|
||||||
record: false
|
|
||||||
store_artifacts: false
|
|
||||||
working_directory: platform/viewer
|
|
||||||
build: npx cross-env QUICK_BUILD=true yarn run build:package
|
|
||||||
start: yarn run test:e2e:serve
|
|
||||||
spec: 'cypress/integration/common/**/*'
|
|
||||||
wait-on: 'http://localhost:3000'
|
|
||||||
cache-key: 'yarn-packages-{{ checksum "yarn.lock" }}'
|
|
||||||
no-workspace: true # Don't persist workspace
|
|
||||||
post-steps:
|
|
||||||
- store_artifacts:
|
|
||||||
path: platform/viewer/cypress/screenshots
|
|
||||||
- store_test_results:
|
|
||||||
path: cypress/results
|
|
||||||
requires:
|
|
||||||
- PROMOTE_TO_STAGING
|
|
||||||
- DEPLOY_TO_STAGING:
|
- DEPLOY_TO_STAGING:
|
||||||
requires:
|
requires:
|
||||||
- 'E2E: PWA'
|
- PROMOTE_TO_STAGING
|
||||||
- 'E2E: Script Tag'
|
|
||||||
- PROMOTE_TO_PRODUCTION:
|
- PROMOTE_TO_PRODUCTION:
|
||||||
type: approval
|
type: approval
|
||||||
requires:
|
requires:
|
||||||
@ -446,9 +399,10 @@ workflows:
|
|||||||
- DEPLOY_TO_PRODUCTION:
|
- DEPLOY_TO_PRODUCTION:
|
||||||
requires:
|
requires:
|
||||||
- PROMOTE_TO_PRODUCTION
|
- PROMOTE_TO_PRODUCTION
|
||||||
|
###
|
||||||
# Unit and E2E tests have already run for PR_CHECKS
|
# Unit and E2E tests have already run for PR_CHECKS
|
||||||
# Re-running should not gain us any confidence here
|
# Re-running should not gain us any confidence here
|
||||||
|
###
|
||||||
RELEASE:
|
RELEASE:
|
||||||
jobs:
|
jobs:
|
||||||
- NPM_PUBLISH:
|
- NPM_PUBLISH:
|
||||||
@ -462,3 +416,22 @@ workflows:
|
|||||||
- DOCKER_MASTER_PUBLISH:
|
- DOCKER_MASTER_PUBLISH:
|
||||||
requires:
|
requires:
|
||||||
- NPM_PUBLISH
|
- NPM_PUBLISH
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Potentially use to E2E test STAGING environment
|
||||||
|
# before publishing to production
|
||||||
|
# - cypress/run:
|
||||||
|
# name: 'E2E: PWA'
|
||||||
|
# executor: deploy-to-prod-executor
|
||||||
|
# browser: chrome
|
||||||
|
# working_directory: platform/viewer
|
||||||
|
# cache-key: 'yarn-packages-{{ checksum "yarn.lock" }}'
|
||||||
|
# yarn: true
|
||||||
|
# record: false
|
||||||
|
# no-workspace: true
|
||||||
|
# store_artifacts: true
|
||||||
|
# post-steps:
|
||||||
|
# - store_artifacts:
|
||||||
|
# path: platform/viewer/cypress/screenshots
|
||||||
|
# - store_test_results:
|
||||||
|
# path: cypress/results
|
||||||
|
|||||||
@ -47,5 +47,6 @@
|
|||||||
|
|
||||||
- [FAQ](frequently-asked-questions.md)
|
- [FAQ](frequently-asked-questions.md)
|
||||||
- [Contributing](contributing/index.md)
|
- [Contributing](contributing/index.md)
|
||||||
|
- [Continuous Integration](continous-integration.md)
|
||||||
- [Browser Support](browser-support.md)
|
- [Browser Support](browser-support.md)
|
||||||
- [Help](help.md)
|
- [Help](help.md)
|
||||||
|
|||||||
BIN
docs/latest/assets/img/WORKFLOW_DEPLOY.png
Normal file
BIN
docs/latest/assets/img/WORKFLOW_DEPLOY.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.8 KiB |
BIN
docs/latest/assets/img/WORKFLOW_PR_CHECKS.png
Normal file
BIN
docs/latest/assets/img/WORKFLOW_PR_CHECKS.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
BIN
docs/latest/assets/img/WORKFLOW_PR_OPTIONAL_DOCKER_PUBLISH.png
Normal file
BIN
docs/latest/assets/img/WORKFLOW_PR_OPTIONAL_DOCKER_PUBLISH.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
BIN
docs/latest/assets/img/WORKFLOW_RELEASE.png
Normal file
BIN
docs/latest/assets/img/WORKFLOW_RELEASE.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
106
docs/latest/continous-integration.md
Normal file
106
docs/latest/continous-integration.md
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
# Continous Integration (CI)
|
||||||
|
|
||||||
|
This repository uses `CircleCI` and `Netlify` for continous integration.
|
||||||
|
|
||||||
|
## Deploy Previews
|
||||||
|
|
||||||
|
[Netlify Deploy previews][deploy-previews] are generated for every pull request.
|
||||||
|
They allow pull request authors and reviewers to "Preview" the OHIF Viewer as if
|
||||||
|
the changes had been merged.
|
||||||
|
|
||||||
|
Deploy previews can be configured by modifying the `netlify.toml` file in the
|
||||||
|
root of the repository. Some additional scripts/assets for netlify are included
|
||||||
|
in the root `.netlify` directory.
|
||||||
|
|
||||||
|
## Workflows
|
||||||
|
|
||||||
|
[CircleCI Workflows][circleci-workflows] are a set of rules for defining a
|
||||||
|
collection of jobs and their run order. They are self-documenting and their
|
||||||
|
configuration can be found in our CircleCI configuration file:
|
||||||
|
`.circleci/config.yml`.
|
||||||
|
|
||||||
|
### Workflow: PR_CHECKS
|
||||||
|
|
||||||
|
The PR_CHECKS workflow (Pull Request Checks) runs our automated unit and
|
||||||
|
end-to-end tests for every code check-in. These tests must all pass before code
|
||||||
|
can be merged to our `master` branch.
|
||||||
|
|
||||||
|
<div style="text-align: center;">
|
||||||
|
<a href="/assets/img/WORKFLOW_PR_CHECKS.png">
|
||||||
|
<img src="/assets/img/WORKFLOW_PR_CHECKS.png" alt="workflow diagram" style="margin: 0 auto; max-width: 500px;" />
|
||||||
|
</a>
|
||||||
|
<div><i>Workflow diagram for PR_CHECKS</i></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
### Workflow: PR_OPTIONAL_DOCKER_PUBLISH
|
||||||
|
|
||||||
|
The PR_OPTIONAL_DOCKER_PUBLISH workflow allows for "manual approval" to publish
|
||||||
|
the pull request as a tagged docker image. This is helpful when changes need to
|
||||||
|
be tested with the Google Adapter before merging to `master`.
|
||||||
|
|
||||||
|
<div style="text-align: center;">
|
||||||
|
<a href="/assets/img/WORKFLOW_PR_OPTIONAL_DOCKER_PUBLISH.png">
|
||||||
|
<img src="/assets/img/WORKFLOW_PR_OPTIONAL_DOCKER_PUBLISH.png" alt="workflow diagram" style="margin: 0 auto; max-width: 500px;" />
|
||||||
|
</a>
|
||||||
|
<div><i>Workflow diagram for PR_WORKFLOW_PR_OPTIONAL_DOCKER_PUBLISH</i></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
> NOTE: This workflow will fail unless it's for a branch on our `upstream`
|
||||||
|
> repository. If you need this functionality, but the branch is from a fork,
|
||||||
|
> merge the changes to a short-lived `feature/` branch on `upstream`
|
||||||
|
|
||||||
|
### Workflow: DEPLOY
|
||||||
|
|
||||||
|
The DEPLOY workflow deploys the OHIF Viewer when changes are merged to master.
|
||||||
|
It uses the Netlify CLI to deploy assets created as part of the repository's PWA
|
||||||
|
Build process (`yarn run build`). The workflow allows for "Manual Approval" to
|
||||||
|
promote the build to `STAGING` and `PRODUCTION` environments.
|
||||||
|
|
||||||
|
<div style="text-align: center;">
|
||||||
|
<a href="/assets/img/WORKFLOW_DEPLOY.png">
|
||||||
|
<img src="/assets/img/WORKFLOW_DEPLOY.png" alt="workflow diagram" style="margin: 0 auto; max-width: 500px;" />
|
||||||
|
</a>
|
||||||
|
<div><i>Workflow diagram for WORKFLOW_DEPLOY</i></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
| Environment | Description | URL |
|
||||||
|
| ----------- | ---------------------------------------------------------------------------------- | -------------------------- |
|
||||||
|
| Development | Always reflects latest changes on `master` branch. | [Netlify][netlify-dev] |
|
||||||
|
| Staging | For manual testing before promotion to prod. Keeps development workflow unblocked. | [Netlify][netlify-staging] |
|
||||||
|
| Production | Stable, tested, updated less frequently. | [Netlify][netlify-prod] |
|
||||||
|
|
||||||
|
### Workflow: RELEASE
|
||||||
|
|
||||||
|
The RELEASE workflow publishes our `npm` packages, updated documentation, and
|
||||||
|
`docker` image when changes are merged to master. `Lerna` and "Semantic Commit
|
||||||
|
Syntax" are used to independently version and publish the many packages in our
|
||||||
|
monorepository. If a new version is cut/released, a Docker image is created.
|
||||||
|
Documentation is generated with `gitbook` and pushed to our `gh-pages` branch.
|
||||||
|
GitHub hosts the `gh-pages` branch with GitHub Pages.
|
||||||
|
|
||||||
|
- Platform Packages: https://github.com/ohif/viewers/#platform
|
||||||
|
- Extension Packages: https://github.com/ohif/viewers/#extensions
|
||||||
|
- Documentation: https://docs.ohif.org/
|
||||||
|
|
||||||
|
<div style="text-align: center;">
|
||||||
|
<a href="/assets/img/WORKFLOW_RELEASE.png">
|
||||||
|
<img src="/assets/img/WORKFLOW_RELEASE.png" alt="workflow diagram" style="margin: 0 auto; max-width: 500px;" />
|
||||||
|
</a>
|
||||||
|
<div><i>Workflow diagram for WORKFLOW_RELEASE</i></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
### HOTFIX
|
||||||
|
|
||||||
|
_Not yet implemented_
|
||||||
|
|
||||||
|
<!--
|
||||||
|
LINKS
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
[deploy-previews]: https://www.netlify.com/blog/2016/07/20/introducing-deploy-previews-in-netlify/
|
||||||
|
[circleci-workflows]: https://circleci.com/docs/2.0/workflows/
|
||||||
|
[netlify-dev]: https://ohif-dev.netlify.com
|
||||||
|
[netlify-staging]: https://ohif-staging.netlify.com
|
||||||
|
[netlify-prod]: https://ohif-prod.netlify.com
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
@ -80,7 +80,6 @@
|
|||||||
"jest-junit": "^6.4.0",
|
"jest-junit": "^6.4.0",
|
||||||
"lerna": "^3.15.0",
|
"lerna": "^3.15.0",
|
||||||
"lint-staged": "^9.0.2",
|
"lint-staged": "^9.0.2",
|
||||||
"netlify-cli": "^2.21.0",
|
|
||||||
"optimize-css-assets-webpack-plugin": "^5.0.3",
|
"optimize-css-assets-webpack-plugin": "^5.0.3",
|
||||||
"postcss-import": "^12.0.1",
|
"postcss-import": "^12.0.1",
|
||||||
"postcss-loader": "^3.0.0",
|
"postcss-loader": "^3.0.0",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user