Giter Club home page Giter Club logo

config-compiler's Introduction

CircleCI Config Compiler

The CircleCI Config Compiler is a Go library that allows you to compile CircleCI config.yml version 2.1 files to version 2.0. It provides functionality to convert and process CircleCI configuration files, enabling you to easily migrate from the newer version to the older version of the configuration format.

Usage

To compile a config.yml file from version 2.1 to version 2.0, you can use the Compile function provided by the library. Here's an example of how to use it:

package main

import (
	"fmt"
	"io"
	"log"

	"github.com/davidmdm/config-compiler/config"
)

func main() {
	// Read the source file
	source, err := io.ReadFile("path/to/config.yml")
	if err != nil {
		log.Fatal(err)
	}

	// Create a new compiler instance
	compiler := config.Compiler{}

	// Compile the source file
	compiledConfig, err := compiler.Compile(source, nil)
	if err != nil {
		log.Fatal(err)
	}

	// Save the compiled config to a file
	err = io.WriteFile("path/to/compiled-config.yml", compiledConfig, 0644)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println("Compilation successful!")
}

In the above example, the Compile function takes the source YAML file content and an optional pipelineParams map, which can be used to provide parameter values for the CircleCI configuration. The function returns the compiled configuration in YAML format.

You can customize the usage according to your specific requirements and integrate it into your Go project as needed.

config-compiler's People

Contributors

davidmdm avatar danmux avatar

Stargazers

 avatar Kyle a.k.a. TechSquidTV avatar

Watchers

 avatar  avatar  avatar

Forkers

danmux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.