container-image-from-frecklet-file

Description

This is a convenience wrapper around the container-image-from-frecklet frecklet, it sets a few command-line options so that the wrapped frecklet can use a frecklet file instead of a frecklet that needs to be in the default context.

Variables

Name Type Default Description

frecklet_path

string --

The (absolute!) path to the frecklet file. Required

freckles_extra_args

string --

Extra base args for the freckles run.

frecklet_vars

dict --

The frecklet vars.

image_name

string --

The image name.

image_type

string docker

The container image type.

install_packer

boolean False

Install Packer into '$HOME/.local/bin', if not already available.

source_image

string --

The name of the source/parent image.

Code

doc:
  short_help: Use Hashicorp Packer to create a container image from a frecklet file.
  help: |
    This is a convenience wrapper around the [``container-image-from-frecklet``](https://freckles.io/frecklets/default/virtualization/container-image-from-frecklet) *frecklet*, it sets a few command-line options so that the wrapped *frecklet* can use a frecklet *file* instead of a *frecklet* that needs to be in the default context.

args:
  _import: container-image-from-frecklet
  frecklet_path:
    doc:
      short_help: The (absolute!) path to the frecklet file.
    type: string
    required: true

frecklets:
- container-image-from-frecklet:
    frecklet_name: '{{:: frecklet_path | frecklet_name ::}}'
    image_name: '{{:: image_name ::}}'
    freckles_extra_args: '{{:: freckles_extra_args ::}} -r {{:: frecklet_path | dirname
      ::}}'
    frecklet_vars: '{{:: frecklet_vars ::}}'
    image_type: '{{:: image_type ::}}'
    install_packer: '{{:: install_packer ::}}'
    source_image: '{{:: source_image ::}}'
frecklecute container-image-from-frecklet-file --help

Usage: frecklecute container-image-from-frecklet-file [OPTIONS]

  This is a convenience wrapper around the [``container-image-from-frecklet`
  `](https://freckles.io/frecklets/default/virtualization/container-image-
  from-frecklet) *frecklet*, it sets a few command-line options so that the
  wrapped *frecklet* can use a frecklet *file* instead of a *frecklet* that
  needs to be in the default context.

Options:
  --frecklet-path FRECKLET_PATH   The (absolute!) path to the frecklet file.
                                  [required]
  --freckles-extra-args FRECKLES_EXTRA_ARGS
                                  Extra base args for the freckles run.
  --frecklet-vars FRECKLET_VARS   The frecklet vars.
  --image-name IMAGE_NAME         The image name.
  --image-type IMAGE_TYPE         The container image type.
  --install-packer                Install Packer into '$HOME/.local/bin', if
                                  not already available.
  --source-image SOURCE_IMAGE     The name of the source/parent image.
  --help                          Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.container_image_from_frecklet_file.ContainerImageFromFreckletFile
#


from dataclasses import dataclass
from pyckles import AutoPycklet
from typing import *    # noqa

@dataclass
class ContainerImageFromFreckletFile(AutoPycklet):
    """This is a convenience wrapper around the [``container-image-from-frecklet``](https://freckles.io/frecklets/default/virtualization/container-image-from-frecklet) *frecklet*, it sets a few command-line options so that the wrapped *frecklet* can use a frecklet *file* instead of a *frecklet* that needs to be in the default context.

       Args:
         freckles_extra_args: Extra base args for the freckles run.
         frecklet_path: The (absolute!) path to the frecklet file.
         frecklet_vars: The frecklet vars.
         image_name: The image name.
         image_type: The container image type.
         install_packer: Install Packer into '$HOME/.local/bin', if not already available.
         source_image: The name of the source/parent image.

    """

    FRECKLET_ID = "container-image-from-frecklet-file"

    freckles_extra_args: str = None
    frecklet_path: str = None
    frecklet_vars: Dict = None
    image_name: str = None
    image_type: str = None
    install_packer: bool = None
    source_image: str = None


    def __post_init__(self):
        super(ContainerImageFromFreckletFile, self).__init__(var_names=["freckles_extra_args", "frecklet_path", "frecklet_vars", "image_name", "image_type", "install_packer", "source_image"])


frecklet_class = ContainerImageFromFreckletFile
# -*- coding: utf-8 -*-


#
# module path: pycklets.container_image_from_frecklet_file.ContainerImageFromFreckletFile
#


from pyckles import AutoPycklet

class ContainerImageFromFreckletFile(AutoPycklet):
    """This is a convenience wrapper around the [``container-image-from-frecklet``](https://freckles.io/frecklets/default/virtualization/container-image-from-frecklet) *frecklet*, it sets a few command-line options so that the wrapped *frecklet* can use a frecklet *file* instead of a *frecklet* that needs to be in the default context.

       Args:
         freckles_extra_args: Extra base args for the freckles run.
         frecklet_path: The (absolute!) path to the frecklet file.
         frecklet_vars: The frecklet vars.
         image_name: The image name.
         image_type: The container image type.
         install_packer: Install Packer into '$HOME/.local/bin', if not already available.
         source_image: The name of the source/parent image.

    """

    FRECKLET_ID = "container-image-from-frecklet-file"

    def __init__(self, freckles_extra_args=None, frecklet_path=None, frecklet_vars=None, image_name=None, image_type="docker", install_packer=None, source_image=None):

        super(ContainerImageFromFreckletFile, self).__init__(var_names=["freckles_extra_args", "frecklet_path", "frecklet_vars", "image_name", "image_type", "install_packer", "source_image"])
        self._freckles_extra_args = freckles_extra_args
        self._frecklet_path = frecklet_path
        self._frecklet_vars = frecklet_vars
        self._image_name = image_name
        self._image_type = image_type
        self._install_packer = install_packer
        self._source_image = source_image

    @property
    def freckles_extra_args(self):
        return self._freckles_extra_args

    @freckles_extra_args.setter
    def freckles_extra_args(self, freckles_extra_args):
        self._freckles_extra_args = freckles_extra_args

    @property
    def frecklet_path(self):
        return self._frecklet_path

    @frecklet_path.setter
    def frecklet_path(self, frecklet_path):
        self._frecklet_path = frecklet_path

    @property
    def frecklet_vars(self):
        return self._frecklet_vars

    @frecklet_vars.setter
    def frecklet_vars(self, frecklet_vars):
        self._frecklet_vars = frecklet_vars

    @property
    def image_name(self):
        return self._image_name

    @image_name.setter
    def image_name(self, image_name):
        self._image_name = image_name

    @property
    def image_type(self):
        return self._image_type

    @image_type.setter
    def image_type(self, image_type):
        self._image_type = image_type

    @property
    def install_packer(self):
        return self._install_packer

    @install_packer.setter
    def install_packer(self, install_packer):
        self._install_packer = install_packer

    @property
    def source_image(self):
        return self._source_image

    @source_image.setter
    def source_image(self, source_image):
        self._source_image = source_image



frecklet_class = ContainerImageFromFreckletFile