forked from Orange-OpenSource/AWSTerraformStarterKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-starter-kit.sh
executable file
·28 lines (22 loc) · 941 Bytes
/
get-starter-kit.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
#
# // Software Name : AWSTerraformStarterKit
# // SPDX-FileCopyrightText: Copyright (c) 2023 Orange Business
# // SPDX-License-Identifier: BSD-3-Clause
# //
# // This software is distributed under the BSD License;
# // see the LICENSE file for more details.
# //
# // Author: AWS Practice Team <[email protected]>
#
set -o errexit -o nounset -o pipefail
# Set Starterkit version
STARTER_KIT_VERSION="${1:-latest}"
STARTER_KIT_PROJECT="${2:-Orange-OpenSource/AWSTerraformStarterKit}"
STARTER_KIT_FORMAT="tar"
STARTER_KIT_URL="https://api.github.com/repos/${STARTER_KIT_PROJECT}"
STARTER_KIT_LOCATION="${STARTER_KIT_URL}/${STARTER_KIT_FORMAT}ball/${STARTER_KIT_VERSION}"
if [ "$STARTER_KIT_VERSION" == "latest" ]; then
STARTER_KIT_LOCATION=$(curl -s ${STARTER_KIT_URL}/releases/latest | jq -r ".${STARTER_KIT_FORMAT}ball_url")
fi
curl --fail -L "${STARTER_KIT_LOCATION}" | tar -xz --strip-components 1