Skip to content

Commit 11409da

Browse files
authored
feat: Add version via input; build stac server lambdas via null resource (#4)
* Add version via input; build stac server lambdas via null resource * small tweaks to local_setup * Clarify input vars * changelog * precommit cleanup
1 parent 24fe89f commit 11409da

File tree

9 files changed

+45
-6
lines changed

9 files changed

+45
-6
lines changed

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ This change was validated by the following observations:
1818
- [ ] Changelog
1919
- [ ] I have added my changes to CHANGELOG.md
2020
- [ ] No changelog entry is necessary
21-
- [ ] stac-server Version
22-
- [ ] I have noted a version bump in the stac-server lambdas in CHANGELOG.md, and updated the `STAC_SERVER_TAG` throughout `/.github/workflows`
21+
- [ ] stac-server Default, Built-In Version
22+
- [ ] I have noted a version bump in the stac-server lambdas in CHANGELOG.md, updated the `STAC_SERVER_TAG` throughout `/.github/workflows`, and `inputs.stac_server_version` default value
2323
- [ ] No stac-server version bump was performed

.github/workflows-WIP/release-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
env:
2626
CI: true
27+
# Ensure this matches inputs.stac_server_version default value
2728
STAC_SERVER_TAG: v3.10.0
2829
steps:
2930
- uses: actions/checkout@v5

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
env:
1616
CI: true
17+
# Ensure this matches inputs.stac_server_version default value
1718
STAC_SERVER_TAG: v3.10.0
1819
steps:
1920
- uses: actions/checkout@v5

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ stac-server.tgz
2828
terraform-visual-report
2929
terraform.tgz
3030
historical-ingest/lambda/package/*
31+
user_init_lambda_zip.zip
32+
waiting_for_opensearch_lambda_zip.zip

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## Unreleased
99

10+
- Support inputs.stac_server_version usage
11+
1012
### Added
1113

1214
### Changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- tfenv
66
- pre-commit
7-
- nvm (if updating the built-in stac-server version)
7+
- nvm (if updating the default, built-in stac-server version)
88

99
**General Updates**
1010

@@ -16,10 +16,10 @@
1616

1717
4. Fill out the PR template
1818

19-
**Updating the Built-In stac-server Version**
19+
**Updating the Default, Built-In stac-server Version**
2020

2121
We prepackage a specific stac-server version with each release of this repository. To change this prepackaged version:
2222

2323
1. Build stac-server and get its lambdas: `./scripts/update-lambdas.bash v3.10.0`
2424

25-
2. Follow the steps in the PR template to note this version change
25+
2. Follow the steps in the PR template to note and propagate the change to appropriate files

inputs.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
variable "stac_server_version" {
2+
description = <<-DESCRIPTION
3+
stac-server version. Leave this null to use the default, prepackaged version of stac-server.
4+
5+
If you need to use a custom version, set this variable to the desired version string *and* set
6+
deploy_local_stac_server_artifacts = true. Note though that custom versions of stac-server are not
7+
guaranteed to be compatible with this module.
8+
DESCRIPTION
9+
10+
type = string
11+
default = "v3.10.0"
12+
}
13+
14+
variable "deploy_local_stac_server_artifacts" {
15+
description = "Deploy STAC Server artifacts for local deploy"
16+
type = bool
17+
default = false
18+
nullable = false
19+
}
20+
121
variable "stac_id" {
222
description = "STAC identifier"
323
type = string

providers.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ terraform {
1919
source = "hashicorp/archive"
2020
version = "~> 2.4"
2121
}
22-
2322
}
2423
}

stac_server_local_setup.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Sets up artifacts for a local stac server deploy
2+
resource "null_resource" "stac_server_local_artifact_setup" {
3+
count = var.deploy_local_stac_server_artifacts == true && var.stac_server_version != null ? 1 : 0
4+
5+
triggers = {
6+
stac_server_version = var.stac_server_version
7+
}
8+
9+
provisioner "local-exec" {
10+
interpreter = ["bash", "-ec"]
11+
working_dir = path.module
12+
command = "./scripts/update-lambdas.bash ${var.stac_server_version}"
13+
}
14+
}

0 commit comments

Comments
 (0)