Пример #1
0
@hook("install")
def exec_install_hooks():
    log("Invoking pre-install hooks under hooks/install.d")
    execd_preinstall("hooks/install.d")


def install_dependencies():
    packages = Packages()
    packages.install_dependencies()


# Dynamically create an OR-ed chain of @when_not, so install_dependencies
# will get triggered whenever one or more dependencies are unmet (typically
# at install time).
for event in DEPENDENCIES_EVENTS:
    install_dependencies = when_not(event)(install_dependencies)


# When all dependencies have been installed, we install the jenkins package
# from the desired source.
@when_not("apt.installed.jenkins")
@when(*DEPENDENCIES_EVENTS)
def install_jenkins():
    status_set("maintenance", "Installing Jenkins")
    packages = Packages()
    packages.install_jenkins()


# Called once the jenkins package has been installed, but we didn't
# perform any configuration yet. We'll not touch config.xml ever again,
# since from this point it should be managed by the user (or by some
Пример #2
0
#     case they merge the code from the new layered charm.
@hook("install")
def exec_install_hooks():
    log("Invoking pre-install hooks under hooks/install.d")
    execd_preinstall("hooks/install.d")


def install_dependencies():
    packages = Packages()
    packages.install_dependencies()

# Dynamically create an OR-ed chain of @when_not, so install_dependencies
# will get triggered whenever one or more dependencies are unmet (typically
# at install time).
for event in DEPENDENCIES_EVENTS:
    install_dependencies = when_not(event)(install_dependencies)


# When all dependencies have been installed, we install the jenkins package
# from the desired source.
@when_not("apt.installed.jenkins")
@when(*DEPENDENCIES_EVENTS)
def install_jenkins():
    status_set("maintenance", "Installing Jenkins")
    packages = Packages()
    packages.install_jenkins()


# Called once the jenkins package has been installed, but we didn't
# perform any configuration yet. We'll not touch config.xml ever again,
# since from this point it should be managed by the user (or by some