DepCharge is a tool designed to help orchestrate the execution of commands across many directories at once.

DepCharge

Go Report Card Build Status coverage report GitHub license GitHub release Maintainability

DepCharge is a tool that helps orchestrate the execution of commands across the many dependencies and directories in larger projects. It also provides an excellent mechanism for self-documenting a project's vast (and often disparate) dependencies.

Sneak peek:

depcharge --labels=api -- git clone {{repo}} {{location}}

Will run git clone across all listed git dependencies with the label of "api" in your project (where submodules use to rule the land)

Introduction

By creating a YAML file that describes all of your project(s) dependencies, you can then execute commands across all of them simultaneously.

A medium-to-large sized project (especially when using a microservice architecture) will consist of 3 or more separate repositories, and rely on a variety of package managers depending on the various languages chosen for each service. Typically, these repos must be managed, tracked, and released in some semblance of unison so that the dependant service calls can be understood and responded to appropriately.

For small (to single) teams, a single developer will often need to propagating and perform the same commands across all relevant services. This is a tedious, manual, and error-prone process that can occur every release.

DepCharge is designed to help fix that.

How it Works & Usage

DepCharge is a tool designed to help orchestrate the execution of commands across many directories at once. All of the examples here are just that: examples. DepCharge is designed to be as flexible as possible, so if you happen to use tools other than what's listed, they should work as well!

Usage: depcharge [version] [--help|-h] [--dryrun|-d] [--force|-f] [--kind|-k=<kind>] [--instead|-x=<action>] [[--include|-i][-e|--exclude]] [--labels|-l=<comma-separated,inherited>] [--serial|-s] -- COMMAND [ARGS...]

Features:

  • Built-in mustache templating, allows you to parametrize your commands
  • Supports arbitrary params in YAML, whatever 'params: key: value' pairs you want (particularly useful for mustache templating)
  • Supports YAML anchors
    • Even went the extra mile to support anchors + sequence merging via merge-deps: (see: YAML Anchors & Sequences)

Description:

depcharge will read the dep.yml file in the current working directory, and perform all commands relative to that location.

Example dep.yml:

deps:
    - name: frontend
      kind: git
      location: ./app/frontend
      labels:
        - public
      params:
        repo: [email protected]:frontend.git
      deps:
        - name: vue.js
          kind: npm
    - name: backend
      kind: git
      location: ./app/backend
      labels:
        - api
      params:
        repo: [email protected]:backend.git
      deps:
        - name: lumen
          kind: composer

Flags

   --version  Displays the program version string.
-h --help  Displays help with available flag, subcommand, and positional value parameters.
-d --dryrun  Will print out the command to be run, does not make changes to your system.
-e --exclusive  Applies labels in an exclusive way (default).
-f --force  Will force-run a command without confirmations, could be dangerous.
-i --inclusive  Applies labels in an inclusive way.
-k --kind  Targets specific kinds of dependencies (i.e. git, npm, composer)
-l --labels  Filters to specific labels.
-s --serial  Prevents parallel execution, runs commands one at a time.
-x --instead  Instead of 'kind', perform a different command.

Example commands:

Will run git clone <repo> <location> across all git dependencies:

depcharge --kind=git -- clone {{repo}} {{location}}

Or, shorthand:

depcharge -- git clone {{repo}} {{location}}

Will run git status across all git dependencies:

depcharge -- git status

Will run npm install across any npm dependencies that have the label 'public':

depcharge --labels=public -- npm install

Will run composer install across any composer dependencies that have either the label 'api', or 'soap':

depcharge --inclusive --labels=api,soap -- composer install

And much more!

YAML Anchors & Sequences

Due to a limitation in YAML itself, you cannot use anchors to merge sequences (arrays). Therefore this is programatically supported within DepCharge.

Invalid YAML, you cannot mix sequences - with anchors *<name> directly, this doesn't work:

...
    deps:
      - kind: git
      - *composer
      - *vue
...

It's a beautiful concept though, that really helps with reusability and simplifies the overall YAML file, and so merge-deps was introduced to work around this shortcoming.

Working around this with merge-deps:

.vue: &vue
  - name: Vue.js
    kind: npm
.composer: &composer
  - name: lumen
    kind: composer
    
deps:
  - name: ui
    kind: project
    location: ./code/app
    labels:
      - ui
    deps:
      - kind: git
        params:
          repo: [email protected]/ui.git
    merge-deps:
      - *composer
      - *vue

In the above example, merge-deps: supports listing your anchors, and these will then be expanded, then flattened and merged into deps: before final processing begins.

Special Action Handlers

DepCharge has the ability to offer special-case action handlers. Specifically for situations where executing bulk commands cause difficulties and/or there are unexpected rough edges.

  1. git clone This is treated specially, in the sense that a regular clone will not act if parent directories aren't already in place. DepCharge will detect the clone action explicitly and attempt to create any parent directories before passing the command directly onto git

Additional Resources

Contributing

See: CONTRIBUTING.md

License

Similar Resources

Kubernetes is an open source system for managing containerized applications across multiple hosts.

Kubernetes is an open source system for managing containerized applications across multiple hosts.

Kubernetes Kubernetes is an open source system for managing containerized applications across multiple hosts. It provides basic mechanisms for deploym

Nov 25, 2021

