-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
216 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: GitHub Actions - System Requirements | ||
on: | ||
|
||
####---------------------------------------------------------------------------- | ||
workflow_dispatch: | ||
name: Manual Deployment | ||
description: 'Triggering Manual Deployment' | ||
inputs: | ||
logLevel: | ||
description: 'Log level' | ||
required: true | ||
default: 'warning' | ||
tags: | ||
description: 'System Requirements' | ||
####---------------------------------------------------------------------------- | ||
push: | ||
branches: [ master ] | ||
paths: | ||
- action.yaml | ||
####---------------------------------------------------------------------------- | ||
## env: | ||
## AWS_ACCESS_KEY_ID | ||
## AWS_DEFAULT_ACCOUNT | ||
## AWS_DEFAULT_PROFILE | ||
## AWS_DEFAULT_REGION | ||
## AWS_SECRET_ACCESS_KEY | ||
## DEPLOY_TERRAFORM | ||
## DESTROY_TERRAFORM | ||
## DEVOPS_ASSUMEROLE_POLICY | ||
## DEVOPS_BOUNDARIES_POLICY | ||
## DEVOPS_ACCESS_POLICY | ||
## DEVOPS_ACCESS_ROLE | ||
## DEVOPS_ACCOUNT_NAME | ||
## INSPECT_DEPLOYMENT | ||
## PRIVATE_KEYPAIR_FILE | ||
## PRIVATE_KEYPAIR_NAME | ||
## PRIVATE_KEYPAIR_SECRET | ||
## PROVISION_TERRAFORM | ||
## TARGET_WORKSPACE | ||
## UPDATE_PYTHON_LATEST | ||
## UPDATE_SYSTEM_LATEST | ||
####---------------------------------------------------------------------------- | ||
jobs: | ||
system-requirements: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
####---------------------------------------------------------------------------- | ||
## System Requirements | ||
- name: System Requirements | ||
uses: ./ | ||
id: system-requirements | ||
with: | ||
install-awscli-tool: true | ||
install-custom-tools: netcat | ||
install-default-tools: true | ||
install-terraform-cli: latest | ||
update-operating-system: true | ||
update-python-version: true | ||
continue-on-error: false | ||
####---------------------------------------------------------------------------- | ||
## Installed Packages | ||
- name: Installed Packages | ||
id: installed-packages | ||
shell: bash | ||
run: | | ||
jq --version 2>/dev/null ; | ||
aws --version ; | ||
terraform --version 2>/dev/null ; | ||
####---------------------------------------------------------------------------- |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# assumerole | ||
AWS IAM Assume Role As A Service (ARaaS) | ||
# System Requirements - DevOps Tools (DaaS) | ||
GitHub Actions - System Requirements - DevOps As A Service (DaaS) | ||
|
||
 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
