Skip to content

Commit

Permalink
Updated solution
Browse files Browse the repository at this point in the history
  • Loading branch information
schijioke-uche committed Mar 26, 2021
1 parent 19481ea commit 3e8ed4c
Show file tree
Hide file tree
Showing 32 changed files with 568 additions and 28 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Local .terraform directories
**/.terraform/*


# .tfstate files
*.tfstate
*.tfstate.*
Expand Down
7 changes: 4 additions & 3 deletions AksTerraform/terradeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sed -i 's/\r//' terradeploy.sh
#Knowledgebase Number: [098126-2021]
#Strategy for updating Docker image when required.

# /\ M I C R O S O F T (C)
# /\ (C) J E F F R E Y C H I J I O K E - U C HE
# / \ _____ _ _ ___ _
# / /\ \ |_ / | | | \'__/ _\
# / ____ \ / /| |_| | | | __/
Expand All @@ -26,14 +26,15 @@ sed -i 's/\r//' terradeploy.sh
#===================================================================================

function sa(){
#Service Account: [DO NOT USE SERVICE PRINCIPAL - SUPPLY YOUR CREDENTIALS{}]
#Service Account: [DO NOT USE SERVICE-PRINCIPAL CREDENTIALS{}] [USE USER-PRINCIPAL CREDENTIALS{}]
SA_USR="{}"
SA_PWD="{}"
SA_TN="{}"
}

function authenticate(){
#Authenticate
az login -u $SA_USR --p $SA_PWD
az login -u $SA_USR --p $SA_PWD --tenant $SA_TN
cProcesswait
}

Expand Down
13 changes: 7 additions & 6 deletions AksTerraform/terradestroy.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#!/bin/bash

#Set the script for EOL
#Set the script for EOL:If you change the script name - update nextLine below
sed -i 's/\r//' terradestroy.sh

#Author: Jeffrey Solomon Chijioke-Uche (MSIT, MSIS) - United States
Expand All @@ -11,7 +11,7 @@ sed -i 's/\r//' terradestroy.sh
#Knowledgebase Number: [098126-2021]
#Strategy for updating Docker image when required.

# /\ M I C R O S O F T (C)
# /\ (C) J E F F R E Y C H I J I O K E - U C HE
# / \ _____ _ _ ___ _
# / /\ \ |_ / | | | \'__/ _\
# / ____ \ / /| |_| | | | __/
Expand All @@ -26,14 +26,15 @@ sed -i 's/\r//' terradestroy.sh
#===================================================================================

function sa(){
#Service Account: [DO NOT USE SERVICE PRINCIPAL]
SA_USR="{SUPPLY}"
SA_PWD="{SUPPLY}"
#Service Account: [DO NOT USE SERVICE-PRINCIPAL CREDENTIALS{}] [USE USER-PRINCIPAL CREDENTIALS{}]
SA_USR="{}"
SA_PWD="{}"
SA_TN="{}"
}

function authenticate(){
#Authenticate
az login -u $SA_USR --p $SA_PWD
az login -u $SA_USR --p $SA_PWD --tenant $SA_TN
cProcesswait
}

Expand Down
11 changes: 6 additions & 5 deletions Apps/appdeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sed -i 's/\r//' appdeploy.sh
#Usage: Strategy for deploying kubernetes pods via script required.
#License: MIT License

# /\ M I C R O S O F T (C)
# /\ (C) J E F F R E Y C H I J I O K E - U C H E
# / \ _____ _ _ ___ _
# / /\ \ |_ / | | | \'__/ _\
# / ____ \ / /| |_| | | | __/
Expand All @@ -27,14 +27,15 @@ sed -i 's/\r//' appdeploy.sh
#=============================================================================

function sa(){
#Service Account: [DO NOT USE SERVICE PRINCIPAL]
SA_USR="{SUPPLY}"
SA_PWD="{SUPPLY}"
#Service Account: [DO NOT USE SERVICE-PRINCIPAL CREDENTIALS{}] [USE USER-PRINCIPAL CREDENTIALS{}]
SA_USR="{}"
SA_PWD="{}"
SA_TN="{}"
}

function authenticate(){
#Authenticate
az login -u $SA_USR --p $SA_PWD
az login -u $SA_USR --p $SA_PWD --tenant $SA_TN
cProcesswait
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions Dockerfiles/donetapps/aspnetapp/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
**/bin/
**/obj/
**/out/
/isSecureVault/

