Skip to content

Commit 7091e95

Browse files
authored
Merge pull request #115 from spacelift-io/bump-autoscaler-version
feat: pull in latest autoscaler by default
2 parents 334aa59 + 3957452 commit 7091e95

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

.spacelift/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: 1
2-
module_version: 2.9.0
2+
module_version: 2.9.1
33
tests:
44
- name: AMD64-based workerpool
55
project_root: examples/amd64

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ $ make docs
113113
| <a name="input_ami_id"></a> [ami\_id](#input\_ami\_id) | ID of the Spacelift AMI. If left empty, the latest Spacelift AMI will be used. | `string` | `""` | no |
114114
| <a name="input_autoscaler_architecture"></a> [autoscaler\_architecture](#input\_autoscaler\_architecture) | Instruction set architecture of the autoscaler to use | `string` | `"amd64"` | no |
115115
| <a name="input_autoscaler_s3_package"></a> [autoscaler\_s3\_package](#input\_autoscaler\_s3\_package) | Configuration to retrieve autoscaler lambda package from s3 bucket | <pre>object({<br> bucket = string<br> key = string<br> object_version = optional(string)<br> })</pre> | `null` | no |
116-
| <a name="input_autoscaler_version"></a> [autoscaler\_version](#input\_autoscaler\_version) | Version of the autoscaler to deploy | `string` | `"v0.3.0"` | no |
116+
| <a name="input_autoscaler_version"></a> [autoscaler\_version](#input\_autoscaler\_version) | Version of the autoscaler to deploy | `string` | `"latest"` | no |
117117
| <a name="input_autoscaling_max_create"></a> [autoscaling\_max\_create](#input\_autoscaling\_max\_create) | The maximum number of instances the utility is allowed to create in a single run | `number` | `1` | no |
118118
| <a name="input_autoscaling_max_terminate"></a> [autoscaling\_max\_terminate](#input\_autoscaling\_max\_terminate) | The maximum number of instances the utility is allowed to terminate in a single run | `number` | `1` | no |
119119
| <a name="input_autoscaling_timeout"></a> [autoscaling\_timeout](#input\_autoscaling\_timeout) | Timeout (in seconds) for a single autoscaling run. The more instances you have, the higher this should be. | `number` | `30` | no |

download.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,25 @@ set -ex
33

44
# Download the data.
55
code_version=$1
6-
code_architecture=$2
6+
export code_architecture=$2
77

8-
curl -L -o lambda.zip "https://github.com/spacelift-io/ec2-workerpool-autoscaler/releases/download/${code_version}/ec2-workerpool-autoscaler_linux_${code_architecture}.zip"
8+
if [ "$code_version" != "latest" ]; then
9+
code_version="tags/$code_version"
10+
fi
11+
12+
release=$(curl -sS "https://api.github.com/repos/spacelift-io/ec2-workerpool-autoscaler/releases/${code_version}" | jq -r --arg ZIP "ec2-workerpool-autoscaler_linux_$code_architecture.zip" '.assets[] | select(.name==$ZIP)')
13+
14+
release_date=$(echo $release | jq -r '.created_at')
15+
download_url=$(echo $release | jq -r '.browser_download_url')
16+
17+
echo "Downloading Details:"
18+
echo " Release Name: $code_version"
19+
echo " Release Date: $release_date"
20+
echo " Download URL: $download_url"
21+
22+
curl -L -o lambda.zip $download_url
923

1024
mkdir -p lambda
1125
cd lambda
1226
unzip -o ../lambda.zip
13-
rm ../lambda.zip
27+
rm ../lambda.zip

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ variable "enable_autoscaling" {
157157
variable "autoscaler_version" {
158158
description = "Version of the autoscaler to deploy"
159159
type = string
160-
default = "v0.3.0"
160+
default = "latest"
161161
nullable = false
162162
}
163163

0 commit comments

Comments
 (0)