This repository has been archived by the owner on Jul 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
cli-buildspec.yaml
80 lines (79 loc) · 3.16 KB
/
cli-buildspec.yaml
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
version: 0.2
phases:
install:
runtime-versions:
python: 3.8
nodejs: 12
commands:
- env
- npm install -g aws-cdk@1.100.0
- cd cli
- mkdir -p conf
- cp -R ../samples/manifests/* conf
- CONF_DIR=../samples/manifests
- MANIFEST=$CONF_DIR/demo/manifest.yaml
- python3 -m venv .venv
- . .venv/bin/activate
- export CODEARTIFACT_DOMAIN=aws-codeseeder-orbit
- export CODEARTIFACT_REPOSITORY=python-repository
- MANIFEST=$CONF_DIR/plugins/dev-env-with-plugins.yaml
- ORBIT_FOUNDATION_NAME=dev-env
- aws codeartifact login --tool pip --domain ${CODEARTIFACT_DOMAIN} --repository ${CODEARTIFACT_REPOSITORY}
- cp ~/.config/pip/pip.conf .
- pip install -e ../cli
- pip install -e ../sdk
- pip install -r requirements.txt
- |
for module in `ls ../plugins`; do
pip install -e ../plugins/"${module}/"
done
build:
commands:
- pwd
- env
- . .venv/bin/activate
- orbit --help
- echo $BUILD_ACTION
- |
if [ $BUILD_ACTION = "DESTROY_FOUNDATION" ]; then
echo "Destroying Foundation"
orbit destroy foundation --debug --name "${ORBIT_FOUNDATION_NAME}"
elif [ $BUILD_ACTION = "DEPLOY_FOUNDATION" ]; then
echo "Deploying Foundation"
if [ "${VERSION}" = "latest" ]; then
echo Using code artifact: ${CODEARTIFACT_DOMAIN} ${CODEARTIFACT_REPOSITORY}
orbit deploy foundation --name "${ORBIT_FOUNDATION_NAME}" --codeartifact-domain "${CODEARTIFACT_DOMAIN}" --codeartifact-repository "${CODEARTIFACT_REPOSITORY}" "${INTERNET_ACCESSIBILITY_ARG}" --debug
else
orbit deploy foundation --name "${ORBIT_FOUNDATION_NAME}" "${INTERNET_ACCESSIBILITY_ARG}" --debug
fi
elif [ $BUILD_ACTION = "DESTROY_TEAMS" ]; then
echo "Destroying Teams"
orbit destroy teams --debug -e "${ORBIT_ENV_NAME}"
elif [ $BUILD_ACTION = "DESTROY_ENV" ]; then
echo "Destroying Env"
orbit destroy env --debug -e "${ORBIT_ENV_NAME}"
elif [ $BUILD_ACTION = "DEPLOY_ENV" ]; then
if [ "${VERSION}" = "latest" ]; then
echo "Deploying Env"
orbit deploy env --debug -f $MANIFEST --debug
else
echo "Deploying Env"
orbit deploy env --debug -f $MANIFEST
fi
elif [ $BUILD_ACTION = "DEPLOY_TEAMS" ]; then
echo "Deploying Teams"
orbit deploy teams --debug -f $MANIFEST
elif [ $BUILD_ACTION = "DEPLOY_REGRESSION" ]; then
cd ..
pwd
TOOLKIT=$(orbit list env --variable=toolkitbucket --env ${ORBIT_ENV_NAME})
aws s3 sync samples s3://$TOOLKIT/samples/
S3_BOOTSTRAP_PATH="s3://${TOOLKIT}/teams/lake-creator/bootstrap/"
aws s3 cp samples/copy_samples.sh $S3_BOOTSTRAP_PATH
S3_BOOTSTRAP_PATH="s3://${TOOLKIT}/teams/lake-user/bootstrap/"
aws s3 cp samples/copy_samples.sh $S3_BOOTSTRAP_PATH
python scripts/download_demo_data.py ${ORBIT_ENV_NAME}
else
echo "Invalid BUILD_ACTION: $BUILD_ACTION"
exit 1
fi