theme: jekyll-theme-architect |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
name: System Requirements | ||
description: 'System Requirements (DevOps)' | ||
|
||
####---------------------------------------------------------------------------- | ||
inputs: | ||
update-operating-system: | ||
description: 'Updating the Operating System State' | ||
required: false | ||
default: false | ||
update-python-version: | ||
description: 'Updating the current Python Version' | ||
required: false | ||
default: false | ||
install-default-tools: | ||
description: 'Installing Default Toolset (DevOps)' | ||
required: false | ||
default: false | ||
install-custom-tools: | ||
description: 'Installing Custom Toolset (DevOps)' | ||
required: false | ||
default: '' | ||
install-awscli-tool: | ||
description: 'Installing AWS CLI Tool (latest)' | ||
required: false | ||
default: false | ||
install-terraform-cli: | ||
description: 'Installing HashiCorp Terraform (latest)' | ||
required: false | ||
default: false | ||
####---------------------------------------------------------------------------- | ||
## outputs: | ||
####---------------------------------------------------------------------------- | ||
runs: | ||
using: "composite" | ||
steps: | ||
####---------------------------------------------------------------------------- | ||
## System Requirements | ||
- name: System Requirements | ||
id: system-requirements | ||
shell: bash | ||
run: | | ||
####---------------------------------------------------------------------------- | ||
## Update|Upgrade Operating System (latest): | ||
if [[ "${{ inputs.update-operating-system }}" == true ]]; then | ||
echo -e "\nUpdating/Upgrading Operating System ..." ; | ||
sudo apt-get update -y 2>&1>/dev/null ; | ||
sudo apt-get install -y lsb-release ; | ||
echo -e ; | ||
lsb_release -a ; | ||
## else echo -e "Skip: Updating Operating System (latest)! " ; | ||
fi ; | ||
####---------------------------------------------------------------------------- | ||
## Update|Upgrade Python (latest): | ||
if [[ "${{ inputs.update-python-version }}" == true ]]; then | ||
echo -en "\nRe-Linking Python (latest: 3.6) ..." ; | ||
## python --version ; ## Python 2.7 | ||
cd /usr/bin ; | ||
sudo ln -fs python3.6 python ; echo -e ; | ||
python --version ; | ||
## else echo -e "Skip: Upgrading Python (latest)! " ; | ||
fi ; | ||
####---------------------------------------------------------------------------- | ||
## Installing Default Toolset: | ||
if [[ "${{ inputs.install-default-tools }}" == true ]]; then | ||
declare -a default_toolset=( | ||
jq tree | ||
) ; | ||
echo -e "\nInstalling Default Tools ..." ; | ||
for xtool in ${default_toolset[@]}; do echo -e "Package: ${xtool} ..." ; done ; | ||
## else echo -e "Skip: Installing Default Toolset! " ; | ||
fi ; | ||
####---------------------------------------------------------------------------- | ||
## Installing Custom Toolset: | ||
evaluate="${{ inputs.install-custom-tools }}" ; | ||
if [[ "${#evaluate}" -gt 0 ]]; then | ||
echo -e "\nInstalling Custom Tools ..." ; | ||
for xtool in ${{ inputs.install-custom-tools }}; do | ||
echo -e "Package: ${xtool} ..." ; | ||
done ; | ||
default_toolset+=(${{ inputs.install-custom-tools }}) ; | ||
## else echo -e "Skip: Intalling Custom Toolset! " ; | ||
fi ; | ||
####---------------------------------------------------------------------------- | ||
## Combining Toolsets: | ||
if [[ "${#default_toolset}" -gt 0 ]]; then | ||
sudo apt-get install -y ${default_toolset[*]} 2>&1>/dev/null ; | ||
fi ; | ||
####---------------------------------------------------------------------------- | ||
## Installing AWS CLI (latest): | ||
aws --version >/dev/null 2>&1 && { | ||
echo -e >&2 "\nAWS CLI is Installed ... Ok! " ; | ||
which aws ; | ||
aws --version ; | ||
} ; | ||
if [[ "${{ inputs.install-awscli-tool }}" == true ]]; then | ||
## Installing AWS CLI (latest): | ||
if [[ "${{ inputs.install-awscli-tool }}" == true ]]; then | ||
awscli_download='awscli.amazonaws.com' ; | ||
awscli_package='awscli-exe-linux-x86_64.zip' ; | ||
echo -e "\nUpgrading AWS-CLI to version 2.0.40" ; | ||
## https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html | ||
cd /tmp ; | ||
wget --quiet "https://${awscli_download}/${awscli_package}" \ | ||
--directory-prefix=/tmp/ --output-document=awscliv2.zip ; | ||
unzip awscliv2.zip 1>/dev/null ; | ||
ls -l /usr/local/bin/aws ; | ||
sudo ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update ; | ||
aws --version ; | ||
fi; | ||
## else echo -e "Skip: Installing AWS CLI (latest)! " ; | ||
fi ; | ||
####---------------------------------------------------------------------------- | ||
## Upgrading: https://www.terraform.io/upgrade-guides/0-13.html | ||
## Installing Terraform CLI (latest): | ||
terraform --version >/dev/null 2>&1 && { | ||
echo -e >&2 "\nHashiCorp Terraform is Installed ... Ok! " ; | ||
which terraform ; | ||
terraform --version ; | ||
} | ||
## Installing HashiCorp Terraform (latest): | ||
terraform_version="${{ inputs.install-terraform-cli }}" ; | ||
if [[ "${terraform_version}" != false ]]; then | ||
[[ "${terraform_version}" == latest ]] && terraform_version='0.13.1' ; | ||
## Terraform Package details: | ||
terraform_download='releases.hashicorp.com/terraform' ; | ||
terraform_platform='linux_amd64' ; | ||
terraform_package="terraform_${terraform_version}_${terraform_platform}.zip" ; | ||
terraform_source="${terraform_download}/${terraform_version}/${terraform_package}" ; | ||
echo -e "\nTerraform Source: ${terraform_source}" ; | ||
wget --quiet https://${terraform_source} -P /tmp/ ; | ||
ls -al /tmp/${terraform_package} ; | ||
unzip /tmp/${terraform_package} ; | ||
chmod 0754 ./terraform ; | ||
sudo mv ./terraform /usr/local/bin/ ; | ||
## TF_LOG=${terraform_loglevel} \ | ||
terraform --version ; | ||
## else echo -e "Skip: Upgrading Operating System! " ; | ||
fi ; | ||
####---------------------------------------------------------------------------- | ||
echo -e "\nCompleted! "; |