Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR-23724][FE] Add some fancy theme #355

Merged
merged 68 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
425e8cf
[PR-23724]: added new theme, updated files
ilovepinkpony1 Jan 16, 2025
9652fd3
[PR-23724]: updated styles
ilovepinkpony1 Jan 17, 2025
506bae7
added venv didrectories to exclusions
en-ver Jan 22, 2025
d003f91
refactoring
en-ver Jan 22, 2025
c6a1d88
[PR-23724]: merged master, resolved conflicts
ilovepinkpony1 Jan 23, 2025
418cb1a
creanup from the ruby way of deployment
en-ver Jan 23, 2025
191f97d
[PR-23724]: moved docs name hide to conf
ilovepinkpony1 Jan 23, 2025
c5dafe3
move robots.txt to nginx level
en-ver Jan 24, 2025
8baf008
[PR-23724]: updated campaign placements image tag
ilovepinkpony1 Jan 24, 2025
a373777
dockerized deployment introduction
en-ver Jan 24, 2025
bef9cb4
Merge branch vo-PR-23724 into enver-PR-23781-migrate-docs-to-jenkins
ilovepinkpony1 Jan 24, 2025
ad0d42a
refactoring + documentation completion
en-ver Jan 25, 2025
eb557d0
doc refactoring
en-ver Jan 25, 2025
0dda506
docs reformat
en-ver Jan 25, 2025
97b67e1
[PR-23724]: fixed color for auto theme mode
ilovepinkpony1 Jan 26, 2025
2a3f572
[PR-23781] Migrate docs to Jenkins (#358)
en-ver Jan 27, 2025
280afb5
merged vo-PR-23724, resolved conflicts
ilovepinkpony1 Jan 27, 2025
6893b6a
rename staging-docs.talkable.com to docs.bastion.talkable.com
en-ver Jan 27, 2025
88ae84a
Merge branch 'staging' into vo-PR-23724
en-ver Jan 27, 2025
19a0a87
rename staging-docs.talkable.com to docs.bastion.talkable.com (#360)
en-ver Jan 27, 2025
4095278
deploy on jenkins
Jan 27, 2025
a35a542
deploy on jenkins-2
Jan 27, 2025
9623436
deploy on jenkins-3
Jan 27, 2025
cb35118
deploy on jenkins-4
Jan 27, 2025
4db2f04
deploy on jenkins-5
Jan 27, 2025
272b139
deploy on jenkins-6
Jan 27, 2025
30af536
deploy on jenkins-7
Jan 27, 2025
15ef8f9
deploy on jenkins-8
Jan 27, 2025
f58976e
deploy on jenkins-9
Jan 27, 2025
c06d277
deploy on jenkins-10
Jan 27, 2025
f95ee9e
deploy on jenkins-11
Jan 27, 2025
50c62e3
deploy on jenkins-11
Jan 27, 2025
e671377
deploy on jenkins-14
Jan 27, 2025
d8d0820
deploy on jenkins-15
Jan 27, 2025
7ca1303
deploy on jenkins-16
Jan 27, 2025
38ae580
deploy on jenkins-18
Jan 27, 2025
54de3e5
deploy on jenkins-20
Jan 27, 2025
242f199
deploy on jenkins-22
Jan 27, 2025
b133cd8
deploy on jenkins-23
Jan 27, 2025
344157f
deploy on jenkins-23
Jan 27, 2025
56eae6c
deploy on jenkins-24
Jan 27, 2025
992d40d
install and run nginx and sphinx within the same container
en-ver Jan 28, 2025
6a6389f
Merge branch 'staging' into vo-PR-23724
en-ver Jan 28, 2025
99e7e87
docker compose refactoring
en-ver Jan 28, 2025
301e3ab
update the readme files to sync with one container design (python ins…
en-ver Jan 28, 2025
95a2602
[PR-23789] "empty screen on empty search" fix
en-ver Jan 28, 2025
8edf024
legacy requirements-dev.txt cleanup
en-ver Jan 28, 2025
5755c7e
lists fixes
en-ver Jan 28, 2025
9d3883a
[PR-23796] add missing ","
en-ver Jan 28, 2025
3f00f08
Revert "install and run nginx and sphinx within the same container"
en-ver Jan 28, 2025
a7ff19b
add ENVIRONMENT variable to nginx container name
en-ver Jan 28, 2025
2872eb8
[PR-23724]: updated views
ilovepinkpony1 Jan 28, 2025
b61f205
add "docs" to the name of nginx container
en-ver Jan 28, 2025
2069c6a
cicrleci errors fix
en-ver Jan 28, 2025
cca4d44
[PR-23724]: updated indentation
ilovepinkpony1 Jan 28, 2025
d431719
Update README-maintainer.md
en-ver Jan 29, 2025
cec050c
gitignore refactoring
en-ver Jan 29, 2025
746556a
deploy jenkins
Jan 29, 2025
ce396cf
remove idea detailed ignores, keep only '.idea' which covers everything
en-ver Jan 29, 2025
e9b4931
formatting refactoring
en-ver Jan 29, 2025
9f72e7c
add subproject variable
Jan 29, 2025
12c4428
readme for maintainer and gitignore refactoring
en-ver Jan 29, 2025
49a7e05
add link to Jenkins
Jan 30, 2025
945358e
Merge branch 'master' into vo-PR-23724
zhuravel Feb 3, 2025
742c0e7
[PR-23815]-Book-theme-for-Sphinx (#364)
zhuravel Feb 3, 2025
81f3502
Apply suggestions from code review
en-ver Feb 3, 2025
dba6f93
Update .gitignore
en-ver Feb 3, 2025
eb96b4a
add build for sphinx
Feb 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ executors:
- auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_ACCESS_TOKEN
image: cimg/python:3.12
image: cimg/python:3.13
environment:
ENVIRONMENT: production

orbs:
python: circleci/python@2.1.1
python: circleci/python@3.0.0

jobs:
build:
Expand All @@ -18,21 +20,15 @@ jobs:
steps:
- checkout

- python/install-packages:
app-dir: ~/project
- python/install-packages

- run:
name: Build documentation
command: sphinx-build -nW -b html -d build/doctrees source build/html
command: sphinx-build -nW -b dirhtml -d build/doctrees source build/html

workflows:
workflow:
jobs:
- build:
context:
- org-global
filters:
branches:
ignore:
- gh-pages
- /.*-gh-pages/
10 changes: 10 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# The port to use to populate the documentation on your local machine or server
LOCAL_PORT=8080

# Possible values: development, staging, production
ENVIRONMENT=development

# Base urls used for the canonical urls compilation
DEVELOPMENT_HOST=localhost
STAGING_HOST=docs.bastion.talkable.com
PRODUCTION_HOST=docs.talkable.com
4 changes: 0 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<!--- Provide a general summary of your changes in the Title above -->

## Demo
<!--- Please provide a link to a demo -->
https://deploy-preview-{{id}}--talkable-docs.netlify.app/

## Related Stories
<!--- If this pull request is related to JIRA story, please link to the story here -->
[![](http://proxies.talkable.com/talkable/PR-1234)](https://talkable.atlassian.net/browse/PR-1234)
22 changes: 17 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
/build
/.bundle
Gemfile.lock
source/_static/test
.pivotalrc
# IDE
.idea
.vscode

# Local
*.log
.env

# Sphinx
_build
build

# Python
.venv
__pycache__

# Ruby
.bundle
Gemfile.lock
1 change: 0 additions & 1 deletion .ruby-gemset

This file was deleted.

1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

1 change: 0 additions & 1 deletion CNAME

This file was deleted.

14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3.13-alpine3.21

# Install dependencies
WORKDIR /docs
ADD requirements.txt /docs
RUN python3 -m pip install -r requirements.txt

CMD if [ "$ENVIRONMENT" = "development" ]; then \
echo "Running Sphinx in Development mode"; \
sphinx-autobuild -b dirhtml /docs/source /docs/_build; \
else \
echo "Running Sphinx in Staging/Production mode"; \
sphinx-build -b dirhtml /docs/source /docs/_build; \
fi
11 changes: 0 additions & 11 deletions Gemfile

This file was deleted.

14 changes: 0 additions & 14 deletions Guardfile

This file was deleted.

2 changes: 0 additions & 2 deletions Procfile

This file was deleted.

94 changes: 94 additions & 0 deletions README-devops.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
## Overview

The Talkable documentation stack is a containerized system that uses Docker to simplify deployment and management. It is designed to generate, serve, and manage static documentation across multiple environments, such as staging and production.

## Key Features

1. **Containerized Components**:

- **Nginx**: Handles HTTP requests, serves static HTML files, manages URL redirection, and dynamically serves environment-specific `robots.txt` files.
- **Sphinx Autobuilder**: Generates static HTML files from source documentation and stores them in a persistent volume shared with Nginx.

2. **Environment-Specific Behavior**:

- Configured via a `.env` file for flexibility.
- Supports dynamic environment-specific behavior, such as serving different `robots.txt` files based on the `ENVIRONMENT` variable.

3. **Efficient Architecture**:

- Deployed on Amazon AWS Virtual Private Servers (VPS) with an AWS load balancer directing user traffic to the appropriate environment.
- Sphinx generates content on a persistent volume that Nginx serves directly.

## Deployment Process

### Prerequisites

- Ensure Docker and Docker Compose are installed on the target VPS.
- Clone the repository containing the stack configuration.

### Steps

1. **Clone the Repository**:

```bash
git clone [email protected]:talkable/talkable-docs.git
```

2. **Switch to the Appropriate Branch**:

- Use the `master` branch for production.

```bash
git checkout master
```

- Use the `staging` branch for staging.

```bash
git checkout staging
```

3. **Create and Configure the `.env` File**:

- Copy `.env.template` to `.env`:

```bash
cp .env.template .env
```

- Update the following variables:

- **`ENVIRONMENT`**: Set to `development`, `staging`, or `production`.
- **`LOCAL_PORT`**: Adjust if the default port (`8080`) is already in use.
- Leave `_HOST` variables unchanged unless domain names for staging or production servers are updated.

4. **Deploy the Stack**:

```bash
docker compose up -d --build
```

## Environment-Specific Configuration

### Handling `robots.txt`

- The repository includes separate `robots.txt` files for each environment.
- The correct file is dynamically selected based on the `ENVIRONMENT` variable and mapped to the container:

```yaml
volumes:
- ./nginx/robots/${ENVIRONMENT}.txt:/var/www/robots.txt
```

- Nginx serves the file at `/var/www/robots.txt` in response to `robots.txt` requests.

## Persistent Data Sharing

- **Static HTML Files**:

- Generated by Sphinx and stored in a shared volume.
- Served by Nginx without regeneration.

- **Volume Management**:
- Shared volumes allow seamless access and updates between containers.
- Ensures efficient and consistent behavior across environments.
162 changes: 162 additions & 0 deletions README-maintainer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Talkable Documentation Maintenance Routine

This documentation provides instructions for maintaining the Sphinx Builder **framework** used to generate the Talkable Documentation.

It outlines the routine for maintaining the framework and associated workflows.

> [!NOTE]
> This guide does not cover updating the documentation content.
> Refer to [README.md](README.md) for details on updating the Talkable documentation source, which is available at [https://docs.talkable.com/](https://docs.talkable.com/).

## Scope

The maintenance routine includes the following tasks:

- Updating dependencies:
- Sphinx and other Python packages
- Python container
- Adding new extensions
- Introducing Talkable-specific customizations (Python scripts)

## Preparations

1. Clone the documentation repository.

```bash
git clone [email protected]:talkable/talkable-docs.git
cd talkable-docs
```

2. Create a new branch from `master`.

```bash
git checkout -b new-branch
```

3. Generate a `.env` file from the `.env.template`.

```bash
cp .env.template .env
```

## Updating Packages

The goal is to update `requirements.txt` with the latest versions of dependencies.

1. Replace `requirements.txt` with the `packages.txt` file.

```bash
cp packages.txt requirements.txt
```

2. Build the Sphinx container.

```bash
docker compose up -d --build
```

This starts the framework and allows you to load the documentation at http://localhost:8080.

If the documentation fails to load, check the container logs:

```bash
docker logs -f docs-sphinx-development
```

3. Test and freeze `requirements.txt`.

Ensure everything works as expected locally. Once confirmed, update `requirements.txt` to include all installed dependencies with their versions.

Save the dependencies with the following command:

```bash
docker exec docs-sphinx-development pip freeze > requirements.txt
```

4. Stop the containers.

Once the documentation is fully functional, stop the containers:

```bash
docker compose down -v
```

5. Push the updated `requirements.txt` to GitHub.

Commit and push the updated `requirements.txt` for testing and production.

## Updating the Python Container

The Sphinx framework uses a Python Docker image from DockerHub.

1. Check for the latest Python image on DockerHub: https://hub.docker.com/_/python.

2. Update the image name in the [Dockerfile](./Dockerfile):

```dockerfile
FROM python:3.13-alpine3.21
```

3. Test the deployment.

Deploy the Sphinx container to verify the updates:

```bash
docker compose up -d --build
```

Confirm that the documentation loads at http://localhost:8080.

4. Finalize the update.

Commit the updated `Dockerfile` to the repository for testing and production.

Stop the containers:

```bash
docker compose down -v
```

## Adding New Extensions

Sphinx is a highly customizable documentation framework. You can extend its functionality with official or third-party extensions.

Here are some resources:

- https://sphinx-extensions.readthedocs.io/en/latest/
- https://www.sphinx-doc.org/en/master/development/index.html
- https://github.com/sphinx-contrib

To add extensions, follow these steps:

1. [Install additional Python packages](#installing-additional-packages).
2. [Adjust the conf.py file](#modifying-configuration-files).
3. Add Python scripts to the [./source/](./source/) directory if necessary.

Start by deploying the framework container:

```bash
docker compose up -d --build
```

### Installing Additional Packages

Add the package to `requirements.txt`.

Append the package name to `requirements.txt` (version specification is optional at this stage).

> [!NOTE]
> Version pinning can be done later.

Rebuild the container after modifying `requirements.txt`:

```bash
docker compose up -d --build
```

### Modifying Configuration Files

Most changes involve editing the [./source/conf.py](./source/conf.py) file or other files in the [./source/](./source/) directory.

> [!NOTE]
> Rebuilding the container is unnecessary for changes to [./source/conf.py](./source/conf.py) or [./source/](./source/). These changes are applied automatically within 1 second.
Loading