Skip to content

Commit

Permalink
First stable version of package (#1)
Browse files Browse the repository at this point in the history
* init: draft project

* fix: change json file and renew docs

* fix: add logs and description

* fix: delete workflow dispatch

* fix: move build step

* fix: move to official registry

* fix: disable strict

* fix: make more user-friendly config settings

* docs: rename repo

* fix: fmt file

Co-authored-by: C5345365 <[email protected]>
  • Loading branch information
Mikita Sharayeu and MikitaSharayeu authored Oct 9, 2022
1 parent 1167523 commit a2bbf6d
Show file tree
Hide file tree
Showing 23 changed files with 5,825 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest"
},
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
},
"ignorePatterns": ["dist/*"]
}
28 changes: 28 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: develop

on:
pull_request:
branches: [develop]
paths-ignore:
- "README.md"
- "LICENSE"
push:
branches: [develop]
paths-ignore:
- "README.md"
- "LICENSE"

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Install NPM requirements"
run: npm install
- name: "Lint"
run: npm run lint
- name: "Build module"
run: tsc
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src/
tsconfig.json
.eslintrc.json
.prettierrc.json
13 changes: 13 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"overrides": [
{
"files": "src/**/*.ts",
"options": {
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"tabWidth": 4
}
}
]
}
68 changes: 66 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,66 @@
# keptn-provisioning
This GHA (main branch) and NPM package(dev branch) use for Keptn provisioning
# keptn-provisioning-npm

[![Standard - JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](http://standardjs.com/)

[![NPM](https://nodei.co/npm/keptn-provisioning.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/keptn-provisioning/)

Create or update projects, stages, and services Keptn. Also enabled monitoring for SLO.

#### Example

```js
import { provisioning } from "keptn-provisioning";

// If you select this section will use port-forwarding and Keptn API token will get from K8s secrets
const keptnResourcesInKubernetes = `{
"enabled": true,
"namespace": "keptn",
"secret": "keptn-api-token",
"service": "api-gateway-nginx"
}`;

// If you have public Keptn URL and `enabled = false` please fill these settings
const keptnAuth = `{
"keptnURL": "",
"token": ""
}`;

const config = `{
"projects": [
{
"name": "test",
"github": {
"url": "https://github.test.com",
"user": "github-user",
"token": "github-pat",
// For personal repo - "owner" is similar with "user"
"owner": "github-organization-name",
"repo": "github-repo-name",
"isPrivateRepo": true,
"isOrganization": true,
"isEnterprise": true
},
"stages": [
{
"name": "develop"
}
],
"services": [
{
"name": "test",
// Upload all files from this folder (optional)
"workdir": "services/test",
// Enable monitoring for SLO (optional)
"monitoring": {
"enabled": true,
"type": "prometheus"
}
}
],
"shipyardPath": "projects/test/shipyard.yaml"
}
]
}`;

provisioning(config, keptnAuth, keptnResourcesInKubernetes);
```
Loading

0 comments on commit a2bbf6d

Please sign in to comment.