Last active
April 20, 2018 21:49
-
-
Save ryanpadilha/9aad9c99a446934a729d1394691c3edd to your computer and use it in GitHub Desktop.
Create a structure environment into an EC2 instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Create the structure of folders for EC2 environment | |
# | |
echo "Initializing script for EC2 environment instance" | |
G_COMPANY="company" | |
create_directory() { | |
DATA_DIR=$1 | |
if [ ! -d "$DATA_DIR" ]; then | |
mkdir -p "$DATA_DIR" | |
echo "directory created: $DATA_DIR" | |
fi | |
} | |
# configuration files | |
create_directory "/var/$G_COMPANY/conf" | |
# tools for devops | |
create_directory "/var/$G_COMPANY/devops" | |
# specific application directories | |
create_directory "/var/$G_COMPANY/logs" | |
# specific web-application directories | |
create_directory "/var/$G_COMPANY/www" | |
# specific database-data directory | |
create_directory "/var/$G_COMPANY/data" | |
# specific run-pid | |
create_directory "/var/$G_COMPANY/run" | |
# specific swagger-documentation directory | |
create_directory "/var/$G_COMPANY/swagger" | |
echo "Structure created for instance" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment