Skip to content

Commit

Permalink
Merge pull request #492 from geoadmin/feat-BGDIINF_SB-3071-import-url
Browse files Browse the repository at this point in the history
BGDIINF_SB-3071: Added CLI tool to check the external providers
  • Loading branch information
ltshb authored Oct 30, 2023
2 parents b106b42 + 0fb4a0f commit 3745b3e
Show file tree
Hide file tree
Showing 15 changed files with 735 additions and 368 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ tests/results/*

# Git
*.orig

# script check-external-layers-providers.mjs
scripts/check-layer-providers-results/*invalid_providers_cors.yaml
scripts/check-layer-providers-results/*invalid_providers.yaml
scripts/check-layer-providers-results/*invalid_providers_wms.yaml
scripts/check-layer-providers-results/*invalid_providers_wmts.yaml
scripts/check-layer-providers-results/*invalid_providers_content.yaml
scripts/check-layer-providers-results/*valid_providers.json
38 changes: 26 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ The next generation map viewer application of geo.admin.ch: Digital data can be
- [List of npm scripts](#list-of-npm-scripts)
- [What about `package-lock.json` file?](#what-about-package-lockjson-file)
- [Project deployment](#project-deployment)
- [Automatic deploy](#automatic-deploy)
- [Manual deploy](#manual-deploy)
- [Check External Layer Provider list](#check-external-layer-provider-list)

## Roadmap

Expand Down Expand Up @@ -163,48 +166,59 @@ The CI will use `npm ci`, which act like `npm install` but it ignores the file `

## Project deployment

The application is deployed on three targets : `dev|int|prod`
The application is deployed on three targets : `dev|int|prod`

### Automatic deploy

After every successful build, a version of `develop` and `master` are deployed
automatically.

| environment | hostname | path | branch |
|------------- |---------------------- |-------------------------|-------------- |
| PR | sys-map.dev.bgdi.ch | /preview/<branch_name> | <bug-*/feat-*>|
| dev | sys-map.dev.bgdi.ch | / | develop |
| int | sys-map.int.bgdi.ch | / | master |
| prod | sys-map.prod.bgdi.ch | / | master |

| environment | hostname | path | branch |
| ----------- | -------------------- | ---------------------- | -------------- |
| PR | sys-map.dev.bgdi.ch | /preview/<branch_name> | <bug-_/feat-_> |
| dev | sys-map.dev.bgdi.ch | / | develop |
| int | sys-map.int.bgdi.ch | / | master |
| prod | sys-map.prod.bgdi.ch | / | master |

On the `dev` and `int` targets, deployement is done **automatically** via the [CI for web-mapviewer](https://github.com/geoadmin/infra-terraform-bgdi-builder/tree/master/projects/web_mapviewer#ci-for-web-mapviewer).

A [test link](https://github.com/geoadmin/web-mapviewer/blob/bug_update_doc_regarding_deploy/.github/workflows/add-testlink-to-pr.yml) is also added to the description of every PR.


### Manual deploy

A bash script [deploy.sh](https://github.com/geoadmin/infra-terraform-bgdi-builder/blob/master/projects/web_mapviewer/scripts/deploy.sh)
is used for manual deploy, either from a local directory or a bucket from the CI.

./scripts/deploy.sh: --staging STAGING {--version VERSION | --local-src DIR} [--preview TEST_LINK]

Deploy web-mapviewer on the given staging. Either deploy a version from the
build-artifacts-swisstopo bucket (with --version option), or a local build version
using the --local-src DIR option.

OPTIONS:
-h|--help Print the help and exit.
-s|--staging STAGING Staging to deploy; dev|int|prod. Default; dev
-v|--version VERSION Version to deploy.


On `prod`, check [deploy on prod](https://github.com/geoadmin/infra-terraform-bgdi-builder/tree/master/projects/web_mapviewer#deploy-on-prod) and use the script from within `infra-terraform-bgdi-builder/projects/web_mapviewer` to deploy **manually**.

> **_NOTE:_**
> If deploying manually to `prod`, wait until the CI has finished building the project, as the deploy script only copy files.
Depending on the target (`dev|int|prod`), you will have to build and bundle/minify the app (for `int` and `prod`) or simply build the app without minification (for `dev`) prior to deplay (`npm run build:(dev|int|prod)`)

- Only `develop` branch can be deployed at the root of the `dev` bucket.
- Only `master` branch can be deployed at the root of `int` and `prod` buckets.

## Check External Layer Provider list

In the `Import` tool we provide an hardcoded list of provider via the [src/external-layer-providers.json](./src/external-layer-providers.json) file. Because we have quite a lot of provider, we have a CLI tool in order to
check their validity. The tool can also be used with a single url as input parameter to see the url would be valid
for our application.

```bash
npm install
./scripts/check-external-layers-providers.js
```

You can use `-h` option to get more detail on the script.
111 changes: 111 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/tsconfig": "^0.4.0",
"aws-sdk": "^2.1475.0",
"axios-retry": "^3.8.0",
"caniuse-lite": "^1.0.30001550",
"chai": "^4.3.10",
"cypress": "^13.3.1",
Expand All @@ -102,18 +103,21 @@
"jsdom": "^22.1.0",
"mime-types": "^2.1.35",
"mocha-junit-reporter": "^2.2.1",
"ogc-parser": "^1.5.0",
"prettier": "^3.0.3",
"prettier-plugin-jsdoc": "^1.1.1",
"rimraf": "^5.0.1",
"sass": "^1.69.4",
"start-server-and-test": "^2.0.1",
"typescript": "^5.2.2",
"vite": "^4.4.11",
"vite-node": "^0.34.6",
"vite-plugin-require": "^0.0.3",
"vite-plugin-static-copy": "^0.17.0",
"vitest": "^0.34.6",
"vue-loader": "^17.3.0",
"vue-tsc": "^1.8.19",
"write-yaml-file": "^5.0.0",
"yargs": "^17.7.2"
},
"engines": {
Expand Down
Loading

0 comments on commit 3745b3e

Please sign in to comment.