Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin Framework Migration #666

Merged
merged 26 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
042152e
chore: added mux server for sxs framework migration (#664)
benPearce1 Jul 9, 2024
e9d7280
chore: migrate data source for space and spaces (#667)
benPearce1 Jul 10, 2024
df31fdd
Migrate lifecycle data source (#668)
HuyPhanNguyen Jul 11, 2024
b7e1d1c
chore: migrate project group resource and datasource to framework (#660)
benPearce1 Jul 12, 2024
7841310
Isaac/plugin framework testing (#665)
IsaacCalligeros95 Jul 12, 2024
1e408d1
feat: migrate environment data source to tf framework (#678)
hnrkndrssn Jul 16, 2024
bedca0f
Merge branch 'main' into plugin-framework-development
benPearce1 Jul 16, 2024
30c6a55
updated from main integrationtest.go
benPearce1 Jul 16, 2024
8e7d645
chore: migrate space resource to framework (#672)
benPearce1 Jul 17, 2024
95314ba
chore!: Migrate maven feed resource from sdk to plugin framework
IsaacCalligeros95 Jul 17, 2024
874b249
chore!: migrate environment resource to tf framework (#681)
hnrkndrssn Jul 17, 2024
871b550
Migrate lifecycle resource (#669)
HuyPhanNguyen Jul 17, 2024
41a0901
chore!: Migrate helm feed resource to tf framework (#674)
IsaacCalligeros95 Jul 17, 2024
b6082eb
chore!: Migrate Artifactory Generic Feeds (#675)
IsaacCalligeros95 Jul 19, 2024
3e1347e
chore: fixed assertion in migration test (#684)
benPearce1 Jul 19, 2024
ef41914
Migrate git credential datasource and resource - WIP (#683)
HuyPhanNguyen Jul 19, 2024
fef1d7f
Migrate github repository feed (#677)
IsaacCalligeros95 Jul 19, 2024
e0d45c7
Aws Elastic Container Registry migration (#679)
IsaacCalligeros95 Jul 19, 2024
a578b59
Migrate Nuget Feed (#680)
IsaacCalligeros95 Jul 19, 2024
3ab7c67
chore!: Migrate feeds datasource (#682)
IsaacCalligeros95 Jul 19, 2024
e4f0093
Add environment variable for setting tag on MSSQL containers (#691)
IsaacCalligeros95 Jul 25, 2024
a861ac5
chore!: align config in both providers (#694)
benPearce1 Jul 29, 2024
29311f0
Merge branch 'main' into plugin-framework-development
benPearce1 Jul 29, 2024
1ad0917
Tenant project variable resource (#685)
HuyPhanNguyen Jul 30, 2024
76499f1
Chore!: Migrate Library Variable Set (#686)
IsaacCalligeros95 Jul 30, 2024
3c83c2c
chore!: migrated project tenant mapping resource (#700)
benPearce1 Jul 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '1.21'
go-version: '1.22'
- run: go build ./...
14 changes: 8 additions & 6 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
# tests require starting Octopus, MSSQL, and then running Terraform against the Octopus instance.
# See # Refer to https://github.com/hashicorp-forge/go-test-split-action for more information on how the tests are split.

name: Integration Tests
name: Tests
'on':
workflow_dispatch: {}
push: {}
pull_request:

jobs:
tests:
name: Test
Expand Down Expand Up @@ -60,7 +59,7 @@ jobs:
name: junit-test-summary
if_no_artifact_found: warn
branch: main
- name: Split integration tests
- name: Split tests
id: test_split
uses: hashicorp-forge/go-test-split-action@v1
with:
Expand All @@ -82,10 +81,10 @@ jobs:
direct {}
}
EOT
- name: Test integration tests
- name: Test
run: |
GOBIN=$PWD/bin go install gotest.tools/gotestsum@latest
./bin/gotestsum --junitfile node-summary.xml --format short-verbose -- -run "${{ steps.test_split.outputs.run }}" -timeout 0 integration_test.go
./bin/gotestsum --junitfile node-summary.xml --format standard-verbose -- -run "${{ steps.test_split.outputs.run }}" -timeout 0 ./... -createSharedContainer=true
shell: bash
env:
LICENSE: ${{ secrets.OCTOPUS_SERVER_BASE64_LICENSE }}
Expand All @@ -97,14 +96,17 @@ jobs:
GOMAXPROCS: 1
OCTOTESTVERSION: latest
OCTOTESTIMAGEURL: docker.packages.octopushq.com/octopusdeploy/octopusdeploy
OCTOTESTRETRYCOUNT: 1
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: junit-test-summary-${{ matrix.index }}
path: node-summary.xml
retention-days: 1

tests-combine-summaries:
if: always()
name: Combine Test Reports
needs: [ tests ]
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '1.21'
go-version: '1.22'
- uses: crazy-max/ghaction-import-gpg@v5
id: import_gpg
with:
Expand Down
19 changes: 19 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Set variables
$VERSION = "0.7.104"
$BINARY = "terraform-provider-octopusdeploy.exe"
$HOSTNAME = "octopus.com"
$NAMESPACE = "com"
$NAME = "octopusdeploy"
$OS_ARCH = "windows_amd64"

# Build the provider
go build -o $BINARY

# Create the plugin directory if it doesn't exist
$pluginDir = "$env:APPDATA\terraform.d\plugins\$HOSTNAME\$NAMESPACE\$NAME\$VERSION\$OS_ARCH"
New-Item -ItemType Directory -Force -Path $pluginDir

# Move the binary to the plugin directory
Move-Item -Force $BINARY $pluginDir

Write-Host "Provider installed successfully to $pluginDir"
24 changes: 12 additions & 12 deletions docs/data-sources/library_variable_sets.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "octopusdeploy_library_variable_sets Data Source - terraform-provider-octopusdeploy"
subcategory: ""
description: |-
Provides information about existing library variable sets.

---

# octopusdeploy_library_variable_sets (Data Source)

Provides information about existing library variable sets.




Expand All @@ -18,34 +18,34 @@ Provides information about existing library variable sets.
### Optional

- `content_type` (String) A filter to search by content type.
- `id` (String) The unique ID for this resource.
- `ids` (List of String) A filter to search by a list of IDs.
- `partial_name` (String) A filter to search by the partial match of a name.
- `library_variable_sets` (Block List) A list of library variable sets that match the filter(s). (see [below for nested schema](#nestedblock--library_variable_sets))
- `partial_name` (String) A filter to search by a partial name.
- `skip` (Number) A filter to specify the number of items to skip in the response.
- `space_id` (String) A Space ID to filter by. Will revert what is specified on the provider if not set.
- `space_id` (String) The space ID associated with this library variable set.
- `take` (Number) A filter to specify the number of items to take (or return) in the response.

### Read-Only

- `id` (String) An auto-generated identifier that includes the timestamp when this data source was last modified.
- `library_variable_sets` (Block List) A list of library variable sets that match the filter(s). (see [below for nested schema](#nestedblock--library_variable_sets))

<a id="nestedblock--library_variable_sets"></a>
### Nested Schema for `library_variable_sets`

Read-Only:
Optional:

- `description` (String) The description of this library variable set.
- `id` (String) The unique ID for this resource.
- `name` (String) The name of this resource.
- `space_id` (String) The space ID associated with this resource.
- `space_id` (String) The space ID associated with this library variable set.
- `template` (List of Object) (see [below for nested schema](#nestedatt--library_variable_sets--template))

Read-Only:

- `template_ids` (Map of String)
- `variable_set_id` (String)

<a id="nestedatt--library_variable_sets--template"></a>
### Nested Schema for `library_variable_sets.template`

Read-Only:
Optional:

- `default_value` (String)
- `display_settings` (Map of String)
Expand Down
10 changes: 5 additions & 5 deletions docs/resources/library_variable_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "octopusdeploy_library_variable_set Resource - terraform-provider-octopusdeploy"
subcategory: ""
description: |-
This resource manages library variable sets in Octopus Deploy.

---

# octopusdeploy_library_variable_set (Resource)

This resource manages library variable sets in Octopus Deploy.




Expand All @@ -23,20 +23,20 @@ This resource manages library variable sets in Octopus Deploy.

- `description` (String) The description of this library variable set.
- `id` (String) The unique ID for this resource.
- `space_id` (String) The space ID associated with this resource.
- `space_id` (String) The space ID associated with this library variable set.
- `template` (Block List) (see [below for nested schema](#nestedblock--template))
- `template_ids` (Map of String)

### Read-Only

- `template_ids` (Map of String)
- `variable_set_id` (String)

<a id="nestedblock--template"></a>
### Nested Schema for `template`

Required:

- `name` (String) The name of the variable set by the parameter. The name can contain letters, digits, dashes and periods. Example: `ServerName`.
- `name` (String) The name of the variable set by the parameter. The name can contain letters, digits, dashes and periods. Example: `ServerName`

Optional:

Expand Down
6 changes: 3 additions & 3 deletions docs/resources/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ resource "octopusdeploy_lifecycle" "example" {
name = "Test Lifecycle (OK to Delete)"

release_retention_policy {
quantity_to_keep = 1
should_keep_forever = true
quantity_to_keep = 0
should_keep_forever = true // true only if quantity_to_keep = 0
unit = "Days"
}

Expand All @@ -33,7 +33,7 @@ resource "octopusdeploy_lifecycle" "example" {
name = "foo"

release_retention_policy {
quantity_to_keep = 1
quantity_to_keep = 0
should_keep_forever = true
unit = "Days"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/resources/octopusdeploy_lifecycle/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ resource "octopusdeploy_lifecycle" "example" {
name = "Test Lifecycle (OK to Delete)"

release_retention_policy {
quantity_to_keep = 1
should_keep_forever = true
quantity_to_keep = 0
should_keep_forever = true // true only if quantity_to_keep = 0
unit = "Days"
}

Expand Down
64 changes: 22 additions & 42 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,44 @@ require (
github.com/OctopusDeploy/go-octopusdeploy/v2 v2.43.0
github.com/OctopusSolutionsEngineering/OctopusTerraformTestFramework v0.0.0-20240725054341-2848f54d101e
github.com/google/uuid v1.6.0
github.com/gruntwork-io/terratest v0.41.11
github.com/hashicorp/go-cty v1.4.1-0.20200723130312-85980079f637
github.com/hashicorp/terraform-plugin-docs v0.13.0
github.com/hashicorp/terraform-plugin-framework v1.9.0
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
github.com/hashicorp/terraform-plugin-go v0.23.0
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-mux v0.16.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0
github.com/hashicorp/terraform-plugin-testing v1.8.0
github.com/stretchr/testify v1.9.0
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea
golang.org/x/text v0.15.0
github.com/testcontainers/testcontainers-go v0.32.0
golang.org/x/exp v0.0.0-20240707233637-46b078467d37
golang.org/x/text v0.16.0
k8s.io/utils v0.0.0-20230505201702-9f6742963106
software.sslmate.com/src/go-pkcs12 v0.4.0
)

require (
cloud.google.com/go v0.112.0 // indirect
cloud.google.com/go/compute v1.24.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/storage v1.36.0 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/hcsshim v0.11.5 // indirect
github.com/Microsoft/hcsshim v0.12.4 // indirect
github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/avast/retry-go/v4 v4.5.1 // indirect
github.com/aws/aws-sdk-go v1.44.164 // indirect
github.com/avast/retry-go/v4 v4.6.0 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/containerd/containerd v1.7.18 // indirect
github.com/containerd/errdefs v0.1.0 // indirect
github.com/containerd/containerd v1.7.19 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dghubble/sling v1.4.1 // indirect
Expand All @@ -61,48 +59,38 @@ require (
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.11.2 // indirect
github.com/go-test/deep v1.0.7 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.6.2 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.6.0 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hc-install v0.6.4 // indirect
github.com/hashicorp/hcl/v2 v2.20.1 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.21.0 // indirect
github.com/hashicorp/terraform-json v0.22.1 // indirect
github.com/hashicorp/terraform-plugin-go v0.23.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/jinzhu/copier v0.3.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/leodido/go-urn v1.2.2 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-zglob v0.0.4 // indirect
github.com/mitchellh/cli v1.1.5 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
Expand All @@ -127,35 +115,27 @@ require (
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/testcontainers/testcontainers-go v0.32.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/tmccombs/hcl2json v0.3.6 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
github.com/zclconf/go-cty v1.14.4 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/sdk v1.21.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/mod v0.19.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.13.0 // indirect
google.golang.org/api v0.162.0 // indirect
golang.org/x/tools v0.23.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/grpc v1.63.2 // indirect
google.golang.org/protobuf v1.34.0 // indirect
Expand Down
Loading
Loading