@o3r/pipeline 11.4.0-prerelease.45
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.
- package/LICENSE +26 -0
- package/README.md +61 -0
- package/collection.json +14 -0
- package/migration.json +5 -0
- package/package.json +168 -0
- package/schematics/ng-add/index.d.ts +8 -0
- package/schematics/ng-add/index.d.ts.map +1 -0
- package/schematics/ng-add/index.js +85 -0
- package/schematics/ng-add/schema.d.ts +12 -0
- package/schematics/ng-add/schema.d.ts.map +1 -0
- package/schematics/ng-add/schema.js +3 -0
- package/schematics/ng-add/schema.json +35 -0
- package/schematics/ng-add/templates/github/__dot__github/actions/setup/action.yml +21 -0
- package/schematics/ng-add/templates/github/__dot__github/workflows/main.yml +66 -0
- package/schematics/package.json +3 -0
- package/src/public_api.d.ts +2 -0
- package/src/public_api.d.ts.map +1 -0
- package/src/public_api.js +3 -0
- package/src/public_api.js.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Copyright Amadeus SAS
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
4
|
+
are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
7
|
+
list of conditions and the following disclaimer.
|
|
8
|
+
|
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
+
this list of conditions and the following disclaimer in the documentation and/or
|
|
11
|
+
other materials provided with the distribution.
|
|
12
|
+
|
|
13
|
+
3. Neither the name of the copyright holder nor the names of its contributors
|
|
14
|
+
may be used to endorse or promote products derived from this software without
|
|
15
|
+
specific prior written permission.
|
|
16
|
+
|
|
17
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
18
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
19
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
21
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
22
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
23
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
24
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
25
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
26
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<h1 align="center">Otter Pipeline</h1>
|
|
2
|
+
<p align="center">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/AmadeusITGroup/otter/main/assets/logo/otter.png" alt="Super cute Otter!" width="40%"/>
|
|
4
|
+
</p>
|
|
5
|
+
|
|
6
|
+
This package is an [Otter Framework Module](https://github.com/AmadeusITGroup/otter/tree/main/docs/core/MODULE.md).
|
|
7
|
+
<br />
|
|
8
|
+
<br />
|
|
9
|
+
|
|
10
|
+
## Description
|
|
11
|
+
|
|
12
|
+
[](https://www.npmjs.com/package/@o3r/pipeline)
|
|
13
|
+
[](https://www.npmjs.com/package/@o3r/pipeline)
|
|
14
|
+
|
|
15
|
+
This module contains tooling around DevOps toolchains.
|
|
16
|
+
|
|
17
|
+
## How to install
|
|
18
|
+
|
|
19
|
+
```shell
|
|
20
|
+
ng add @o3r/pipeline
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Description
|
|
24
|
+
|
|
25
|
+
The `ng add` schematic for Otter Pipeline helps you set up a DevOps pipeline for your frontend project. This schematic configures the necessary CI runner and npm registry settings to streamline your development workflow.
|
|
26
|
+
|
|
27
|
+
### Properties
|
|
28
|
+
|
|
29
|
+
- `toolchain`: The DevOps toolchain to create. For now, only `GitHub` is supported.
|
|
30
|
+
- `runner`: The CI runner. Default is `ubuntu-latest`.
|
|
31
|
+
- `npmRegistry`: A custom npm registry. By default, the public one (https://registry.npmjs.org) will be used.
|
|
32
|
+
|
|
33
|
+
### Usage
|
|
34
|
+
|
|
35
|
+
Here is an example of how to use the `ng add` schematics with parameters:
|
|
36
|
+
|
|
37
|
+
```shell
|
|
38
|
+
ng add @o3r/pipeline --runner=windows-latest --npmRegistry=https://custom-registry.example.com
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Private NPM Registry
|
|
42
|
+
|
|
43
|
+
When a custom npm registry is provided, the schematic will automatically create a `.npmrc` (or a `.yarnrc`) file with the specified registry.
|
|
44
|
+
Additionally, it will set the necessary environment variables for the install task.
|
|
45
|
+
|
|
46
|
+
```yaml
|
|
47
|
+
- name: Install
|
|
48
|
+
env:
|
|
49
|
+
COREPACK_NPM_REGISTRY: https://custom-registry.example.com
|
|
50
|
+
COREPACK_INTEGRITY_KEYS: ""
|
|
51
|
+
shell: bash
|
|
52
|
+
run: npm ci
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If you choose to run the schematic without specifying an `npmRegistry`, you may need to manually apply these changes afterwards.
|
|
56
|
+
|
|
57
|
+
### GitHub workflow
|
|
58
|
+
|
|
59
|
+
The generated pipeline ensures that your code is built, tested and linted on every push or pull request to the main and release branches.
|
|
60
|
+
|
|
61
|
+
It also automates the versioning thanks to the [Otter - New Version GitHub Action](https://github.com/AmadeusITGroup/otter/tree/main/tools/github-actions/new-version#readme) and release process by creating a new release on GitHub and generating release notes.
|
package/collection.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/angular/angular-cli/master/packages/angular_devkit/schematics/collection-schema.json",
|
|
3
|
+
"schematics": {
|
|
4
|
+
"ng-add": {
|
|
5
|
+
"description": "Add Otter Pipeline to the project.",
|
|
6
|
+
"factory": "./schematics/ng-add/index#ngAdd",
|
|
7
|
+
"schema": "./schematics/ng-add/schema.json",
|
|
8
|
+
"aliases": [
|
|
9
|
+
"install",
|
|
10
|
+
"i"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
package/migration.json
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@o3r/pipeline",
|
|
3
|
+
"version": "11.4.0-prerelease.45",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"typings": "./src/public_api.d.ts",
|
|
8
|
+
"main": "src/public_api.js",
|
|
9
|
+
"description": "A package that provides toolchain related helpers.",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"toolchain",
|
|
12
|
+
"pipeline",
|
|
13
|
+
"otter",
|
|
14
|
+
"otter-module"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"nx": "nx",
|
|
18
|
+
"ng": "yarn nx",
|
|
19
|
+
"test": "yarn nx test pipeline",
|
|
20
|
+
"copy:templates": "yarn cpy 'schematics/**/templates{-*,}/**/*' dist/schematics",
|
|
21
|
+
"prepare:build:builders": "yarn cpy '{collection,migration}.json' dist && yarn cpy 'schematics/**/schema.json' dist/schematics && yarn copy:templates",
|
|
22
|
+
"prepare:publish": "prepare-publish ./dist && yarn write-git-hash",
|
|
23
|
+
"build:source": "tsc -b tsconfig.build.json && yarn cpy package.json dist/",
|
|
24
|
+
"build:builders": "tsc -b tsconfig.builders.json --pretty && yarn copy:templates && yarn generate-cjs-manifest",
|
|
25
|
+
"build": "yarn nx build pipeline",
|
|
26
|
+
"postbuild": "patch-package-json-main"
|
|
27
|
+
},
|
|
28
|
+
"exports": {
|
|
29
|
+
"./package.json": {
|
|
30
|
+
"default": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
".": {
|
|
33
|
+
"default": "./src/public_api.js",
|
|
34
|
+
"typings": "./src/public_api.d.ts"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"js-yaml": "^4.1.0",
|
|
39
|
+
"tslib": "^2.6.2"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@o3r/schematics": "^11.4.0-prerelease.45",
|
|
43
|
+
"@o3r/telemetry": "^11.4.0-prerelease.45"
|
|
44
|
+
},
|
|
45
|
+
"peerDependenciesMeta": {
|
|
46
|
+
"@o3r/schematics": {
|
|
47
|
+
"optional": true
|
|
48
|
+
},
|
|
49
|
+
"@o3r/telemetry": {
|
|
50
|
+
"optional": true
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@angular-devkit/architect": "~0.1802.0",
|
|
55
|
+
"@angular-devkit/core": "~18.2.0",
|
|
56
|
+
"@angular-devkit/schematics": "~18.2.0",
|
|
57
|
+
"@angular-eslint/eslint-plugin": "~18.3.0",
|
|
58
|
+
"@compodoc/compodoc": "^1.1.19",
|
|
59
|
+
"@nx/eslint-plugin": "~19.5.0",
|
|
60
|
+
"@nx/jest": "~19.5.0",
|
|
61
|
+
"@nx/js": "~19.5.0",
|
|
62
|
+
"@o3r/build-helpers": "^11.4.0-prerelease.45",
|
|
63
|
+
"@o3r/eslint-plugin": "^11.4.0-prerelease.45",
|
|
64
|
+
"@o3r/schematics": "^11.4.0-prerelease.45",
|
|
65
|
+
"@o3r/telemetry": "^11.4.0-prerelease.45",
|
|
66
|
+
"@o3r/test-helpers": "^11.4.0-prerelease.45",
|
|
67
|
+
"@schematics/angular": "~18.2.0",
|
|
68
|
+
"@stylistic/eslint-plugin-ts": "~2.4.0",
|
|
69
|
+
"@types/jest": "~29.5.2",
|
|
70
|
+
"@types/js-yaml": "^4.0.5",
|
|
71
|
+
"@types/node": "^20.0.0",
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
|
73
|
+
"@typescript-eslint/parser": "^7.14.1",
|
|
74
|
+
"@typescript-eslint/utils": "^7.14.1",
|
|
75
|
+
"cpy-cli": "^5.0.0",
|
|
76
|
+
"eslint": "^8.57.0",
|
|
77
|
+
"eslint-import-resolver-node": "^0.3.9",
|
|
78
|
+
"eslint-plugin-jest": "~28.8.0",
|
|
79
|
+
"eslint-plugin-jsdoc": "~48.11.0",
|
|
80
|
+
"eslint-plugin-prefer-arrow": "~1.2.3",
|
|
81
|
+
"eslint-plugin-unicorn": "^54.0.0",
|
|
82
|
+
"jest": "~29.7.0",
|
|
83
|
+
"jest-junit": "~16.0.0",
|
|
84
|
+
"jsonc-eslint-parser": "~2.4.0",
|
|
85
|
+
"nx": "~19.5.0",
|
|
86
|
+
"pid-from-port": "^1.1.3",
|
|
87
|
+
"ts-jest": "~29.2.0",
|
|
88
|
+
"ts-node": "~10.9.2",
|
|
89
|
+
"type-fest": "^4.10.2",
|
|
90
|
+
"typescript": "~5.5.4"
|
|
91
|
+
},
|
|
92
|
+
"engines": {
|
|
93
|
+
"node": "^18.19.1 || ^20.11.1 || >=22.0.0"
|
|
94
|
+
},
|
|
95
|
+
"schematics": "./collection.json",
|
|
96
|
+
"ng-update": {
|
|
97
|
+
"migrations": "./migration.json"
|
|
98
|
+
},
|
|
99
|
+
"contributors": [
|
|
100
|
+
{
|
|
101
|
+
"name": "Yannick Adam",
|
|
102
|
+
"url": "https://github.com/yannickadam",
|
|
103
|
+
"email": "yannickadam@users.noreply.github.com"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "Kilian Panot",
|
|
107
|
+
"url": "https://github.com/kpanot",
|
|
108
|
+
"email": "kpanot@users.noreply.github.com"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "Jeremy Bourgeois",
|
|
112
|
+
"url": "https://github.com/jbourgeois-1A",
|
|
113
|
+
"email": "jbourgeois-1A@users.noreply.github.com"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "Pierre Henri Ginoux",
|
|
117
|
+
"url": "https://github.com/pginoux-1A",
|
|
118
|
+
"email": "pginoux-1A@users.noreply.github.com"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "Mircea Vasile Rednic",
|
|
122
|
+
"url": "https://github.com/mrednic-1A",
|
|
123
|
+
"email": "mrednic-1A@users.noreply.github.com"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "Stephane Dalle",
|
|
127
|
+
"url": "https://github.com/sdalle-1A",
|
|
128
|
+
"email": "sdalle-1A@users.noreply.github.com"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "Nicolas Hoffmann",
|
|
132
|
+
"url": "https://github.com/nhoffmann-1A",
|
|
133
|
+
"email": "nhoffmann-1A@users.noreply.github.com"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"name": "Victor Scaiceanu",
|
|
137
|
+
"url": "https://github.com/vscaiceanu-1a",
|
|
138
|
+
"email": "vscaiceanu-1A@users.noreply.github.com"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "Florian Paul",
|
|
142
|
+
"url": "https://github.com/fpaul-1A",
|
|
143
|
+
"email": "fpaul-1A@users.noreply.github.com"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "Corinne Paulve",
|
|
147
|
+
"url": "https://github.com/cpaulve-1A",
|
|
148
|
+
"email": "cpaulve-1A@users.noreply.github.com"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "Matthieu Crouzet",
|
|
152
|
+
"url": "https://github.com/matthieu-crouzet",
|
|
153
|
+
"email": "matthieu-crouzet@users.noreply.github.com"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "Salome Do",
|
|
157
|
+
"url": "https://github.com/sdo-1A",
|
|
158
|
+
"email": "sdo-1A@users.noreply.github.com"
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"bugs": "https://github.com/AmadeusITGroup/otter/issues",
|
|
162
|
+
"repository": {
|
|
163
|
+
"type": "git",
|
|
164
|
+
"url": "git+https://github.com/AmadeusITGroup/otter.git"
|
|
165
|
+
},
|
|
166
|
+
"license": "BSD-3-Clause",
|
|
167
|
+
"homepage": "https://amadeusitgroup.github.io/otter/"
|
|
168
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
import type { NgAddSchematicsSchema } from './schema';
|
|
3
|
+
/**
|
|
4
|
+
* Add an Otter CI pipeline to an Angular project
|
|
5
|
+
* @param options
|
|
6
|
+
*/
|
|
7
|
+
export declare const ngAdd: (options: NgAddSchematicsSchema) => Rule;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,IAAI,EAAiB,MAAM,4BAA4B,CAAC;AAC/G,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAyEtD;;;GAGG;AACH,eAAO,MAAM,KAAK,YAAa,qBAAqB,KAAG,IAQtD,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ngAdd = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const js_yaml_1 = require("js-yaml");
|
|
6
|
+
const path = require("node:path");
|
|
7
|
+
const fs = require("node:fs");
|
|
8
|
+
/**
|
|
9
|
+
* Add an Otter CI pipeline to an Angular Project
|
|
10
|
+
* @param options
|
|
11
|
+
*/
|
|
12
|
+
function ngAddFn(options) {
|
|
13
|
+
return async (tree, context) => {
|
|
14
|
+
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
15
|
+
const ownPackageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf8' }));
|
|
16
|
+
const commitHash = ownPackageJson.o3rConfig?.commitHash;
|
|
17
|
+
const ownVersion = ownPackageJson.version;
|
|
18
|
+
const actionVersionString = commitHash ? `${commitHash} # v${ownVersion}` : ownVersion;
|
|
19
|
+
let packageManager = 'npm';
|
|
20
|
+
try {
|
|
21
|
+
const schematics = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
22
|
+
packageManager = schematics.getPackageManager({ workspaceConfig: schematics.getWorkspaceConfig(tree) });
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
packageManager = tree.exists('/yarn.lock') ? 'yarn' : 'npm';
|
|
26
|
+
}
|
|
27
|
+
context.logger.info(`Setting up pipeline for package manager: "${packageManager}" `);
|
|
28
|
+
const setupCommand = packageManager === 'yarn' ? 'yarn install --immutable' : 'npm ci';
|
|
29
|
+
const baseTemplateSource = (0, schematics_1.apply)((0, schematics_1.url)(`./templates/${options.toolchain}`), [
|
|
30
|
+
(0, schematics_1.template)({
|
|
31
|
+
...options,
|
|
32
|
+
packageManager,
|
|
33
|
+
setupCommand,
|
|
34
|
+
actionVersionString,
|
|
35
|
+
dot: '.'
|
|
36
|
+
}),
|
|
37
|
+
(0, schematics_1.move)(tree.root.path)
|
|
38
|
+
]);
|
|
39
|
+
const npmRegistryRule = () => {
|
|
40
|
+
if (!options.npmRegistry) {
|
|
41
|
+
return tree;
|
|
42
|
+
}
|
|
43
|
+
if (packageManager === 'yarn') {
|
|
44
|
+
const yarnrcPath = '/.yarnrc.yml';
|
|
45
|
+
if (!tree.exists(yarnrcPath)) {
|
|
46
|
+
tree.create(yarnrcPath, (0, js_yaml_1.dump)({ 'npmRegistryServer': options.npmRegistry }, { indent: 2 }));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const yarnrcContent = (0, js_yaml_1.load)(tree.readText(yarnrcPath));
|
|
50
|
+
yarnrcContent.npmRegistryServer = options.npmRegistry;
|
|
51
|
+
tree.overwrite(yarnrcPath, (0, js_yaml_1.dump)(yarnrcContent, { indent: 2 }));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if (packageManager === 'npm') {
|
|
55
|
+
const npmrcPath = '/.npmrc';
|
|
56
|
+
const npmRegistry = `registry=${options.npmRegistry}`;
|
|
57
|
+
if (!tree.exists(npmrcPath)) {
|
|
58
|
+
tree.create(npmrcPath, npmRegistry);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
const npmrcContent = tree.readText(npmrcPath);
|
|
62
|
+
tree.overwrite(npmrcPath, npmrcContent.concat(`\n${npmRegistry}`));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return tree;
|
|
66
|
+
};
|
|
67
|
+
const rules = [
|
|
68
|
+
(0, schematics_1.mergeWith)(baseTemplateSource, schematics_1.MergeStrategy.Overwrite),
|
|
69
|
+
npmRegistryRule
|
|
70
|
+
];
|
|
71
|
+
return () => (0, schematics_1.chain)(rules)(tree, context);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Add an Otter CI pipeline to an Angular project
|
|
76
|
+
* @param options
|
|
77
|
+
*/
|
|
78
|
+
const ngAdd = (options) => async (_, { logger }) => {
|
|
79
|
+
return await Promise.resolve().then(() => require('@o3r/schematics')).catch(() => {
|
|
80
|
+
logger.warn(`You are trying to add '@o3r/pipeline' on a project that does not have '@o3r/schematics' as a dependency.
|
|
81
|
+
Please run 'ng add @o3r/schematics' before for a more robust setup. Trying to guess the package manager.`);
|
|
82
|
+
}).then((schematics) => schematics ? schematics.createSchematicWithMetricsIfInstalled(ngAddFn)(options) : ngAddFn(options));
|
|
83
|
+
};
|
|
84
|
+
exports.ngAdd = ngAdd;
|
|
85
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SchematicOptionObject } from '@o3r/schematics';
|
|
2
|
+
type Toolchains = 'github';
|
|
3
|
+
export interface NgAddSchematicsSchema extends SchematicOptionObject {
|
|
4
|
+
/** The DevOps toolchain to create */
|
|
5
|
+
toolchain: Toolchains;
|
|
6
|
+
/** The CI runner */
|
|
7
|
+
runner: string;
|
|
8
|
+
/** A custom npm registry */
|
|
9
|
+
npmRegistry?: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,KAAK,UAAU,GAAG,QAAQ,CAAC;AAE3B,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAElE,qCAAqC;IACrC,SAAS,EAAE,UAAU,CAAC;IAEtB,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;IAEf,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "ngAddSchematicsSchema",
|
|
4
|
+
"title": "Add Otter o3r-pipeline",
|
|
5
|
+
"description": "ngAdd Otter o3r-pipeline",
|
|
6
|
+
"properties": {
|
|
7
|
+
"toolchain": {
|
|
8
|
+
"description": "The DevOps toolchain to create.",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"default": "github",
|
|
11
|
+
"enum": [
|
|
12
|
+
"github"
|
|
13
|
+
],
|
|
14
|
+
"x-prompt": {
|
|
15
|
+
"message": "Which DevOps toolchain would you like to generate?",
|
|
16
|
+
"type": "list",
|
|
17
|
+
"items": [
|
|
18
|
+
{ "value": "github", "label": "GITHUB - Setup, build, test and basic code checks for a GitHub project." }
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"runner": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "The CI runner.",
|
|
25
|
+
"default": "ubuntu-latest"
|
|
26
|
+
},
|
|
27
|
+
"npmRegistry": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "A custom npm registry (the public one will be used by default)."
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"additionalProperties": true,
|
|
33
|
+
"required": [
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Setup and Install
|
|
2
|
+
description: Sets up Node.js and installs dependencies
|
|
3
|
+
|
|
4
|
+
runs:
|
|
5
|
+
using: "composite"
|
|
6
|
+
steps:
|
|
7
|
+
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
|
|
8
|
+
with:
|
|
9
|
+
node-version: 20
|
|
10
|
+
cache: <%= packageManager %>
|
|
11
|
+
- name: Enable Corepack
|
|
12
|
+
shell: bash
|
|
13
|
+
run: corepack enable
|
|
14
|
+
- name: Install
|
|
15
|
+
<% if (npmRegistry) { %>
|
|
16
|
+
env:
|
|
17
|
+
COREPACK_NPM_REGISTRY: <%= npmRegistry %>
|
|
18
|
+
COREPACK_INTEGRITY_KEYS: ""
|
|
19
|
+
<% } %>
|
|
20
|
+
shell: bash
|
|
21
|
+
run: <%= setupCommand %>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
name: Main CI
|
|
2
|
+
|
|
3
|
+
env:
|
|
4
|
+
DEFAULT_BRANCH: main
|
|
5
|
+
DEFAULT_BRANCH_PRERELEASE_NAME: prerelease
|
|
6
|
+
RELEASE_BRANCH_REGEX: 'release\/(0|[1-9]\d*)\.(0|[1-9]\d*)(\.0-(?:next|prerelease|rc))?$'
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
branches:
|
|
11
|
+
- main
|
|
12
|
+
- 'release/*'
|
|
13
|
+
pull_request:
|
|
14
|
+
branches:
|
|
15
|
+
- main
|
|
16
|
+
- 'release/*'
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
build:
|
|
20
|
+
runs-on: <%= runner %>
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
23
|
+
- uses: ./.github/actions/setup
|
|
24
|
+
- name: Build
|
|
25
|
+
run: <%= packageManager %> run build
|
|
26
|
+
|
|
27
|
+
unit-tests:
|
|
28
|
+
runs-on: <%= runner %>
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
31
|
+
- uses: ./.github/actions/setup
|
|
32
|
+
- name: Unit tests
|
|
33
|
+
run: <%= packageManager %> run test
|
|
34
|
+
|
|
35
|
+
lint:
|
|
36
|
+
runs-on: <%= runner %>
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
39
|
+
- uses: ./.github/actions/setup
|
|
40
|
+
- name: Lint
|
|
41
|
+
run: <%= packageManager %> run lint
|
|
42
|
+
|
|
43
|
+
release:
|
|
44
|
+
permissions:
|
|
45
|
+
contents: write
|
|
46
|
+
runs-on: <%= runner %>
|
|
47
|
+
outputs:
|
|
48
|
+
nextVersionTag: ${{ steps.new-version.outputs.nextVersionTag }}
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
51
|
+
- name: New version
|
|
52
|
+
if: github.event_name != 'merge_group'
|
|
53
|
+
id: new-version
|
|
54
|
+
uses: AmadeusITGroup/otter/tools/github-actions/new-version@<%= actionVersionString %>
|
|
55
|
+
with:
|
|
56
|
+
defaultBranch: ${{ env.DEFAULT_BRANCH }}
|
|
57
|
+
defaultBranchPrereleaseName: ${{ env.DEFAULT_BRANCH_PRERELEASE_NAME }}
|
|
58
|
+
releaseBranchRegExp: ${{ env.RELEASE_BRANCH_REGEX }}
|
|
59
|
+
- name: Create release
|
|
60
|
+
if: github.event_name != 'pull_request'
|
|
61
|
+
uses: AmadeusITGroup/otter/tools/github-actions/release@<%= actionVersionString %>
|
|
62
|
+
with:
|
|
63
|
+
version: ${{ steps.newVersion.outputs.nextVersionTag }}
|
|
64
|
+
target: ${{ github.ref_name }}
|
|
65
|
+
env:
|
|
66
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public_api.d.ts","sourceRoot":"","sources":["../../src/public_api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public_api.js","sourceRoot":"","sources":["../../src/public_api.ts"],"names":[],"mappings":""}
|