GithubHelp home page GithubHelp logo

ebay / rules_ytt Goto Github PK

View Code? Open in Web Editor NEW
11.0 5.0 2.0 20 KB

Bazel rules for YAML templating tool https://carvel.dev/ytt/

License: Apache License 2.0

Starlark 94.91% Shell 5.09%
bazel bazel-rules carvel devops k8s kubernetes templating yaml yaml-processor yml

rules_ytt's Introduction

Carvel ytt rules for Bazel

Setup

Add to WORKSPACE file.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "com_github_ebay_rules_ytt",
    sha256 = "0232522fd7a07d2eb0a47fe4ec3a6dc8bc8e0bcbaa8abd658c6be53a34f5bd76",
    strip_prefix = "rules_ytt-0.1.0",
    urls = [
        "https://github.com/eBay/rules_ytt/releases/download/v0.1.0/rules_ytt-0.1.0.zip",
    ],
)

load("@com_github_ebay_rules_ytt//:deps.bzl", "ytt_rules_dependencies")

ytt_rules_dependencies()

Usage

Add to BUILD file:

load("@com_github_ebay_rules_ytt//:def.bzl", "ytt")
load("@io_bazel_rules_docker//go:image.bzl", "go_image")

go_image(
    name = "image",
    srcs = ["main.go"],
    importpath = "...",
)

ytt(
    name = "manifests",
    srcs = [
        ":base.yaml",
        ":defaults.yaml",
        ":values.yaml",
    ],
    image = ":image.digest",
)

Which is equivalent to

ytt -f base.yaml -f defaults.yaml -f values.yaml --dangerous-allow-all-symlink-destinations
  • bazel build //:manifests - generates yaml files and store it in cache.
  • bazel run //:manifests - prints generated yaml files to stdout.
  • bazel run //:manifests | kubectl -n <namespace> -f - - applies generated manifests to k8s cluster.

Image digest is available inside yaml templates as data.values.image_digest.

Commands

Here

LICENSE

Copyright 2023 eBay Inc. Developer: Evgeny Khabarov

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

See LICENSE for more details.

rules_ytt's People

Contributors

ekhabarov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rules_ytt's Issues

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.