-
Notifications
You must be signed in to change notification settings - Fork 2
[PR-23781] Migrate docs to Jenkins #358
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
506bae7
added venv didrectories to exclusions
en-ver d003f91
refactoring
en-ver 418cb1a
creanup from the ruby way of deployment
en-ver c5dafe3
move robots.txt to nginx level
en-ver a373777
dockerized deployment introduction
en-ver bef9cb4
Merge branch vo-PR-23724 into enver-PR-23781-migrate-docs-to-jenkins
ilovepinkpony1 ad0d42a
refactoring + documentation completion
en-ver eb557d0
doc refactoring
en-ver 0dda506
docs reformat
en-ver c2624ea
Update README-devops.md
en-ver 809d99b
rename `staging-bastion` to `staging`
en-ver 5a9074b
get back PULL_REQUEST_TEMPLATE.md
en-ver 05bf23b
replace bastion-docs.talkable.com with staging-docs.talkable.com
en-ver c0192d8
change nginx:1.27 to nginx:1.27.3
en-ver 0244c2d
hardcode the dependencies versions, rename confusing requirements-dev…
en-ver d9167bb
replace deprecated docker-compose with modern "docker compose"
en-ver 100b25b
gitignore refactoring
en-ver 24f8920
Maintenance guide intro
en-ver c205648
build option added to make sure if it builds up to date image
en-ver 05d0c4a
Update README.md
en-ver c7f5d7b
nginx: add caching policy and compression
en-ver f215c9e
Add newline at end of files
zhuravel 83ea286
different modes of Sphinx builder for different environments
en-ver 2430bb7
get the circleci back
en-ver 29aef03
change the html mode to dirhtml for cicleci run
en-ver d70976d
ENVIRONMENT variable intro to circleci - conditional. and let the job…
en-ver 71dfa55
remove filter and add fallback env variable value
en-ver f6478ab
circleci env variable processing improvement
en-ver 2b70a61
Cleanup
zhuravel fa42906
Merge branch 'vo-PR-23724' into enver-PR-23781-migrate-docs-to-jenkins
en-ver File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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,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=staging-docs.talkable.com | ||
PRODUCTION_HOST=docs.talkable.com |
This file contains hidden or 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,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 --> | ||
[](https://talkable.atlassian.net/browse/PR-1234) | ||
This file contains hidden or 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,7 +1,19 @@ | ||
# IDE | ||
.idea | ||
.vscode | ||
|
||
# Local | ||
*.log | ||
.env | ||
|
||
# Sphinx | ||
_build | ||
|
||
# Python | ||
.venv | ||
__pycache__ | ||
|
||
# Ruby | ||
/build | ||
/.bundle | ||
Gemfile.lock | ||
zhuravel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
source/_static/test | ||
.pivotalrc | ||
.idea | ||
*.log |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,93 @@ | ||
## 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. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.