pedloy

module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2024 License: MIT

README

Pedloy: Pulumi Environment Deployer

Pedloy is a CLI tool for managing Pulumi stacks, enabling the deployment and destruction of infrastructure environments in a defined order. It supports both local and Git-based project sources, offering concurrency and dependency resolution for efficient stack management.

Features

  • Deployment and Destruction: Deploy or destroy stacks with dependencies resolved in order.
  • Preview Plans: View the order of operations before deploying or destroying.
  • Git Integration: Use Git repositories for Pulumi project sources.
  • Customizable Configuration: Define projects and dependencies in a YAML configuration file.
  • Logging: Supports JSON logging for structured output.

Installation

Clone the repository and build the binary:

git clone https://github.com/jaxxstorm/pedloy.git
cd pedloy
go build -o pedloy cmd/pedloy/main.go

Alternatively, you can use go install:

go install github.com/jaxxstorm/pedloy/cmd/pedloy@latest

Usage

Commands
  • deploy: Deploy the stacks defined in your configuration.
  • destroy: Destroy the stacks defined in your configuration.
Flags
Flag Description Default
--config Path to the configuration file projects.yml
--org The Pulumi organization
--path Path to local Pulumi projects
--git-url Git repository URL for Pulumi projects
--git-branch Git branch to use main
--preview Preview the deployment or destruction plan false
--json Enable JSON logging false
Examples
Deploying Stacks
pedloy deploy --config projects.yml --org my-org --path ./pulumi-projects
Destroying Stacks
pedloy destroy --config projects.yml --org my-org
Preview Deployment Plan
pedloy deploy --preview --config projects.yml

Configuration

The configuration is defined in a YAML file. Here’s an example projects.yml:

projects:
  - name: project-a
    stacks:
      - dev
      - prod
    dependsOn:
      - project-b
  - name: project-b
    stacks:
      - dev
      - prod
Structure
  • name: The name of the Pulumi project.
  • stacks: A list of stacks for the project.
  • dependsOn: Other projects this project depends on.

Project Structure

pedloy/
├── cmd/
│   └── pedloy/
│       ├── deploy/
│       │   └── cli.go
│       ├── destroy/
│       │   └── cli.go
│       └── main.go
├── pkg/
│   ├── auto/
│   │   └── pulumi.go
│   ├── config/
│   │   └── load.go
│   ├── graph/
│   │   └── graph.go
│   ├── project/
│   │   └── projects.go
│   └── utils/
│       ├── preview.go
│       └── validation.go
├── README.md

Development

Prerequisites
Building the Binary
go build -o pedloy cmd/pedloy/main.go

License

This project is licensed under the MIT License. See the LICENSE file for details.


Enjoy deploying your infrastructure with Pedloy!

Directories

Path Synopsis
cmd
pkg
auto
pkg/auto/pulumi.go - Functions for deploying and destroying Pulumi stacks
pkg/auto/pulumi.go - Functions for deploying and destroying Pulumi stacks
config
pkg/config/load.go - Load the configuration file and return a slice of projects
pkg/config/load.go - Load the configuration file and return a slice of projects
contract
pkg/contract/contract.go
pkg/contract/contract.go
graph
pkg/graph/graph.go
pkg/graph/graph.go
project
pkg/project/projects.go
pkg/project/projects.go
util
pkg/util/util.go
pkg/util/util.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL