Skip to content

Commit

Permalink
0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
countnazgul committed Dec 23, 2022
1 parent a43854e commit 4796e49
Show file tree
Hide file tree
Showing 27 changed files with 156 additions and 69 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ lerna-debug.log*
*.variables.yaml
.npmrc
test.json

automatiqalCLI-example-16.yaml
automatiqal-sample.yaml
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Automatiqal CLI

[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/T6T0148ZP)

`Automatiqal CLI` is a `NodeJS` wrapper around [Automatiqal](https://github.com/informatiqal/automatiqal) package that allows automating `Qlik Sense` administration/deployment tasks by describing them in `yaml`/`json` files.

As the name suggests `Automatiqal CLI` is a command line/terminal tool.
Expand All @@ -16,11 +18,12 @@ Install as global module:
`$ automatiqal --help`
`$ automatiqal`

```
```text
--file -f Location of the file, containing the run book data
--variables, -v Location of the variable file (if needed)
--json Indicates that the run book file is in JSON format
--output, -o Saves the result in the provided path
--connect, -c Test the connectivity. No tasks are ran
--sample, -s Generate sample run book and variables files in the current folder
--help, -h Shows this message
```
Expand Down Expand Up @@ -48,8 +51,11 @@ Have a look at the [examples folder](https://github.com/Informatiqal/automatiqal

Have a look at `Automatiqal` package [wiki pages](https://github.com/Informatiqal/automatiqal/wiki) on how to structure the file and list of operations. More information will be added soon here as well

## Schema

Great little addition is the availability of [YAML schema](https://github.com/Informatiqal/automatiqal-cli-schema). The schema greatly helps when writing runbooks. Please refer to the schema's repo on how to use it (in `VSCode`)

## Limitations

- no way to test the runbook (aka `dry run`) [automatiqal #6](https://github.com/Informatiqal/automatiqal/issues/6)
- handling large files. In the current implementation all external files are read before the runbook is executed. This can be a problem when uploading large files [automatiqal #4](https://github.com/Informatiqal/automatiqal/issues/4)
- schema. It will be very helpful to have dedicated runbook schema. Such schema will ease the writing of the runbook by suggesting operation names, tasks parameters, task detail parameters and indicate their type and if they are optional. Its being worked on schema. When its in a bit better shape it will be published in its own repository with instructions how to be used
12 changes: 12 additions & 0 deletions check-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import semver from "semver";
import { readFileSync } from "fs";

const { engines } = JSON.parse(readFileSync("./package.json"));

const version = engines.node;
if (!semver.satisfies(process.version, version)) {
console.log(
`Required node version ${version} not satisfied with current version ${process.version}.`
);
process.exit(1);
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "automatiqal-cli",
"version": "0.0.15",
"version": "0.1.0",
"description": "CLI wrapper for automatiqal",
"author": {
"email": "[email protected]",
Expand Down
20 changes: 13 additions & 7 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import typescript from "rollup-plugin-typescript2";
import typescript from "@rollup/plugin-typescript";
import del from "rollup-plugin-delete";
import commonjs from "@rollup/plugin-commonjs";
import pkg from "./package.json";
import replace from "@rollup/plugin-replace";
import { readFileSync } from "fs";

const pkg = JSON.parse(readFileSync("./package.json"));

export default {
input: "src/index.ts",
output: [
{
sourcemap: true,
file: pkg.main,
format: "cjs",
format: "es",
},
],
external: [
Expand All @@ -18,12 +21,15 @@ export default {
"https",
],
plugins: [
commonjs(),
del({
targets: "dist/*",
}),
typescript({
typescript: require("typescript"),
typescript(),
replace({
values: {
__VERSION: pkg.version,
},
preventAssignment: true,
}),
],
};
2 changes: 2 additions & 0 deletions runbook-examples/automatiqalCLI-example-1.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://github.com/Informatiqal/automatiqal-cli-schema/blob/main/schemas/runbook.json?raw=true

# This runbook will:
# import qvf, create stream,
# publish the imported app to the stream (under new name)
Expand Down
5 changes: 5 additions & 0 deletions runbook-examples/automatiqalCLI-example-10.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://github.com/Informatiqal/automatiqal-cli-schema/blob/main/schemas/runbook.json?raw=true

name: Content library operations
edition: windows
environment:
Expand Down Expand Up @@ -48,6 +50,9 @@ tasks:
operation: contentLibrary.exportMany
location: ${export_location}
filter: name eq 'Temp content library'
details:
files:
- ""
- name: Remove multiple files to content library
filter: name eq 'Temp content library'
operation: contentLibrary.removeFileMany
Expand Down
2 changes: 2 additions & 0 deletions runbook-examples/automatiqalCLI-example-11.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://github.com/Informatiqal/automatiqal-cli-schema/blob/main/schemas/runbook.json?raw=true

name: Virtual Proxy operations
edition: windows
environment:
Expand Down
2 changes: 2 additions & 0 deletions runbook-examples/automatiqalCLI-example-12.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://github.com/Informatiqal/automatiqal-cli-schema/blob/main/schemas/runbook.json?raw=true

name: Tasks operations
edition: windows
environment:
Expand Down
2 changes: 2 additions & 0 deletions runbook-examples/automatiqalCLI-example-13.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://github.com/Informatiqal/automatiqal-cli-schema/blob/main/schemas/runbook.json?raw=true

name: External Task operations
edition: windows
environment:
Expand Down
2 changes: 2 additions & 0 deletions runbook-examples/automatiqalCLI-example-14.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://github.com/Informatiqal/automatiqal-cli-schema/blob/main/schemas/runbook.json?raw=true

name: Export operations
edition: windows
environment:
Expand Down
2 changes: 2 additions & 0 deletions runbook-examples/automatiqalCLI-example-15.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://github.com/Informatiqal/automatiqal-cli-schema/blob/main/schemas/runbook.json?raw=true

name: Sample run book
edition: windows
environment:
Expand Down
2 changes: 2 additions & 0 deletions runbook-examples/automatiqalCLI-example-2.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://github.com/Informatiqal/automatiqal-cli-schema/blob/main/schemas/runbook.json?raw=true

# This runbook will:
# create stream, create new custom properties and tags,
# will update the stream by adding
Expand Down
4 changes: 3 additions & 1 deletion runbook-examples/automatiqalCLI-example-3.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://github.com/Informatiqal/automatiqal-cli-schema/blob/main/schemas/runbook.json?raw=true

name: Certificate operations
edition: windows
environment:
Expand All @@ -13,7 +15,7 @@ tasks:
description: >
Export new set of certificates
for the listed machineNames
operation: certificate.export
operation: certificate.generate
details:
machineNames:
- ${host}
Expand Down
2 changes: 2 additions & 0 deletions runbook-examples/automatiqalCLI-example-4.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://github.com/Informatiqal/automatiqal-cli-schema/blob/main/schemas/runbook.json?raw=true

name: Node operations
edition: windows
environment:
Expand Down
2 changes: 2 additions & 0 deletions runbook-examples/automatiqalCLI-example-5.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://github.com/Informatiqal/automatiqal-cli-schema/blob/main/schemas/runbook.json?raw=true

name: User operations
edition: windows
environment:
Expand Down
2 changes: 2 additions & 0 deletions runbook-examples/automatiqalCLI-example-6.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://github.com/Informatiqal/automatiqal-cli-schema/blob/main/schemas/runbook.json?raw=true

name: Tasks operations
edition: windows
environment:
Expand Down
2 changes: 2 additions & 0 deletions runbook-examples/automatiqalCLI-example-7.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://github.com/Informatiqal/automatiqal-cli-schema/blob/main/schemas/runbook.json?raw=true

name: System (security and license) rules operations
edition: windows
environment:
Expand Down
2 changes: 2 additions & 0 deletions runbook-examples/automatiqalCLI-example-8.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://github.com/Informatiqal/automatiqal-cli-schema/blob/main/schemas/runbook.json?raw=true

name: Data connections operations
edition: windows
environment:
Expand Down
2 changes: 2 additions & 0 deletions runbook-examples/automatiqalCLI-example-9.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://github.com/Informatiqal/automatiqal-cli-schema/blob/main/schemas/runbook.json?raw=true

name: Extension operations
edition: windows
environment:
Expand Down
Loading

0 comments on commit 4796e49

Please sign in to comment.