Merge pull request #44 from HideyoshiNakazone/better-documentation
Better Documentation and Run Options
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,6 +7,7 @@
|
||||
.vscode/
|
||||
|
||||
**/*.json
|
||||
!**/*.example.json
|
||||
|
||||
**/cert-manager-certificate.yaml
|
||||
|
||||
|
||||
28
README.md
28
README.md
@@ -1 +1,27 @@
|
||||
# infra-kubernetes
|
||||
# infra-hideyoshi.com
|
||||
|
||||
## How to Configure
|
||||
|
||||
- Requirements:
|
||||
|
||||
This project requires a working kubernetes cluster, in case of a testing environment a minikube cluster will by configured for you, otherwise a kubernetes will not be configured.
|
||||
|
||||
- Configuring Secrets:
|
||||
|
||||
```
|
||||
python -m pip install --upgrade pip pipenv
|
||||
pipenv install
|
||||
pipenv run python setup.py -e {{environment-option}} -f config.json
|
||||
```
|
||||
|
||||
- Running Kubernetes Application:
|
||||
|
||||
```
|
||||
sudo apt update && sudo apt install -y jq python3-pip
|
||||
cd infra-hideyoshi.com
|
||||
./deploy.sh {{environmet-flag}}
|
||||
```
|
||||
|
||||
`{{environment-flag}}` : `--local`, `--staging`, `--prod`
|
||||
|
||||
`{{environment-option}` : `local`, `staging`, `prod`
|
||||
|
||||
@@ -67,7 +67,7 @@ function application_deploy() {
|
||||
|
||||
function main() {
|
||||
|
||||
if [[ $1 == "--test" || $1 == "-t" ]]; then
|
||||
if [[ $1 == "--local" || $1 == "-l" ]]; then
|
||||
|
||||
function kubectl {
|
||||
minikube kubectl -- $@
|
||||
|
||||
39
env.example.json
Normal file
39
env.example.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"backendSecret": {
|
||||
"tokenSecret": "",
|
||||
"accessTokenDuration": "",
|
||||
"refreshTokenDuration": "",
|
||||
"defaultUserFullName": "",
|
||||
"defaultUserEmail": "",
|
||||
"defaultUserUsername": "",
|
||||
"defaultUserPassword": "",
|
||||
"googleClientId": "",
|
||||
"googleClientSecret": "",
|
||||
"googleRedirectUrl": "",
|
||||
"githubClientId": "",
|
||||
"githubClientSecret": "",
|
||||
"githubRedirectUrl": ""
|
||||
},
|
||||
"frontendSecret": {
|
||||
"frontendPath": "",
|
||||
"backendUrl": "",
|
||||
"backendOAuthUrl": ""
|
||||
},
|
||||
"postgresSecret": {
|
||||
"postgresDatabase": "",
|
||||
"postgresUser": "",
|
||||
"postgresPassword": ""
|
||||
},
|
||||
"redisSecret": {
|
||||
"redisPassword": ""
|
||||
},
|
||||
"storageSecret": {
|
||||
"storageType": "",
|
||||
"awsAccessKeyId": "",
|
||||
"awsSecretAccessKey": "",
|
||||
"awsRegion": "",
|
||||
"awsBucket": "",
|
||||
"virusCheckerType": "",
|
||||
"virusCheckerApiKey": ""
|
||||
}
|
||||
}
|
||||
2
setup.py
2
setup.py
@@ -14,7 +14,7 @@ def write_template(template: str, output: str):
|
||||
output.write(envsubst(template.read()))
|
||||
|
||||
def configure_templates(environment: str):
|
||||
if not environment in ("prod", "staging", "local", "dev"):
|
||||
if not environment in ("prod", "staging", "local"):
|
||||
raise ValueError("Invalid Environment Selected")
|
||||
|
||||
match environment:
|
||||
|
||||
Reference in New Issue
Block a user