Giter VIP home page Giter VIP logo

terraform-provider-pipeline's Introduction

Terraform Provider for Artifactory Pipelines

Documentation

To use this provider in your Terraform module, follow the documentation on Terraform Registry.

License requirements

This provider requires access to Artifactory APIs, which are only available in the licensed enterprise plus editions. You can determine which license you have by accessing the following URL ${host}/artifactory/api/system/licenses/

You can either access it via API, or web browser - it requires admin level credentials, but it's one of the few APIs that will work without a license (side node: you can also install your license here with a POST)

$ curl -sL ${host}/artifactory/api/system/licenses/ | jq .
{
  "type" : "Enterprise Plus Trial",
  "validThrough" : "Jan 29, 2022",
  "licensedTo" : "JFrog Ltd"
}

The following 3 license types (jq .type) do NOT support APIs:

  • Community Edition for C/C++
  • JCR Edition
  • OSS

Versioning

In general, this project follows Terraform Versioning Specification as closely as we can for tagging releases of the package.

Contributors

See the contribution guide.

License

Copyright (c) 2022 JFrog.

Apache 2.0 licensed, see LICENSE file.

terraform-provider-pipeline's People

Contributors

alexhung avatar chb0github avatar danielmkn avatar davidschile-automox avatar dependabot[bot] avatar mfkuntz avatar turhsus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-provider-pipeline's Issues

Consistent Makefile

Is your feature request related to a problem? Please describe.
Makefile is inconsistent with other repos and the inconsistency causes issues
jfrog/terraform-provider-xray#64

Describe the solution you'd like
The Makefile should be nearly identical to the other repos for consistency sake

panic: interface conversion: interface {} is nil, not string On Basic Setup

Describe the bug
When trying to do the terraform apply for a very basic pipeline_project_integration resource I continue to get the plugin crashing with the below information, I have validated my token I'm using can hit the license api and has all the rights it should but I'm not sure what this panic is coming from and was hoping someone could shed some light on this. I basically can't use the plugin at all atm, it always crashes with this error and I'm not sure how to find more information on it.

The basic TF snippet

terraform {
  required_providers {
    artifactory = {
      source  = "registry.terraform.io/jfrog/artifactory"
      version = "6.16.0"
    }
    pipeline = {
      source  = "registry.terraform.io/jfrog/pipeline"
      version = "1.1.0"
    }
    aws = {
      source = "hashicorp/aws"
      version = "~> 4.0"
    }
  }
}

provider "pipeline" {
  url           = "${var.artifactory_url}"
  check_license = true
  access_token  = xxx

resource "pipeline_project_integration" "test-integration" {
  name                    = "test-integration"
  project_id              = 0
  project                 = {
      name = "test-project"
  }
  master_integration_id   = 0
  master_integration_name = "test-integration"
  environments            = ["DEV"]
  is_internal             = false

  form_json_values {
    label = "IsJFrogPipe"
    value = "true"
  }
}
pipeline_project_integration.test-integration: Creating...
╷
│ Error: Request cancelled
│
│   with pipeline_project_integration.test-integration,
│   on pipelines.tf line 1, in resource "pipeline_project_integration" "test-integration":
│    1: resource "pipeline_project_integration" "test-integration" {
│
│ The plugin.(*GRPCProvider).ApplyResourceChange request was cancelled.
╵
╷
│ Error: Plugin did not respond
│
│   with pipeline_node_pool.on-demand-node-pool,
│   on pipelines.tf line 18, in resource "pipeline_node_pool" "on-demand-node-pool":
│   18: resource "pipeline_node_pool" "on-demand-node-pool" {
│
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵
Releasing state lock. This may take a few moments...

Stack trace from the terraform-provider-pipeline_v1.1.0 plugin:

panic: interface conversion: interface {} is nil, not string

goroutine 48 [running]:
github.com/jfrog/terraform-provider-pipeline/pkg/pipeline.pipelineProjectIntegrationResource.func1(0x140003086c8?, {0x101505623?, 0xb?})
	github.com/jfrog/terraform-provider-pipeline/pkg/pipeline/resource_pipeline_project_integration.go:128 +0xe8
github.com/jfrog/terraform-provider-pipeline/pkg/pipeline.pipelineProjectIntegrationResource.func3(0x14000114580)
	github.com/jfrog/terraform-provider-pipeline/pkg/pipeline/resource_pipeline_project_integration.go:155 +0x148
github.com/jfrog/terraform-provider-pipeline/pkg/pipeline.pipelineProjectIntegrationResource.func6({0x10179fb58, 0x14000300600}, 0x14000114580, {0x10178f580?, 0x140004f41e0?})
	github.com/jfrog/terraform-provider-pipeline/pkg/pipeline/resource_pipeline_project_integration.go:200 +0xe4
github.com/jfrog/terraform-provider-shared/util.applyTelemetry.func1({0x10179fb58?, 0x14000300600}, 0x0?, {0x10178f580?, 0x140004f41e0})
	github.com/jfrog/[email protected]/util/util.go:225 +0x1d4
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x140002aca80, {0x10179fb90, 0x14000080330}, 0xd?, {0x10178f580, 0x140004f41e0})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:707 +0xec
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x140002aca80, {0x10179fb90, 0x14000080330}, 0x14000241930, 0x14000114380, {0x10178f580, 0x140004f41e0})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:837 +0x874
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x140003fe5a0, {0x10179fae8?, 0x14000510580?}, 0x14000513770)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xb94
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0x140003910e0, {0x10179fb90?, 0x1400050d890?}, 0x14000153ce0)
	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:812 +0x38c
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x10176b080?, 0x140003910e0}, {0x10179fb90, 0x1400050d890}, 0x14000507ce0, 0x0)
	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x174
google.golang.org/grpc.(*Server).processUnaryRPC(0x140002908c0, {0x1017a2530, 0x14000318820}, 0x140005cfb00, 0x140004125d0, 0x101c0e740, 0x0)
	google.golang.org/[email protected]/server.go:1282 +0xb3c
google.golang.org/grpc.(*Server).handleStream(0x140002908c0, {0x1017a2530, 0x14000318820}, 0x140005cfb00, 0x0)
	google.golang.org/[email protected]/server.go:1619 +0x840
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	google.golang.org/[email protected]/server.go:921 +0x88
created by google.golang.org/grpc.(*Server).serveStreams.func1
	google.golang.org/[email protected]/server.go:919 +0x298

Error: The terraform-provider-pipeline_v1.1.0 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Artifactory Version:

{
  "version" : "7.41.4",
  "revision" : "74104900"
  }
}%

Terraform Version with Provider Versions:

Terraform v1.3.5
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v4.43.0
+ provider registry.terraform.io/hashicorp/vault v3.11.0
+ provider registry.terraform.io/jfrog/artifactory v6.16.0
+ provider registry.terraform.io/jfrog/pipeline v1.1.0

Requirements for and issue

  • A fully functioning terraform snippet that can be copy&pasted (no outside files or ENV vars unless that's part of the issue)
  • Your version of artifactory (you can curl it at $host/artifactory/api/system/version
  • Your version of terraform

Expected behavior
I would expect it to not crash and apply the code, this doesn't happen on the plan stage it works on plan stage and shows its going to create the resource correctly, but then when applying it gets to this part and crashes.

I would like to submit a PR to this new repo.

I've been working on a pipelines provider for a few days and I have a few resources. I've done my best to mimic the patterns provided in the artifactory and project terraform provider projects.
I attempted to submit a PR here, but I am unauthorized to push a new branch. Since the repo is empty I also cannot fork.

Let me know if theres anything I can do to help with this.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.