# lugger

> Lugger is an automation framework running on customizable Typescript DSL

Latest version **5.2.1** (published 2023-08-01) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install lugger
pnpm add lugger
yarn add lugger
bun add lugger
```

Provides the commands `wp`, `lug`, `lugger`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.2.1 |
| Published | 2023-08-01 |
| First published | 2022-06-23 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 189 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jovian, justin-pauli |
| Keywords | lugger |

## Links

- npm: https://www.npmjs.com/package/lugger
- Repository: https://github.com/jovians/lugger
- Homepage: https://github.com/jovians/lugger#readme
- Issues: https://github.com/jovians/lugger/issues
- npm.io page: https://npm.io/package/lugger

## Dependencies (7)

- [yaml](https://npm.io/package/yaml.md) ^2.3.1
- [axios](https://npm.io/package/axios.md) ^1.4.0
- [ts-dsl](https://npm.io/package/ts-dsl.md) ^5.2.1
- [express](https://npm.io/package/express.md) ^4.18.2
- [ts-basis](https://npm.io/package/ts-basis.md) ^5.2.5
- [commander](https://npm.io/package/commander.md) ^11.0.0
- [prepend-file](https://npm.io/package/prepend-file.md) ^2.0.1

## Recent versions

- 5.2.1 (latest) — 2023-08-01
- 5.1.4 — 2023-07-31
- 5.1.3 — 2023-05-21
- 5.1.2 — 2023-05-21
- 5.1.1 — 2023-05-21
- 5.0.16 — 2023-05-20
- 5.0.15 — 2023-05-01
- 5.0.14 — 2023-05-01
- 5.0.13 — 2023-04-21
- 5.0.12 — 2023-04-21
- 5.0.11 — 2023-04-21
- 5.0.10 — 2023-04-21
- 5.0.9 — 2023-04-20
- 5.0.8 — 2023-04-20
- 5.0.7 — 2023-04-20
- … 30 more at https://npm.io/package/lugger/versions

## README

# Lugger

Lugger is an automation framework running on customizable Typescript DSL

Here are some characteristics we desire in this framework:

* **Superset** of Typescript (normal TS flow should run identically)
* Provide frequently used toolchains as **strongly-typed library**
  * SCM (e.g. git), docker (containerized workloads)
  * SSH, Shell scripting
  * Infrastructure automation (e.g. AWS, Azure, GCP, etc.)
* Ability to define workflow **declaratively**
* No need for \`await\` when using DSL (statements are auto awaited)
* Easy **concurrency** (parallel)
* All DSL processes are **serializable** (pause, stash, resume workflow)
* Built-in control against flakiness (e.g. retry, timeout, backoff, repeat, etc.)

```typescript
import { workflow, params, stage, echo, docker, file } from 'lugger';

class MyCiCdWorkFlow extends Workflow {
    
    setup() {
        git.clone({
            repo: `${env.REPO_URL}`,
            branch: 'mybranch',
            folder: './sourcecode'
        });
        sh `mkdir -p metadata`;
        echo `set-up comeplete`;
    }
    
    @stage
    'Build Docker Images'() {
        docker.pull(`nginx:latest`)
              .try(5).backoff('auto').timeout(10, 'm')
        docker.build(`myapp:${BUILD_NUMBER}`, 'sourcecode/Dockerfile')
              .try(2).timeout(10, 'm')
    }
    
    @stage
    'Run Tests'() {
        chdir(`./sourcecode`);
        parallel; {
            stage('Unit Tests'); {
                sh `python tests/unit_test_entrypont.py`
                echo `Unit Tests ended`
            }
            stage('Integration Tests'); {
                sh `bash tests/integration_suites.sh`
                echo `Integration Tests ended`
            }
        }
    }
    
    @stage
    'Deploy'() {
        const { user, pass } = SecretManager.resolve({
            user: '<secret.docker.deployerAccount.user>',
            pass: '<secret.docker.deployerAccount.pass>',
        })
        const deployedImage = `myregistry.com/myapp:${BUILD_NUMBER}`;
        docker.login('myregistry.com', user, pass)
        docker.tag(`myapp:${BUILD_NUMBER}`, deployedImage)
        docker.push(`myapp:${BUILD_NUMBER}`).try(3)
    }
    
    cleanup() {
        // release resources
    }
    
    success() {
        console.log(`I've succeeded`);
    }
    
    failure() {
        console.log(`I've failed!`);
    }

}

// entrypoint
runWorkflow(MyCiCdWorkFlow)
```

---
_Source: https://npm.io/package/lugger · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