Deploy, manage, and secure applications and resources across multiple clusters using CloudFormation and Shipa

CloudFormation provider Deploy, secure, and manage applications across multiple clusters using CloudFormation and Shipa. Development environment setup

Feb 12, 2022

Enforcing per team quota (sum of used resources across all their namespaces) and delegating the per namespace quota to users.

Quota Operator Enforcing per team quota (sum of used resources across all their namespaces) and delegating the per namespace quota to users. Instructi

Nov 9, 2022

A Kubernetes operator that allows for automatic provisioning and distribution of cert-manager certs across namespaces

cached-certificate-operator CachedCertificate Workflow When a CachedCertificate is created or updated the operator does the following: Check for a val

Sep 6, 2022

Go Trusted Execution Environment (TEE)

Go Trusted Execution Environment (TEE)

Introduction The GoTEE framework implements concurrent instantiation of TamaGo based unikernels in privileged and unprivileged modes, interacting with

Dec 5, 2022

Kubernetes-native framework for test definition and execution

████████ ███████ ███████ ████████ ██ ██ ██ ██ ██████ ███████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ █████

Dec 31, 2022

KNoC is a Kubernetes Virtual Kubelet that uses an HPC cluster as the container execution environment

KNoC is a Kubernetes Virtual Kubelet that uses an HPC cluster as the container execution environment

Kubernetes Node on Cluster KNoC is a Virtual Kubelet Provider implementation that manages real pods and containers in a remote container runtime by su

Oct 26, 2022

Test-at-scale - TAS - An intelligent test execution platform for engineering teams to achieve high development velocity

Test-at-scale - TAS - An intelligent test execution platform for engineering teams to achieve high development velocity

Test At Scale Test Smarter, Release Faster with test-at-scale. Status Table of c

Dec 22, 2022

Command-line tool to remotely execute commands on Windows machines through WinRM

winrm-cli This is a Go command-line executable to execute remote commands on Windows machines through the use of WinRM/WinRS. Note: this tool doesn't

Dec 15, 2022
Comments
  • unrecognized option causes immediately-following --labels option to be ignored

    unrecognized option causes immediately-following --labels option to be ignored

    When running: depcharge --dry-run --labels=excel --exclusive -- git clone {{clockwork}} {{location}}

    I see... Warning: No labels, using all deps of kind. Are you sure you want to continue? [y|N]:

    ...because --dry-run is an invalid option (should be --dryrun or -d) which causes --labels to be ignored.

    Doing it correctly: depcharge --dryrun --labels=excel --exclusive -- git clone {{clockwork}} {{location}}

    Causes the expected Dry run of: git clone [email protected]:clockworkers/group-excel-generator.git /home/joshua/further/docker-scaffolding/applications/group/code/service/excel-generator for: /home/joshua/further/docker-scaffolding/applications/group/code/service/excel-generator depcharge complete!

Aceptadora provides the boilerplate to orchestrate the containers for an acceptance test.

aceptadora Aceptadora provides the boilerplate to orchestrate the containers for an acceptance test. Aceptadora is a replacement for docker-compose in

Nov 16, 2022
Open Source runtime tool which help to detect malware code execution and run time mis-configuration change on a kubernetes cluster
Open Source runtime tool which help to detect malware code execution and run time mis-configuration change on a kubernetes cluster

Kube-Knark Project Trace your kubernetes runtime !! Kube-Knark is an open source tracer uses pcap & ebpf technology to perform runtime tracing on a de

Sep 19, 2022
An open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developersAn open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developers
An open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developersAn open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developers

Developer-oriented Continuous Delivery Product ⁣ English | 简体中文 Table of Contents Zadig Table of Contents What is Zadig Quick start How to use? How to

Oct 19, 2021
Go package exposing a simple interface for executing commands, enabling easy mocking and wrapping of executed commands.

go-runner Go package exposing a simple interface for executing commands, enabling easy mocking and wrapping of executed commands. The Runner interface

Oct 18, 2022
Parallel S3 and local filesystem execution tool.
Parallel S3 and local filesystem execution tool.

s5cmd Overview s5cmd is a very fast S3 and local filesystem execution tool. It comes with support for a multitude of operations including tab completi

Jan 5, 2023
sget is a keyless safe script retrieval and execution tool

sget ⚠️ Not ready for use yet! sget is a keyless safe script retrieval and execution tool Security Should you discover any security issues, please ref

Dec 18, 2022
Beagle is a CLI written in Go to search for an specific username across the Internet.

Beagle __ \,--------/_/'--o Use beagle with /_ ___ /~" responsibility. /_/_/ /_/_/ ^^^^^^^^^^^^^^^^^^ Beagle is a CLI w

Nov 16, 2022
Manage your dotfiles across multiple diverse machines, securely.

chezmoi Manage your dotfiles across multiple diverse machines, securely. With chezmoi, you can install chezmoi and your dotfiles on a new, empty machi

Dec 30, 2022
Developer Self-Service Across Clusters

Monoskope (m8) Monoskope (short m8 spelled "mate") implements the management and operation of tenants, users and their roles in a Kubernetes multi-clu

Jul 6, 2022
kcount counts Kubernetes (K8s) objects across clusters.

kcount counts Kubernetes (K8s) objects across clusters. It gets the cluster configuration, including cluster name and namespace, from kubeconfig files

Sep 23, 2022