forked from mieslep/cass-stac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_devcontainer.sh
31 lines (25 loc) · 1.39 KB
/
setup_devcontainer.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
29
30
31
#!/bin/bash
# Prompt for necessary environment variables
read -p "Enter SERVER_PORT: " SERVER_PORT
read -p "Enter ASTRA_DB_USERNAME: " ASTRA_DB_USERNAME
read -p "Enter ASTRA_DB_KEYSPACE: " ASTRA_DB_KEYSPACE
read -p "Enter ASTRA_DB_ID: " ASTRA_DB_ID
read -p "Enter DATASTAX_ASTRA_PASSWORD: " DATASTAX_ASTRA_PASSWORD
read -p "Enter DATASTAX_ASTRA_SCB_NAME: " DATASTAX_ASTRA_SCB_NAME
# Export the environment variables for the current shell session
export SERVER_PORT=$SERVER_PORT
export ASTRA_DB_USERNAME=$ASTRA_DB_USERNAME
export ASTRA_DB_KEYSPACE=$ASTRA_DB_KEYSPACE
export ASTRA_DB_ID=$ASTRA_DB_ID
export DATASTAX_ASTRA_PASSWORD=$DATASTAX_ASTRA_PASSWORD
export DATASTAX_ASTRA_SCB_NAME=$DATASTAX_ASTRA_SCB_NAME
# Save the environment variables to a .env file
echo "SERVER_PORT=$SERVER_PORT" > .env
echo "ASTRA_DB_USERNAME=$ASTRA_DB_USERNAME" >> .env
echo "ASTRA_DB_KEYSPACE=$ASTRA_DB_KEYSPACE" >> .env
echo "ASTRA_DB_ID=$ASTRA_DB_ID" >> .env
echo "DATASTAX_ASTRA_PASSWORD=$DATASTAX_ASTRA_PASSWORD" >> .env
echo "DATASTAX_ASTRA_SCB_NAME=$DATASTAX_ASTRA_SCB_NAME" >> .env
. .env
./dockersetup.sh
mvn package -DskipTests=true && mvn spring-boot:run -Dspring-boot.run.arguments="--server.port=${SERVER_PORT} --datastax.astra.username=${ASTRA_DB_USERNAME} --datastax.astra.password=${DATASTAX_ASTRA_PASSWORD} --datastax.astra.keyspace=${ASTRA_DB_KEYSPACE} --datastax.astra.secure-connect-bundle=${DATASTAX_ASTRA_SCB_NAME}"