This repository was archived by the owner on May 15, 2025. It is now read-only.
File tree 5 files changed +25
-5
lines changed
5 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 10
10
"devDependencies" : {
11
11
"bun-types" : " ^1.0.18" ,
12
12
"gray-matter" : " ^4.0.3" ,
13
- "marked" : " ^11.1 .0" ,
13
+ "marked" : " ^12.0 .0" ,
14
14
"prettier-plugin-sh" : " ^0.13.1" ,
15
15
"prettier-plugin-terraform-formatter" : " ^1.2.1"
16
16
},
Original file line number Diff line number Diff line change 1
1
import { describe } from "bun:test" ;
2
2
import { runTerraformInit , testRequiredVariables } from "../test" ;
3
3
4
- describe ( "vault-token " , async ( ) => {
4
+ describe ( "vault-github " , async ( ) => {
5
5
await runTerraformInit ( import . meta. dir ) ;
6
6
7
7
testRequiredVariables ( import . meta. dir , {
Original file line number Diff line number Diff line change @@ -32,9 +32,19 @@ unzip_safe() {
32
32
}
33
33
34
34
install () {
35
+ # Get the architecture of the system
36
+ ARCH=$( uname -m)
37
+ if [ " $$ {ARCH}" = " x86_64" ]; then
38
+ ARCH=" amd64"
39
+ elif [ " $$ {ARCH}" = " aarch64" ]; then
40
+ ARCH=" arm64"
41
+ else
42
+ printf " Unsupported architecture: $$ {ARCH}\n"
43
+ return 1
44
+ fi
35
45
# Fetch the latest version of Vault if INSTALL_VERSION is 'latest'
36
46
if [ " $$ {INSTALL_VERSION}" = " latest" ]; then
37
- LATEST_VERSION=$( curl -s https://releases.hashicorp.com/vault/ | grep -v ' - rc' | grep -oP ' vault/\K [0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1)
47
+ LATEST_VERSION=$( curl -s https://releases.hashicorp.com/vault/ | grep -v ' rc' | grep -oE ' vault/[0-9]+\.[0-9]+\.[0-9]+' | sed ' s/vault\/// ' | sort -V | tail -n 1)
38
48
printf " Latest version of Vault is %s.\n\n" " $$ {LATEST_VERSION}"
39
49
if [ -z " $$ {LATEST_VERSION}" ]; then
40
50
printf " Failed to determine the latest Vault version.\n"
@@ -60,7 +70,7 @@ install() {
60
70
else
61
71
printf " Upgrading Vault CLI from version %s to %s ...\n\n" " $$ {CURRENT_VERSION}" " ${INSTALL_VERSION} "
62
72
fi
63
- fetch vault.zip " https://releases.hashicorp.com/vault/$$ {INSTALL_VERSION}/vault_$$ {INSTALL_VERSION}_linux_amd64 .zip"
73
+ fetch vault.zip " https://releases.hashicorp.com/vault/$$ {INSTALL_VERSION}/vault_$$ {INSTALL_VERSION}_linux_ $$ {ARCH} .zip"
64
74
if [ $? -ne 0 ]; then
65
75
printf " Failed to download Vault.\n"
66
76
return 1
Original file line number Diff line number Diff line change @@ -30,9 +30,19 @@ unzip_safe() {
30
30
}
31
31
32
32
install () {
33
+ # Get the architecture of the system
34
+ ARCH=$( uname -m)
35
+ if [ " $$ {ARCH}" = " x86_64" ]; then
36
+ ARCH=" amd64"
37
+ elif [ " $$ {ARCH}" = " aarch64" ]; then
38
+ ARCH=" arm64"
39
+ else
40
+ printf " Unsupported architecture: $$ {ARCH}\n"
41
+ return 1
42
+ fi
33
43
# Fetch the latest version of Vault if INSTALL_VERSION is 'latest'
34
44
if [ " $$ {INSTALL_VERSION}" = " latest" ]; then
35
- LATEST_VERSION=$( curl -s https://releases.hashicorp.com/vault/ | grep -v ' - rc' | grep -oP ' vault/\K [0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1)
45
+ LATEST_VERSION=$( curl -s https://releases.hashicorp.com/vault/ | grep -v ' rc' | grep -oE ' vault/[0-9]+\.[0-9]+\.[0-9]+' | sed ' s/vault\/// ' | sort -V | tail -n 1)
36
46
printf " Latest version of Vault is %s.\n\n" " $$ {LATEST_VERSION}"
37
47
if [ -z " $$ {LATEST_VERSION}" ]; then
38
48
printf " Failed to determine the latest Vault version.\n"
You can’t perform that action at this time.
0 commit comments