# files
Dockerfile*
**/*.md
**/*.txt
30 changes: 30 additions & 0 deletions Dockerfiles/donetapps/aspnetapp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Local .terraform directories
**/.terraform/*
/isSecureVault/

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log

# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
# .tfvars files are managed as part of configuration and so should be included in
# version control.
#
# example.tfvars

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Include override files you do wish to add to version control using negated pattern
#
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
112 changes: 112 additions & 0 deletions Dockerfiles/donetapps/aspnetapp/dockerbuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@

#!/usr/bin/env bash

#Author: Jeffrey Solomon Chijioke-Uche (MSIT, MSIS) - United States
#Softwareid: MZ-68922876-0004
#Usage: Terraform Auto Deployment to Azure
#Model: AzureRM 1.36.0 = 2.0+
#Knowledgebase Number: [098126-2021]
#Strategy for updating Docker image when required for [Docker Hub] Repositories

# /\ (C) J E F F R E Y C H I J I O K E - U C H E
# / \ _____ _ _ ___ _
# / /\ \ |_ / | | | \'__/ _\
# / ____ \ / /| |_| | | | __/
# /_/ \_\/___|\__,_|_| \___| T E R R A F O R M S O F T W A R E (R)


#System Pre-requisites:
#-Terraform plugin.
#-Azure CLI plugin.
#-Bash (Bourne shell) plugin.
#-Az aks plugin.
#=================================================================================

#============================
#Essential SignIn Information
#============================
function isInfo(){
DOCKER_USER=""
DOCKER_PW='{}' #[development only]
DOCKER_SECUREPWDVAULTPATH='{}' #[Production] [path must be a secure destination]
DOCKER_TAG="{}"
DOCKER_DEST="." #[DO NOT MODIFY]
DOCKER_FOLDER="{}"
DOCKER_DOMAIN="{}"
}

#==============================
#Automated login stream option1: [activated] [Development]
#==============================
function isLogin(){
#[DEVELOPMENT]
#echo $DOCKER_PW | docker login -u $DOCKER_USER --password-stdin $DOCKER_DOMAIN
#[PRODUCTION]
cat $DOCKER_SECUREPWDVAULTPATH | docker login -u $DOCKER_USER --password-stdin $DOCKER_DOMAIN
}

#============================
#Build, Tag & Push Image
#============================
function isBuildTagPush(){
docker build -t $DOCKER_DOMAIN/$DOCKER_USER/$DOCKER_FOLDER:$DOCKER_TAG $DOCKER_DEST
cProcesswait
docker tag $DOCKER_DOMAIN/$DOCKER_USER/$DOCKER_FOLDER:$DOCKER_TAG $DOCKER_DOMAIN/$DOCKER_USER/$DOCKER_FOLDER:$DOCKER_TAG
cProcesswait
docker images
cProcesswait
docker push $DOCKER_DOMAIN/$DOCKER_USER/$DOCKER_FOLDER:$DOCKER_TAG
cProcesswait
isdocker
}

#Process Wait:
function cProcesswait(){
sleep 5s & PID=$!
echo -e "Please wait..."
printf "["
while kill -0 $PID 2> /dev/null; do
printf ""
sleep 2
done
printf "] ${GREEN}done!${NOCOLOR}"
echo -e ""
}
#Process indicators:
function Indicators(){
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
LIGHTGRAY='\033[0;37m'
DARKGRAY='\033[1;30m'
LIGHTRED='\033[1;31m'
LIGHTGREEN='\033[1;32m'
YELLOW='\033[1;33m'
LIGHTBLUE='\033[1;34m'
LIGHTPURPLE='\033[1;35m'
LIGHTCYAN='\033[1;36m'
WHITE='\033[1;37m'
}
#END: ID-Z9773-2019
function isdocker(){
echo -e "${GREEN}Docker Image Push Completed!${NOCOLOR}"
echo -e "${GREEN}
/---\ D O C K E R I M A G E R E P O S I T O R Y
/ _ \ __________ _________ ____
/ /_\ \\___ / | \_ __ \_/ __ \
/ | \/ /| | /| | \/\ ___/
\____|__ /_____ \____/ |__| \___ >
\/ \/ \/
I N F R A S T R U C T U R E AS C O D E T E C H N O L O G Y ${NOCOLOR}"
}

#Exec::::::::::::::::::::::#
Indicators
isInfo
isLogin
isBuildTagPush
#Exec::::::::::::::::::::::#
2 changes: 2 additions & 0 deletions Dockerfiles/donetapps/complexapp/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
**/bin/
**/obj/
**/out/
/isSecureVault/

# files
Dockerfile*
**/*.md
**/*.txt
30 changes: 30 additions & 0 deletions Dockerfiles/donetapps/complexapp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Local .terraform directories
**/.terraform/*
/isSecureVault/

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log

# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
# .tfvars files are managed as part of configuration and so should be included in
# version control.
#
# example.tfvars

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Include override files you do wish to add to version control using negated pattern
#
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
Loading

0 comments on commit 3e8ed4c

Please sign in to comment.