14 Commits

Author SHA1 Message Date
unkin-agent c69c3d9f74 resource_remote: add mirror_strategy attribute
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
The provider exposed mirrorlist but not mirror_strategy, so the API's
mirror load-balancing strategy (round_robin/least_conn) was unreachable
via Terraform. Add mirror_strategy the same way mirrorlist was added,
scoped to rpm/deb/alpine remotes.

- schema: optional string mirror_strategy on the remote resource
- ValidateConfig: reject on non-rpm/deb/alpine types and validate the
  round_robin/least_conn enum at plan time
- wire model + modelToAPI/apiToModel (empty->null to avoid perpetual diff)
- datasource (computed) + README + rpm example
- unit tests: modelToAPI/apiToModel round-trip and ValidateConfig matrix
2026-08-13 17:50:52 +10:00
unkin-agent 9ed7f07463 resource_remote: add mirrorlist attribute (rpm/deb/apk remotes)
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline failed
Expose the artifactapi remotes API's new mirrorlist field so users can
configure extra upstream mirror base URLs. The API load-balances
base_url + mirrorlist with failover.

- Add optional mirrorlist list attribute to the remote resource schema
  and the remote data source (read-only).
- Wire it end-to-end: TF model, wire model (json mirrorlist,omitempty),
  modelToAPI/apiToModel, and preserve null/empty list semantics to avoid
  plan churn.
- Scope to rpm/deb/alpine via ValidateConfig (plan-time error on other
  remote types); API 400 is the backstop.
- Docs + rpm example; unit tests for round-trip, null handling, and the
  type-scoping validation.
2026-08-13 16:16:49 +10:00
unkin-agent 719b0dd502 Add artifactapi_remote_github_alpine resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Adds the metadata-only Alpine/apk analog of the github_deb/github_rpm
remotes: exposes a GitHub repo's release .apk assets as an apk repository
(synthesized APKINDEX) without precaching, redirecting downloads to a
backing releases_remote.

- register newRemoteResource("github_alpine") in provider Resources()
- add NewRemoteGitHubAlpine convenience ctor
- extend provider/metadata/ctor table tests + bump resource count to 22
- document github_alpine remote type in README
- add examples/resources/artifactapi_remote_github_alpine/main.tf
2026-08-12 20:42:10 +10:00
unkin-agent cb1110c723 Add artifactapi_local_alpine resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Adds a local Alpine/apk repository resource mirroring the existing
artifactapi_local_deb and artifactapi_local_rpm locals, so Alpine
package registries can be managed directly via Terraform.

- add localAlpineResource (PackageType alpine, RepoType local) with
  CRUD + import passthrough and model<->API mappers
- register NewLocalAlpineResource in provider Resources()
- bump provider_test resource count to 21 and expected type list
- add local unit tests and README/example entries
2026-08-12 00:52:33 +10:00
unkin-agent 25b72fd1ac Add artifactapi_remote_github_deb resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Add the metadata-only Debian/apt analog of artifactapi_remote_github_rpm,
exposing a GitHub repo's release .deb assets as a synthesized apt repository
with downloads redirected to a backing releases_remote.

- Register newRemoteResource("github_deb") and add NewRemoteGitHubDeb ctor
- Bump provider resource count 19 -> 20 and add the type name to test lists
- Add modelToAPI/metadata/constructor test coverage for github_deb
- Document github_deb in README and add an examples/ main.tf (goodtune/ghp)
2026-08-11 23:43:31 +10:00
unkin-agent b21892217a Add artifactapi_local_deb and artifactapi_remote_deb resources
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
2026-08-11 21:50:20 +10:00
unkinben b26e651d45 feat: add artifactapi_remote_github_rpm resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
The artifactapi server gains a github_rpm remote type that exposes a GitHub
repo's releases as a metadata-only yum repository (synthesized repodata, no
precache, downloads redirected to a backend remote). Surface it through the
provider so these remotes are declarable as code alongside the other types.

- Register the github_rpm remote resource (artifactapi_remote_github_rpm),
  reusing the shared remoteResource plumbing; add the NewRemoteGitHubRPM
  constructor to match its siblings.
- Generalize the releases_remote attribute description: it now names the
  backend remote that serves download bytes for both the terraform remote
  (URL rewriting) and the github_rpm remote (302 redirect of .rpm downloads).
- Document the type and add an example wiring a github_rpm remote to a generic
  github.com releases_remote.

Tests cover the resource metadata type name, the constructor, and mapping of
package_type/base_url/releases_remote/patterns through the API model; the
resource-count and expected-types assertions are updated.

Depends on the github_rpm API surface in artifactapi (separate PR). Cut a
minor release (make minor) once merged.
2026-08-10 20:57:26 +10:00
unkinben 14b7c4bdcd Add artifactapi_local_generic resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Adds a local generic (raw-file) repository resource so arbitrary binaries -- the
bootapi node rootfs tarballs -- can be hosted on artifactapi and managed in
Terraform. The backend already serves generic locals; only the provider surface
was missing.

- resource_local_generic.go: local repo with package_type=generic (mirrors
  local_rpm), registered in the provider.
- Tests + example.

Claude-Session: https://claude.ai/code/session_015ur3i7D2azsMAWTSVABApv
2026-07-29 21:48:47 +10:00
unkinben 30b414141a feat: add artifactapi_local_docker resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
The artifactapi server now serves local docker repos as real container
registries, but the provider had no resource to declare one — only remote
docker proxies and local terraform/pypi/rpm repos.

- Add the artifactapi_local_docker resource (package_type=docker,
  repo_type=local), mirroring the other local resources: name + description,
  managed via /api/v2/remotes.
- Register it in the provider and update the resource-count/type tests.
- Add unit tests, an example, and a Local Resources section to the README.
2026-07-04 22:37:10 +10:00
unkinben 1bddc48e5a feat: add artifactapi_local_pypi and artifactapi_local_rpm resource types
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
2026-06-23 23:16:17 +10:00
unkinben 2653c34f94 feat: add artifactapi_local_terraform resource type
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
New resource for creating local terraform registries in ArtifactAPI
(repo_type=local, package_type=terraform). These repos host providers
directly rather than proxying an upstream registry.

Schema is minimal: just name and description — no upstream-specific
fields like base_url, caching TTLs, or auth.
2026-06-22 23:30:21 +10:00
unkinben 7c94f06be6 docs: add README, per-resource examples, unit tests, CI, and pre-commit
- Add README.md with provider docs, resource/data-source reference, and
  development instructions
- Reorganize examples into per-resource-type subdirectories following
  Terraform provider conventions, add missing pypi/npm/puppet examples
- Add unit tests for helpers, HTTP client, model conversions, and
  provider registration
- Add Woodpecker CI pipelines for lint, test, and build
- Add pre-commit config with standard and Go-specific hooks
2026-06-07 18:55:48 +10:00
unkinben 1405675e8f docs: update example to use per-type resources 2026-06-07 16:42:31 +10:00
unkinben ad50a06b33 feat: initial terraform provider for artifactapi v0.0.1
Resources:
- artifactapi_remote: CRUD for remote proxy repositories
- artifactapi_virtual: CRUD for virtual (merged) repositories

Data sources:
- data.artifactapi_remote: read remote config
- data.artifactapi_virtual: read virtual config

Supports all 10 package types (generic, docker, helm, pypi, npm,
rpm, alpine, puppet, terraform, goproxy), allowlist/blocklist,
tag banning, quarantine, and terraform import.
2026-06-07 14:30:20 +10:00