Skip to content

Commit

Permalink
root: added Angular frontend framework technology
Browse files Browse the repository at this point in the history
Since we want Angular frontend framework to be supported from the
get-go replacing the old Hugo technology we had been using for a
while, we should proceed to add it in. Hence, let's do this.

This patch adds Angular frontend framework technology into root
repository.

Co-authored-by: Galyna, Cory <[email protected]>
Co-authored-by: (Holloway) Chew, Kean Ho <[email protected]>
Signed-off-by: (Holloway) Chew, Kean Ho <[email protected]>
  • Loading branch information
hollowaykeanho and corygalyna committed Oct 26, 2023
1 parent 839e61c commit 64f9c9c
Show file tree
Hide file tree
Showing 106 changed files with 14,158 additions and 47 deletions.
24 changes: 23 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ output/
.bin/

#####################
# Native CI
# AutomataCI
#####################
/SECRETS.toml
/bin
Expand All @@ -30,6 +30,20 @@ output/
/releases
/resources/changelog/*/.*

#####################
# Angular
#####################
/out-tsc
/bazel-out
cache/
coverage/
dist/
.sass-cache/
connect.lock
libpeerconnection.log
testem.log
typings

#####################
# LibreOffice
#####################
Expand Down Expand Up @@ -83,6 +97,13 @@ certbot.log
*.hex
*.bin

#####################
# Node
#####################
node_modules
npm-debug.log
yarn-error.log

#####################
# Databases
#####################
Expand Down Expand Up @@ -110,6 +131,7 @@ gh-pages/
# MacOS specifics
#####################
.DS_Store
Thumbs.db

#####################
# AWS CLI credential blobs
Expand Down
49 changes: 48 additions & 1 deletion CONFIG.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,23 @@ PROJECT_SOURCE_URL = "https://github.com/ChewKeanHo/AutomataCI"



######################
# ANGULAR TECHNOLOGY #
######################
# PROJECT_ANGULAR
# This is a control variable used for enabling Angular technology and also
# defining its source codes directory relative to PROJECT_PATH_ROOT. Depending
# on the offered service (e.g. GitHub Actions), setting this variable with value
# shall notify the CI provider to setup Go development environment
# automatically.
#
# To enable it: simply supply the path (e.g. default is 'srcANGULAR').
# To disable it: simply supply an empty path (e.g. default is '').
PROJECT_ANGULAR = 'srcANGULAR'




######################
# NIM TECHNOLOGY #
######################
Expand Down Expand Up @@ -142,7 +159,7 @@ PROJECT_C = ''
#
# To enable it: simply supply the path (e.g. default is 'srcGO').
# To disable it: simply supply an empty path (e.g. default is '').
PROJECT_GO = 'srcGO'
PROJECT_GO = ''


# PROJECT_PATH_GO_ENGINE
Expand Down Expand Up @@ -456,6 +473,36 @@ PROJECT_CHOCOLATEY_DIRECTORY="chocolatey"
PROJECT_CHOCOLATEY_SOURCE_URL="https://github.com/ChewKeanHo/AutomataCI/releases/download"


# PROJECT_DOCS_REPO
# The git repository for publishing all the docs web artifacts. This URL shall
# be git cloned into the PROJECT_PATH_RELEASE directory.
PROJECT_DOCS_REPO="[email protected]:ChewKeanHo/AutomataCI.git"


# PROJECT_DOCS_REPO_KEY
# The git upstream key. Default is 'origin'.
PROJECT_DOCS_REPO_KEY="origin"


# PROJECT_DOCS_REPO_BRANCH
# The git upstream branch. Default is 'gh-pages'.
PROJECT_DOCS_REPO_BRANCH="gh-pages"


# PROJECT_DOCS_REPO_DIRECTORY
# The directory name housing the docs repo. Value CANNOT be empty.
# Default is 'docs'.
PROJECT_DOCS_REPO_DIRECTORY="docs"


# PROJECT_DOCS_SOURCE_URL
# The base URL for viewing the published documentation (e.g. website address).
# It is made available in-case of publication needs.
#
# NOTE: Please avoid ending with the URL slash.
PROJECT_DOCS_SOURCE_URL="https://github.io/ChewKeanHo/AutomataCI"




######################
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Some good business reasons why using AutomataCI:
1. **Start off with a tested and solid foundation** - All the templates and
CI jobs are tested and have default configured for immediate software
development.
2. **Avoid being threatend by your malicious suppliers** - CI it's a
nerve system for your product; handle it in-house and natively rather than
leaving it vulnerable for any 3rd-party to extort you.
2. **Avoid being threatend by malicious suppliers** - CI it's a nerve system for
your product; handle it in-house and natively rather than leaving it nakedly
vulnerable for any kind 3rd-party extortions.
3. **Steadily improvable** - AutomataCI itself are designed to be adaptive to
market changes, self-improvable, and cater to common use cases.
4. **Simple and scalable** - Only uses `POSIX` shell and `PowerShell` so it
Expand All @@ -42,7 +42,8 @@ Some good business reasons why using AutomataCI:
8. [Clang](https://clang.llvm.org/)
9. [MinGW](https://www.mingw-w64.org/)
10. [Emscripten WASM](https://emscripten.org/)
* Typescript (*Coming Soon*)
* Javascript & Typescript
1. [Angular](https://angular.io/)
* [Python Programming Language](https://www.python.org/)
* Some Manual MISC stuffs

Expand Down
18 changes: 18 additions & 0 deletions automataCI/_package-sourcing_unix-any.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,21 @@ if [ ! -z "$PROJECT_NIM" ]; then
fi
fi
fi




# source from Angular and overrides existing
if [ ! -z "$PROJECT_ANGULAR" ]; then
__recipe="${PROJECT_PATH_ROOT}/${PROJECT_ANGULAR}/${PROJECT_PATH_CI}"
__recipe="${__recipe}/package_unix-any.sh"
FS::is_file "$__recipe"
if [ $? -eq 0 ]; then
OS::print_status info "sourcing Angular content assembling functions: ${__recipe}\n"
. "$__recipe"
if [ $? -ne 0 ]; then
OS::print_status error "Sourcing failed\n"
return 1
fi
fi
fi
18 changes: 18 additions & 0 deletions automataCI/_package-sourcing_windows-any.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,21 @@ if (-not [string]::IsNullOrEmpty(${env:PROJECT_NIM})) {
}
}
}




# source from Angular and overrides existing
if (-not [string]::IsNullOrEmpty(${env:PROJECT_ANGULAR})) {
$__recipe = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_ANGULAR}\${env:PROJECT_PATH_CI}"
$__recipe = "${__recipe}\package_windows-any.ps1"
$__process = FS-Is-File "${__recipe}"
if ($__process -eq 0) {
OS-Print-Status info "sourcing Angular content assembling functions: ${__recipe}"
$__process = . "${__recipe}"
if ($__process -ne 0) {
OS-Print-Status error "Source failed."
return
}
}
}
92 changes: 92 additions & 0 deletions automataCI/_release-docsrepo_unix-any.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/bin/sh
# Copyright 2023 (Holloway) Chew, Kean Ho <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at:
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/services/io/os.sh"
. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/services/io/fs.sh"
. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/services/versioners/git.sh"
. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/services/compilers/installer.sh"




RELEASE::docs_repo() {
# validate input
OS::print_status info "publishing artifacts to docs repo...\n"
if [ ! -d "${PROJECT_PATH_ROOT}/${PROJECT_PATH_DOCS}" ]; then
OS::print_status warning "release skipped - No docs directory.\n"
return 0
fi


# clean up base directory
OS::print_status info "safety checking docs repo directory...\n"
if [ -f "${PROJECT_PATH_ROOT}/${PROJECT_PATH_RELEASE}/${PROJECT_DOCS_REPO_DIRECTORY}" ]; then
OS::print_status error "check failed.\n"
return 1
fi
FS::make_directory "${PROJECT_PATH_ROOT}/${PROJECT_PATH_RELEASE}"


# execute
OS::print_status info "setting up release docs repo...\n"
INSTALLER::setup_resettable_repo \
"$PROJECT_PATH_ROOT" \
"$PROJECT_PATH_RELEASE" \
"$PWD" \
"$PROJECT_DOCS_REPO" \
"$PROJECT_SIMULATE_RELEASE_REPO" \
"$PROJECT_DOCS_REPO_DIRECTORY" \
"$PROJECT_DOCS_REPO_BRANCH"
if [ $? -ne 0 ]; then
OS::print_status error "setup failed.\n"
return 1
fi


# move existing items to docs repo
__staging="${PROJECT_PATH_ROOT}/${PROJECT_PATH_DOCS}"
__dest="${PROJECT_PATH_ROOT}/${PROJECT_PATH_RELEASE}/${PROJECT_DOCS_REPO_DIRECTORY}"

OS::print_status info "exporting staging contents to docs repo...\n"
FS::copy_all "${__staging}/" "$__dest"
if [ $? -ne 0 ]; then
OS::print_status error "export failed.\n"
return 1
fi

OS::print_status info "Sourcing commit id for tagging...\n"
__tag="$(GIT::get_latest_commit_id)"
if [ -z "$__tag" ]; then
OS::print_status error "Source failed.\n"
return 1
fi

__current_path="$PWD" && cd "${__dest}"

OS::print_status info "Committing docs repo...\n"
GIT::autonomous_force_commit \
"$__tag" \
"$PROJECT_DOCS_REPO_KEY" \
"$PROJECT_DOCS_REPO_BRANCH"
__exit=$?

cd "$__current_path" && unset __current_path

if [ $__exit -ne 0 ]; then
OS::print_status error "commit failed.\n"
return 1
fi


# report status
return 0
}
95 changes: 95 additions & 0 deletions automataCI/_release-docsrepo_windows-any.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Copyright 2023 (Holloway) Chew, Kean Ho <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at:
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
. "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\services\io\os.ps1"
. "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\services\io\fs.ps1"
. "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\services\versioners\git.ps1"
. "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\services\compilers\installer.ps1"




function RELEASE-Docs-Repo {
# validate input
OS-Print-Status info "publishing artifacts to docs repo..."
if (-not (Test-Path `
-PathType Container `
-Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_DOCS}")) {
OS-Print-Status warning "release skipped - No docs directory."
return 0
}


# clean up base directory
OS-Print-Status info "safety checking docs repo release directory..."
if (Test-Path -PathType Leaf `
-Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_RELEASE}\${env:PROJECT_DOCS_REPO_DIRECTORY}") {
OS-Print-Status error "check failed."
return 1
}
$null = FS-Make-Directory "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_RELEASE}"


# execute
OS-Print-Status info "setting up release docs repo..."
$__process = INSTALLER-Setup-Resettable-Repo `
"${env:PROJECT_PATH_ROOT}" `
"${env:PROJECT_PATH_RELEASE}" `
"$(Get-Location)" `
"${env:PROJECT_DOCS_REPO}" `
"${env:PROJECT_SIMULATE_RELEASE_REPO}" `
"${env:PROJECT_DOCS_REPO_DIRECTORY}" `
"${env:PROJECT_DOCS_REPO_BRANCH}"
if ($__process -ne 0) {
OS-Print-Status error "setup failed."
return 1
}


# move existing items to docs repo
$__staging = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_DOCS}"
$__dest = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_RELEASE}\${env:PROJECT_DOCS_REPO_DIRECTORY}"

OS-Print-Status info "exporting staging contents to docs repo..."
$__process = FS-Copy-All "${__staging}\" "${__dest}"
if ($__process -ne 0) {
OS-Print-Status error "export failed."
return 1
}

OS-Print-Status info "Sourcing commit id for tagging..."
$__tag = GIT-Get-Latest-Commit-ID
if ([string]::IsNullOrEmpty(${__tag})) {
OS-Print-Status error "Source failed."
return 1
}

$__current_path = Get-Location
$null = Set-Location "${__dest}"

OS-Print-Status info "Committing docs repo..."
$__process = Git-Autonomous-Force-Commit `
"${__tag}" `
"${env:PROJECT_DOCS_REPO_KEY}" `
"${env:PROJECT_DOCS_REPO_BRANCH}"

$null = Set-Location "${__current_path}"
$null = Remove-Variable __current_path

if ($__process -ne 0) {
OS-Print-Status error "Commit failed."
return 1
}


# report status
return 0
}
2 changes: 1 addition & 1 deletion automataCI/_release-staticrepo_unix-any.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ RELEASE::run_static_repo_setup() {

# execute
OS::print_status info "setting up release static repo...\n"
INSTALLER::setup_release_repo \
INSTALLER::setup_resettable_repo \
"$PROJECT_PATH_ROOT" \
"$PROJECT_PATH_RELEASE" \
"$PWD" \
Expand Down
2 changes: 1 addition & 1 deletion automataCI/_release-staticrepo_windows-any.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function RELEASE-Run-Static-Repo-Setup {

# execute
OS-Print-Status info "setting up release static repo..."
$__process = INSTALLER-Setup-Release-Repo `
$__process = INSTALLER-Setup-Resettable-Repo `
"${env:PROJECT_PATH_ROOT}" `
"${env:PROJECT_PATH_RELEASE}" `
"$(Get-Location)" `
Expand Down
Loading

0 comments on commit 64f9c9c

Please sign in to comment.