Bump to version 0.3.0
parent
e4a3e37642
commit
b35fd64119
|
|
@ -25,6 +25,7 @@ website/node_modules
|
|||
*.test
|
||||
*.iml
|
||||
|
||||
test/.terraform.lock.hcl
|
||||
website/vendor
|
||||
|
||||
# Test exclusions
|
||||
|
|
|
|||
20
GNUmakefile
20
GNUmakefile
|
|
@ -3,7 +3,7 @@ HOSTNAME=github.com
|
|||
NAMESPACE=nleiva
|
||||
NAME=nautobot
|
||||
BINARY=terraform-provider-${NAME}
|
||||
VERSION=0.2.4
|
||||
VERSION=0.3.0
|
||||
OS_ARCH=$(shell go env GOOS)_$(shell go env GOARCH)
|
||||
|
||||
|
||||
|
|
@ -27,8 +27,8 @@ release:
|
|||
GOOS=windows GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_windows_amd64
|
||||
|
||||
install: build
|
||||
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
|
||||
mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
|
||||
mkdir -p $(HOME)/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
|
||||
mv ${BINARY} $(HOME)/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
|
||||
|
||||
get-api:
|
||||
cd client; wget https://demo.nautobot.com/api/swagger.yaml\?api_version\=1.3 -O swagger.yaml
|
||||
|
|
@ -46,4 +46,16 @@ gpg-key:
|
|||
gpg --armor --export-secret-key $(EMAIL) -w0 | xclip -selection clipboard -i
|
||||
|
||||
testacc:
|
||||
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
|
||||
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
|
||||
|
||||
local: install
|
||||
sed -i "s-/home/nleiva-${HOME}-" test/.terraform/plugin_path
|
||||
sed -i 's-version =.*-version = "${VERSION}"-' test/main.tf
|
||||
cd test; terraform init -upgrade && \
|
||||
terraform apply -auto-approve; cd ..
|
||||
|
||||
tag: local
|
||||
git add .
|
||||
git commit -m "Bump to version ${VERSION}"
|
||||
git tag -a -m "Bump to version ${VERSION}" v${VERSION}
|
||||
git push --follow-tag
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
nautobot = {
|
||||
version = "0.3.0"
|
||||
source = "github.com/nleiva/nautobot"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "nautobot" {
|
||||
url = "https://demo.nautobot.com/api/"
|
||||
token = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
}
|
||||
|
||||
resource "nautobot_manufacturer" "new" {
|
||||
description = "Created with Terraform"
|
||||
name = "New Vendor"
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
data "nautobot_manufacturers" "all" {
|
||||
depends_on = [nautobot_manufacturer.new]
|
||||
}
|
||||
|
||||
variable "manufacturer_name" {
|
||||
type = string
|
||||
default = "New Vendor"
|
||||
}
|
||||
|
||||
# Only returns te created manufacturer
|
||||
output "data_source_example" {
|
||||
value = {
|
||||
for manufacturer in data.nautobot_manufacturers.all.manufacturers :
|
||||
manufacturer.id => manufacturer
|
||||
if manufacturer.name == var.manufacturer_name
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue