Initial Commit

This commit is contained in:
2024-09-09 22:37:51 +10:00
commit ca1eea8f56
49 changed files with 2271 additions and 0 deletions

View File

@ -0,0 +1,74 @@
name: 'Add Application'
description: 'Track the process of adding a new application'
title: 'Add Application: [Application Name]'
labels:
- addition
assignees: ''
body:
- type: markdown
attributes:
value: |
## Application Details
- type: input
id: application-name
attributes:
label: Application Name
description: Name of the application to be added
placeholder: Name of the application
- type: textarea
id: application-description
attributes:
label: Application Description
description: Provide a brief description of the application and its purpose
placeholder: Description of the application
- type: checkboxes
id: application-reason
attributes:
label: Reason for Addition
description: Please select one or more reasons for adding the application
options:
- label: New functionality
- label: Performance improvement
- label: Security enhancement
- label: Replacing another application
description: Provide the name of the application being replaced, if applicable
- label: Other (please specify)
description: Provide additional details
- type: markdown
attributes:
value: |
## Steps to Add
- type: checkboxes
id: steps-to-add
attributes:
label: Steps to Add
description: Please check off each step as it is completed
options:
- label: Add Configuration Files
description: Create and add configuration files for the new application
- label: Update Wiki
description: Create or update the Wiki page for the new application and update any relevant architecture diagrams or flowcharts
- label: Update README(s)
description: Add the new application to the main table and any other relevant sections
- label: Add to CD Platform Logic
description: Add necessary logic to the CD platform for the new application
- label: Testing and Validation
description: Ensure the application is tested and validated in the environment
- type: markdown
attributes:
value: |
## Commit IDs for Completed Steps
- type: textarea
id: commit-ids
attributes:
label: Commit IDs
description: Enter the commit IDs for the completed steps above
placeholder: Enter commit IDs separated by commas

View File

@ -0,0 +1,50 @@
name: 'Feature Request'
description: 'Suggest a new feature for the project'
title: 'Feature Request: [Summary]'
labels:
- enhancement
assignees: ''
body:
- type: markdown
attributes:
value: |
## Feature Request
**Please fill out this template with the requested information.**
- type: input
id: summary
attributes:
label: Summary
description: A concise description of the feature you'd like to see added.
placeholder: Brief summary of the feature request
- type: textarea
id: motivation
attributes:
label: Motivation
description: Explain why this feature would be beneficial to the project. What problem does it solve or what value does it bring?
placeholder: Describe the motivation behind the feature request
- type: textarea
id: detailed-description
attributes:
label: Detailed Description
description: |
Provide a detailed explanation of the proposed feature. Include:
- How would this feature be used?
- What are the expected benefits of this feature?
- Are there any potential drawbacks or limitations to consider?
placeholder: Provide a detailed description of the feature
- type: textarea
id: additional-context
attributes:
label: Additional Context
description: |
Include any relevant information such as:
- Links to external resources (e.g., documentation, articles)
- Screenshots or mockups to illustrate the feature
- Use cases and examples of how the feature would be used
placeholder: Add any other context or screenshots about the feature request here

View File

@ -0,0 +1,39 @@
name: Deploy
on:
push:
branches:
- master
jobs:
deploy:
name: Prepare Build
runs-on: alpine-latest
container: alpine:latest
steps:
- name: Install dependencies
run: |
apk update
apk add --no-cache nodejs npm git bash openssh python3 py3-pip py3-passlib
python3 -m pip install --user ansible --break-system-packages
export PATH="/root/.local/bin:$PATH"
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Deploy containers
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
eval $(ssh-agent -s)
ssh-add <(echo "${{ secrets.SSH_PRIVATE_KEY }}")
echo "HOST *" > ~/.ssh/config
echo "StrictHostKeyChecking no" >> ~/.ssh/config
echo "${{ secrets.ANSIBLE_VAULT_PASSWORD }}" > ~/.vault_password.txt
echo "nameserver 10.10.10.1" > /etc/resolv.conf
./.gitea/workflows/deploy.sh "${{ github.event.before }}" "${{ github.sha }}"

14
.gitea/workflows/deploy.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
changed_tasks=($(git diff --name-only $1 $2 | grep '\.yml$'))
if [ ! -z "$changed_tasks" ]; then
for task in "${changed_tasks[@]}"; do
tag=$(echo "$task" | awk -F/ '{print $2}')
if [[ "$tag" != "deploy-homelab.yml" && "$tag" != "main.yml" && "$tag" != "all.yml" && "$tag" != "all.example.yml" && "$tag" != "ISSUE_TEMPLATE" && "$tag" != "workflows" ]] ; then
tag=${tag%.*}_install
/root/.local/bin/ansible-playbook main.yml --tags "$tag" --vault-password-file ~/.vault_password.txt
fi
done
else
echo "No changes detected in task files. Skipping Ansible playbook execution."
fi