The pkgbuild state is the front of Salt package building backend. It automatically
2015.8.0 新版功能.
salt_2015.5.2:
pkgbuild.built:
- runas: thatch
- results:
- salt-2015.5.2-2.el7.centos.noarch.rpm
- salt-api-2015.5.2-2.el7.centos.noarch.rpm
- salt-cloud-2015.5.2-2.el7.centos.noarch.rpm
- salt-master-2015.5.2-2.el7.centos.noarch.rpm
- salt-minion-2015.5.2-2.el7.centos.noarch.rpm
- salt-ssh-2015.5.2-2.el7.centos.noarch.rpm
- salt-syndic-2015.5.2-2.el7.centos.noarch.rpm
- dest_dir: /tmp/pkg
- spec: salt://pkg/salt/spec/salt.spec
- template: jinja
- deps:
- salt://pkg/salt/sources/required_dependency.rpm
- tgt: epel-7-x86_64
- sources:
- salt://pkg/salt/sources/logrotate.salt
- salt://pkg/salt/sources/README.fedora
- salt://pkg/salt/sources/salt-2015.5.2.tar.gz
- salt://pkg/salt/sources/salt-2015.5.2-tests.patch
- salt://pkg/salt/sources/salt-api
- salt://pkg/salt/sources/salt-api.service
- salt://pkg/salt/sources/salt-master
- salt://pkg/salt/sources/salt-master.service
- salt://pkg/salt/sources/salt-minion
- salt://pkg/salt/sources/salt-minion.service
- salt://pkg/salt/sources/saltpkg.sls
- salt://pkg/salt/sources/salt-syndic
- salt://pkg/salt/sources/salt-syndic.service
- salt://pkg/salt/sources/SaltTesting-2015.5.8.tar.gz
/tmp/pkg:
pkgbuild.repo
salt.states.pkgbuild.
built
(name, runas, dest_dir, spec, sources, tgt, template=None, deps=None, env=None, results=None, force=False, always=None, saltenv='base', log_dir='/var/log/salt/pkgbuild')¶Ensure that the named package is built and exists in the named directory
Run the spec file through a templating engine
在 2015.8.2 版更改: This argument is now optional, allowing for no templating engine to be used if none is desired.
A dictionary of environment variables to be set prior to execution. Example:
- env:
DEB_BUILD_OPTIONS: 'nocheck'
警告
The above illustrates a common PyYAML pitfall, that yes,
no, on, off, true, and false are all loaded as
boolean True
and False
values, and must be enclosed in
quotes to be used as strings. More info on this (and other) PyYAML
idiosyncrasies can be found here.
If True
, packages will be built even if they already exist in the
dest_dir
. This is useful when building a package for continuous or
nightly package builds.
2015.8.2 新版功能.
If True
, packages will be built even if they already exist in the
dest_dir
. This is useful when building a package for continuous or
nightly package builds.
2015.8.2 版后已移除: Use force
instead.
Root directory for log files created from the build. Logs will be organized by package name, version, OS release, and CPU architecture under this directory.
2015.8.2 新版功能.
salt.states.pkgbuild.
repo
(name, keyid=None, env=None)¶Make a package repository, the name is directoty to turn into a repo. This state is best used with onchanges linked to your package building states
A dictionary of environment variables to be utlilized in creating the repository. Example:
- env:
OPTIONS: 'ask-passphrase'
警告
The above illustrates a common PyYAML pitfall, that yes,
no, on, off, true, and false are all loaded as
boolean True
and False
values, and must be enclosed in
quotes to be used as strings. More info on this (and other) PyYAML
idiosyncrasies can be found here.
Use of OPTIONS on some platforms, for example: ask-passphrase, will require gpg-agent or similar to cache passphrases.