Skip to content

Commit

Permalink
docs: updates workflow and adds changelog automation (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylesomers authored Jun 10, 2024
1 parent 8155169 commit 3d170b1
Show file tree
Hide file tree
Showing 13 changed files with 143 additions and 57 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Update Changelog

on:
schedule:
- cron: '0 0 * * *' # This will run the action every day at midnight

jobs:
update-changelog:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Install git-chglog
run: go get -u github.com/git-chglog/git-chglog

- name: Update Changelog
run: git-chglog -o CHANGELOG.md

- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git checkout -b changelog-update
git add .
git commit -m "Update Changelog"
git push origin changelog-update
echo $GH_TOKEN | gh auth login --with-token
gh pr create --title "Update Changelog" --body "This is an auto-generated PR to update the changelog." --base main --head changelog-update --repo ${{ github.repository }} --confirm
14 changes: 3 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
## Process
# 1. When changes are made to documentation files and pushed to the main branch, the workflow in this file is triggered.
# 2. Copy the repository's contents to the runner, so the workflow can access them.
# 3. Run a script that sets the version number.
# 4. `make docs-build` is run within a Docker container to build the documentation .
# 5. `make docs-deploy` is run inside Docker container to deploy the documentation to GitHub Pages.
# 3. `make docs-deploy` is run inside Docker container to deploy the documentation to GitHub Pages.
# Currently using fixed version and alias until release
#====================================================================================================
name: Build Docs and Publish to gh-pages
env:
VERSION: v0.1.0-alpha.2
VERSION: v0.1.0-alpha.1
ALIAS: latest
on:
push:
Expand Down Expand Up @@ -53,13 +52,6 @@ jobs:
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Set version
run: |
echo "Tag name from github.ref_name: ${{ github.ref_name }}"
echo "VERSION is: ${{ env.VERSION }}"
echo "ALIAS is: ${{ env.ALIAS }}}"
- name: Build docs
run: make docs-build VERSION="$VERSION"
- name: Deploy Docs
run: make docs-deploy VERSION="$VERSION" ALIAS="$ALIAS"

5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ terraform.rc
.pre-commit-trivy-cache/*
.external_modules

# Ignore
# Ignore site files related to docs
site/

# Other
.DS_Store
Expand All @@ -59,4 +60,4 @@ terraform.rc

# SSH keys
id_ed25519
id_ed25519.pub
id_ed25519.pub
32 changes: 24 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ endif


.PHONY: docs-build
docs-build: ## Build the docs using docker. Example: `make docs-build VERSION=1.0.0`
@if [ -z "${VERSION}" ]; then echo -e "${RED}VERSION is not set. Run 'make help' for usage. ${RESET}"; exit 1; fi
docs-build: ## Build the docs using docker. Example: `make docs-build VERSION=v1.0.0`
@if [ -z "${VERSION}" ]; then echo -e "${RED}VERSION is not set. Example: 'make docs-build VERSION=v1.0.0'. Run 'make help' for usage. ${RESET}"; exit 1; fi
@echo -e "Docs version is: ${GREEN}$(VERSION)${RESET}"
docker build -f ./docs/Dockerfile -t docs:$(VERSION) . \
--build-arg GIT_USER_NAME="$(GIT_USER_NAME)" \
Expand All @@ -31,21 +31,37 @@ docs-build: ## Build the docs using docker. Example: `make docs-build VERSION=1.
--no-cache

.PHONY: docs-deploy
docs-deploy: ## Deploy the docs using 'mike'. Example: `make docs-deploy VERSION=1.0.0 ALIAS=latest`
@if [ -z "${VERSION}" ]; then echo -e "${RED}VERSION is not set. Run 'make help' for usage. ${RESET}"; exit 1; fi
@if [ -z "${ALIAS}" ]; then echo -e "${RED}ALIAS is not set. Run 'make help' for usage. ${RESET}"; exit 1; fi
docs-deploy: ## Build and deploy the docs using 'mike'. Example: `make docs-deploy VERSION=v1.0.0 ALIAS=latest`
@if [ -z "${VERSION}" ]; then echo -e "${RED}VERSION is not set. Example: 'make docs-deploy VERSION=v1.0.0'. Run 'make help' for usage. ${RESET}"; exit 1; fi
@if [ -z "${ALIAS}" ]; then echo -e "${RED}ALIAS is not set. Example: 'make docs-deploy VERSION=v1.0.0 ALIAS=latest'. Run 'make help' for usage. ${RESET}"; exit 1; fi
@echo -e "Docs version is: ${GREEN}$(VERSION)${RESET}"
docker build -f ./docs/Dockerfile -t docs:$(VERSION) . \
--build-arg GIT_USER_NAME="$(GIT_USER_NAME)" \
--build-arg GIT_USER_EMAIL="$(GIT_USER_EMAIL)" \
--build-arg GITHUB_ACTIONS=$(GITHUB_ACTIONS) \
--no-cache
docker run -t docs:$(VERSION) mike deploy --push --update-aliases $(VERSION) ${ALIAS}


.PHONY: docs-local-docker
docs-local-docker: ## Build and run the docs locally using docker and 'serve'. Example: `make docs-local-docker VERSION=1.0.0`
@if [ -z "${VERSION}" ]; then echo -e "${RED}VERSION is not set. Run 'make help' for usage. ${RESET}"; exit 1; fi
docs-local-docker: ## Build and run the docs locally using docker and 'serve'. Example: `make docs-local-docker VERSION=v1.0.0`
@if [ -z "${VERSION}" ]; then echo -e "${RED}VERSION is not set. Example: 'make docs-local-docker VERSION=v1.0.0'. Run 'make help' for usage. ${RESET}"; exit 1; fi
@echo -e "Docs version is: ${GREEN}$(VERSION)${RESET}"
docker build -f ./docs/Dockerfile -t docs:$(VERSION) . --build-arg GIT_USER_NAME="$(GIT_USER_NAME)" --build-arg GIT_USER_EMAIL="$(GIT_USER_EMAIL)" --build-arg GITHUB_ACTIONS=$(GITHUB_ACTIONS) --no-cache
docker build -f ./docs/Dockerfile -t docs:$(VERSION) . \
--build-arg GIT_USER_NAME="$(GIT_USER_NAME)" \
--build-arg GIT_USER_EMAIL="$(GIT_USER_EMAIL)" \
--build-arg GITHUB_ACTIONS=$(GITHUB_ACTIONS) \
--no-cache
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs docs:$(VERSION) mkdocs serve --dev-addr=0.0.0.0:8000

.PHONY: help
help: ## Display this help
@echo -e "Usage: make [TARGET]\n"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "${CYAN}%-30s${RESET} %s\n", $$1, $$2}'

.PHONY: changelog
changelog: ## Generate CHANGELOG.md file
git fetch --tags origin
CURRENT_VERSION=$(shell git describe --abbrev=0 --tag) ;\
echo "[+] Pre-generating CHANGELOG for tag: $$CURRENT_VERSION" ;\
docker run -v "${PWD}":/workdir quay.io/git-chglog/git-chglog:latest > CHANGELOG.md
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,26 @@

[![License: MIT-0](https://img.shields.io/badge/License-MIT-0)](LICENSE)

The **Cloud Game Development Toolkit (a.k.a. CGD Toolkit)** is a collection of infrastructure as code templates and configurations for deploying common game development infrastructure and tools on AWS.
The **Cloud Game Development Toolkit (a.k.a. CGD Toolkit)** is a collection of templates and configurations for deploying game development infrastructure and tools on AWS.

The **Toolkit** consists of four key components:

1. **Assets**: Reusable Amazon Machine Image (AMI) templates written in [Packer](https://www.packer.io/) for Windows and Linux build machines as well as Perforce Helix Core and Helix Swarm workloads.
The project is designed for piecemeal usage:

2. **Modules**: Highly configurable and extensible [Terraform](https://www.terraform.io/) modules for simplified deployment of key game development infrastructure on AWS with best-practices by default.
- Already have a CI/CD pipeline deployed but need a build machine image? :white_check_mark:
- Looking to migrate your Perforce server from on-premise to AWS? :white_check_mark:
- Starting your new studio from the ground up and looking for pre-built templates to deploy common infrastructure? :white_check_mark:

3. **Samples**: Complete Terraform configurations for expedited studio setup that demonstrate module usage and integration with other AWS services.
The **Toolkit** consists of four key components:

4. **Playbooks**: Automation scripts written with [Ansible](https://github.com/ansible/ansible) to configure workloads after deployment.
| Component | Description
|-|-|
|**Assets**| Reusable scripts, pipeline definitions, Dockerfiles, [Packer](https://www.packer.io/) templates, and other resources that might prove useful or are dependencies of any of the modules.
|**Modules**| Highly configurable and extensible [Terraform](https://www.terraform.io/) modules for simplified deployment of key game development infrastructure on AWS with best-practices by default.
|**Samples**| Complete Terraform configurations for expedited studio setup that demonstrate module usage and integration with other AWS services.
|**Playbooks**| Automation scripts written with [Ansible](https://github.com/ansible/ansible) to configure workloads after deployment.

## Getting Started

### **[📖 Documentation](https://aws-games.github.io/cloud-game-development-toolkit/getting-started/)** | **[💻 Contribute to the Project](https://aws-games.github.io/cloud-game-development-toolkit/contributing/)** | **[💬 Ask Questions](https://github.com/aws-games/cloud-game-development-toolkit/discussions/)** | **[🚧 Roadmap](https://github.com/orgs/aws-games/projects/1/views/1)**
**[📖 Documentation](https://aws-games.github.io/cloud-game-development-toolkit/getting-started/)** | **[💻 Contribute to the Project](https://aws-games.github.io/cloud-game-development-toolkit/contributing/)** | **[💬 Ask Questions](https://github.com/aws-games/cloud-game-development-toolkit/discussions/)** | **[🚧 Roadmap](https://github.com/orgs/aws-games/projects/1/views/1)**

## Security

Expand Down
3 changes: 0 additions & 3 deletions assets/README.md

This file was deleted.

17 changes: 17 additions & 0 deletions assets/packer/build-agents/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### Unreal Engine Build Agents

Packer templates to create machine images for Unreal Engine build agents.

| Asset | Description | Type | Docs
|-|-|-|-|
| **Unreal Engine Build Agent (Linux)** | Packer templates for building Unreal Engine on Linux, with support for x86 and ARM (i.e. Graviton). | Packer Template | [Docs](#unreal-engine-build-agent-linux)
| **Unreal Engine Build Agent (Windows)** | Packer templates for building Unreal Engine on Windows | Packer Template | [Docs](#unreal-engine-build-agent-windows)


#### Unreal Engine Build Agent (Linux)

Documentation for UE Build Agents for Linux

#### Unreal Engine Build Agent (Windows)

Documentation for UE Build Agents for Windows
28 changes: 9 additions & 19 deletions assets/packer/perforce/helix-core/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Helix Core Server Deployment Script README
### Perforce Helix Core Packer Template

## Overview
#### Overview

This Bash script automates the deployment and configuration of a Helix Core Server (P4D) on a Linux environment, specifically tailored for use with SELinux and systemd. It performs various tasks such as checking and setting up the necessary user and group, handling SELinux context, installing and configuring Perforce Software's Server Deployment Package (SDP), and setting up the Helix Core service with systemd.
This Packer template automates the deployment and configuration of a Helix Core Server (P4D) on a Linux environment, specifically tailored for use with SELinux and systemd. It performs various tasks such as checking and setting up the necessary user and group, handling SELinux context, installing and configuring Perforce Software's Server Deployment Package (SDP), and setting up the Helix Core service with systemd.

### What it Does:
Steps in the Packer template automation include:

1. **Pre-Flight Checks**: Ensures the script is run with root privileges.
2. **Environment Setup**: Defines paths and necessary constants for the installation.
Expand All @@ -18,37 +18,27 @@ This Bash script automates the deployment and configuration of a Helix Core Serv
10. **Crontab Initialization**: Sets up crontab for the 'perforce' user.
11. **SDP Verification**: Runs a script to verify the SDP installation.

## Prerequisites
#### Prerequisites

- A Linux system with DNF package manager (e.g., Fedora, RHEL, CentOS).
- Root access to the system.
- SELinux in Enforcing or Permissive mode (optional but recommended).
- Access to the internet for downloading necessary packages and binaries.

## How to Use
#### How to Use

1. **Download the Script**: Clone or download this repository to your system.
2. **Provide Execution Permission**: Give execute permission to the script using `chmod +x <script_name>.sh`.
3. **Run the Script**: Execute the script as root:

```
sudo ./<script_name>.sh
```

4. **Follow the On-Screen Instructions**: The script is mostly automated, but monitor the output for any errors or required manual inputs.

## Important Notes
#### Important Notes

- This script is designed for a specific use-case and might require modifications for different environments or requirements.
- Ensure you have a backup of your system before running the script, as it makes significant changes to users, groups, and services.
- The script assumes an internet connection for downloading packages and binaries.

## Contributing

Contributions to improve the script or documentation are welcome. Please submit pull requests or raise issues as needed.

## License

This project is licensed under the MIT License - see the LICENSE file for details.

---

_This README provides a basic overview. Please refer to the script comments and documentation for detailed understanding of each component and its function._
28 changes: 27 additions & 1 deletion docs/assets.md
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
--8<-- "assets/README.md"
# Assets

**Assets** are reusable scripts, pipeline definitions, Dockerfiles, Packer templates, and other resources that might prove useful or are dependencies of any of the modules. Each asset contains its own documentation as a `README.md` file.

!!! info
**Don't see an asset listed?** Create a [feature request](https://github.com/aws-games/cloud-game-development-toolkit/issues/new?assignees=&labels=feature-request&projects=&template=feature_request.yml&title=Feature+request%3A+TITLE) for a new asset or learn [how to contribute new assets to the project below](#Contribute new Assets to the Cloud Game Development Toolkit)

## Packer Templates

Packer templates provide an easy way to build machine images for commonly used game dev infrastructure. Currently the project includes Packer templates for UE5 build agents for Linux and Windows, as well as a Packer template for building a Perforce Helix Core version control AMI.

- **[Unreal Engine Build Agents](#unreal-engine-build-agents)**: Packer templates for building Unreal Engine on Windows and Linux, including support for x86 and ARM (i.e. Graviton).
- **[Perforce Helix Core AMI](#perforce-helix-core-packer-template)**: Packer templates for creating an Amazon Machine Image (AMI) of Perforce Helix Core on Linux and configuration with Perforce Server Deployment Package (SDP)

<!-- Build Agents README #unreal-engine-build-agents -->
--8<-- "assets/packer/build-agents/README.md"

<!-- Perforce Helix Core README #perforce-helix-core-ami -->
--8<-- "assets/packer/perforce/helix-core/README.md"

## Dockerfiles

Dockerfiles for creating Docker images of commonly used game dev infrastructure.

## Contribute new Assets to the Cloud Game Development Toolkit

This section will contain documentation about how to create new assets, how they should be tested and documented, and the process for submitting them as PRs to the project.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Home
description: Cloud Game Development Toolkit
---

The Cloud Game Development Toolkit expedites studio setup through industry standard tools and with best practice infrastructure configuration from AWS.
The **Cloud Game Development Toolkit (a.k.a. CGD Toolkit)** is a collection of templates and configurations for deploying game development infrastructure and tools on AWS.

!!! info
**This project is under active development** and we have yet to solve for many developer needs. If you would like to see something in this repository please create a <a href="https://github.com/aws-games/cloud-game-development-toolkit/issues/new?assignees=&labels=feature-request&projects=&template=feature_request.yml&title=Feature+request%3A+TITLE" target="_blank">feature request</a> in the Issues tab, or raise a <a href="https://github.com/aws-games/cloud-game-development-toolkit/pulls/" target="_blank">pull request</a>. You'll find our contribution guidelines [here](./contributing.md).
Expand Down
3 changes: 3 additions & 0 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.md-grid {
max-width: 90vw
}
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ theme:
icon: material/lightbulb-outline
name: Switch to light mode
features:
- toc
- header.autohide
- navigation.sections
- navigation.top
Expand Down Expand Up @@ -82,5 +83,7 @@ extra:
provider: mike
default: latest
alias: true
extra_css:
- stylesheets/extra.css

copyright: Copyright &copy; 2024 Amazon Web Services
7 changes: 3 additions & 4 deletions samples/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cloud Game Development Samples
# Cloud Game Development Toolkit Samples

The Terraform configurations contained in this directory demonstrate the use of the modules contained in the **CGD Toolkit**, and integrations with other common AWS workloads and services. Each sample architecture will provide its own documentation and instructions that follows the template below:
Samples represent a reference implementation that can be deployed to solve for a specific use-case or workload. These are Terraform configurations and integrations with other common AWS workloads and services. Each sample will provide its own documentation and instructions that follows the template below:

#### 1) Predeployment

Expand All @@ -12,5 +12,4 @@ In the **deployment** phase the user is instructed to run `terraform apply` on o

#### 3) Postdeployment

Finally, the **postdeployment** phase includes any Ansible playbooks or remote execution instructions for configuring the applications that have been deployed. These may be automated or manual steps.

Finally, the **postdeployment** phase includes any Ansible playbooks or remote execution instructions for configuring the applications that have been deployed. These may be automated or manual steps.

0 comments on commit 3d170b1

Please sign in to comment.