Adrien Delorme ed091163be
HCL2 Parse packer.required_plugins block + packer init (#10304)
This adds the new `required_plugins` block to be nested under the packer block.

Example:
```hcl
packer {
  required_plugins {
    aws = {
      version = ">= 2.7.0"
      source = "azr/aws"
    }
    azure = ">= 2.7.0"
  }
}
```

For example on darwin_amd64 Packer will install those under :
* "${PACKER_HOME_DIR}/plugin/github.com/azr/amazon/packer-plugin-amazon_2.7.0_x5.0_darwin_amd64"
* "${PACKER_HOME_DIR}/plugin/github.com/hashicorp/azure/packer-plugin-azure_2.7.0_x5.0_darwin_amd64_x5"

+ docs
+ tests
2021-02-02 18:05:04 +01:00

63 lines
1.7 KiB
YAML

language: go
os: linux
dist: bionic
sudo: require
cache:
directories:
- $HOME/.ccache
go:
- "1.15"
env:
global:
- CCACHE_TEMPDIR=/tmp/.ccache-temp
matrix:
- LIBVIRT=2.3.0 EXT=xz
- LIBVIRT=3.1.0 EXT=xz
- LIBVIRT=5.1.0 EXT=xz
before_install:
- go get golang.org/x/lint/golint
- go get golang.org/x/tools/cmd/goyacc
install:
# credit here goes to the go-libvirt authors,
# see: https://github.com/rgbkrk/libvirt-go/blob/master/.travis.yml
- sudo apt-get -qqy build-dep libvirt
- sudo apt-get -qqy install curl qemu-system-x86
- sudo mkdir -p /usr/src && sudo chown $(id -u) /usr/src
- curl -O -s https://libvirt.org/sources/libvirt-${LIBVIRT}.tar.${EXT}
- tar -C /usr/src -xf libvirt-${LIBVIRT}.tar.${EXT}
- pushd /usr/src/libvirt-${LIBVIRT}
- ccache --show-stats
- |
env PATH=/usr/lib/ccache:$PATH \
./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc \
--without-polkit \
--without-esx --without-vbox --without-xen --without-libxl --without-lxc \
--with-qemu
- make
- sudo make install
- ccache --show-stats
- popd
- sudo libvirtd -d -l -f libvirtd.conf
- sudo virtlogd -d || true
before_script:
- go get -d ./...
- sudo qemu-img create -f raw -o size=10M /var/lib/libvirt/images/test.raw
- sudo virsh define .travis/test-domain.xml
- sudo virsh start test
- sudo virsh pool-create .travis/test-pool.xml
- sudo virsh secret-define .travis/test-secret.xml
script:
- ./scripts/licensecheck.sh
- LIBVIRT_SOURCE=/usr/src/libvirt-${LIBVIRT} go generate ./...
- go build ./...
- golint -set_exit_status ./...
- go vet ./...
- go test -v -tags=integration ./...