Bump to version 0.3.0

main
nleiva 2023-03-27 11:45:02 -04:00
parent e4a3e37642
commit b35fd64119
4 changed files with 52 additions and 4 deletions

1
.gitignore vendored
View File

@ -25,6 +25,7 @@ website/node_modules
*.test *.test
*.iml *.iml
test/.terraform.lock.hcl
website/vendor website/vendor
# Test exclusions # Test exclusions

View File

@ -3,7 +3,7 @@ HOSTNAME=github.com
NAMESPACE=nleiva NAMESPACE=nleiva
NAME=nautobot NAME=nautobot
BINARY=terraform-provider-${NAME} BINARY=terraform-provider-${NAME}
VERSION=0.2.4 VERSION=0.3.0
OS_ARCH=$(shell go env GOOS)_$(shell go env GOARCH) 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 GOOS=windows GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_windows_amd64
install: build install: build
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH} mkdir -p $(HOME)/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH} mv ${BINARY} $(HOME)/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
get-api: get-api:
cd client; wget https://demo.nautobot.com/api/swagger.yaml\?api_version\=1.3 -O swagger.yaml 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 gpg --armor --export-secret-key $(EMAIL) -w0 | xclip -selection clipboard -i
testacc: 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

18
test/main.tf Normal file
View File

@ -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"
}

17
test/output.tf Normal file
View File

@ -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
}
}