K8S job to import stats from JIRA to the DTSSE dashboard database.
Running the script requires the following tools to be installed in your environment:
Install dependencies by executing the following command:
$ yarn install
Run:
$ yarn start
To run the script locally you will need some environment variables set in .env
:
JIRA_TOKEN=[your PAT token]
DATABASE_URL=postgres://localhost:5432/dashboard
You will also need to have a local postgres database running on port 5432 with a database called dashboard
and a schema called jira
.
All queries in ./src/main/query
will be executed and the rows returned will be persisted in the database. The store
function expects a
table with the file name of the query to have been created with the migration scripts. Hyphens will be converted to underscores, so results from
query/issue.ts
will be stored in the issue
table.
To run an individual query use:
yarn start:dev [your-query-file-name] # e.g. yarn start:dev issue
Run: yarn migration:create [name]
to create a new migration.
Migrations are automatically run when before the queries are executed.
To roll back a migration run: Run:
yarn migration:down [name]`.
We use ESLint
Running the linting with auto fix:
$ yarn lint --fix
This template app uses Jest as the test engine. You can run unit tests by executing the following command:
$ yarn test
This project is licensed under the MIT License - see the LICENSE file for details