README and .drone.yml updates
Some checks reported errors
continuous-integration/drone/push Build encountered an error

Re autonomic-cooperative/astro-payload-template#3
This commit is contained in:
3wc 2024-05-19 19:14:43 -03:00
parent 40d257a0eb
commit 2fde6710c4
2 changed files with 32 additions and 29 deletions

View File

@ -4,7 +4,7 @@ name: publish pipeline
steps: steps:
- name: publish astro container - name: publish astro container
image: plugins/docker image: plugins/docker
settings: settings: &docker-build-settings
username: 3wordchant username: 3wordchant
password: password:
from_secret: git_autonomic_zone_token_3wc from_secret: git_autonomic_zone_token_3wc
@ -16,29 +16,19 @@ steps:
dockerfile: astro/Dockerfile dockerfile: astro/Dockerfile
- name: publish payload dev container - name: publish payload dev container
image: plugins/docker image: plugins/docker
settings: settings: &payload-build-settings
username: 3wordchant << *docker-build-settings
password:
from_secret: git_autonomic_zone_token_3wc
# NOTE: edit this if you want your image called something else # NOTE: edit this if you want your image called something else
repo: git.autonomic.zone/autonomic-cooperative/astro-payload-test-payload-dev repo: git.autonomic.zone/autonomic-cooperative/astro-payload-test-payload-dev
auto_tag: true
registry: git.autonomic.zone
context: payload context: payload
dockerfile: payload/Dockerfile dockerfile: payload/Dockerfile
target: dev target: dev
- name: publish payload prod container - name: publish payload prod container
image: plugins/docker image: plugins/docker
settings: settings:
<<: *payload-build-settings
username: 3wordchant username: 3wordchant
password:
from_secret: git_autonomic_zone_token_3wc
# NOTE: edit this if you want your image called something else
repo: git.autonomic.zone/autonomic-cooperative/astro-payload-test-payload repo: git.autonomic.zone/autonomic-cooperative/astro-payload-test-payload
auto_tag: true
registry: git.autonomic.zone
context: payload
dockerfile: payload/Dockerfile
target: prod target: prod
- name: deploy stack - name: deploy stack
image: git.coopcloud.tech/coop-cloud/stack-ssh-deploy:latest image: git.coopcloud.tech/coop-cloud/stack-ssh-deploy:latest

View File

@ -1,4 +1,16 @@
# How to use this template # Paystro
Paystro is a pre-configured setup for Astro and Payloadcms, designed to make it easy for you to start building your website. With Paystro, you'll have a complete development environment that you can run locally using Docker. This setup simplifies the testing and development of your website before deploying it to a production environment.
## Architecture
Paystro is a fork of [Astroad](https://github.com/mooxl/astroad).
Unlike Astroad where the "Astro" image is the built static site served with Nginx Paystro's Astro image is a builder image.
In Paystro, the Docker stack just contains Payload and a generic Nginx container.
## How to use this template
1. Create a new Gitea repository based on this template repo (choose at least 1. Create a new Gitea repository based on this template repo (choose at least
"git content") "git content")
@ -11,24 +23,29 @@ To set up deployment:
including adding an SSH key as an organisational secret for the organisation including adding an SSH key as an organisational secret for the organisation
this project is in (see [Autonomic internal this project is in (see [Autonomic internal
docs](https://docz.autonomic.zone/doc/setting-up-auto-deployment-using-drone-I4j2onjaKT)) docs](https://docz.autonomic.zone/doc/setting-up-auto-deployment-using-drone-I4j2onjaKT))
2. Edit `.drone.yml` to define the server to host on, and the 2. Edit `.drone.yml` to set variables:
- `HOST`: hostname or IP address of the server to deploy to (e.g.
`vps.example.tld`)
- `DOMAIN`: domain name of the live site (e.g. `site.example.tld`)
- `STACK_NAME`: the Docker stack name, usually `$DOMAIN` with dots replaced
with underscores (e.g. `site_example_tld`)
`STACK_NAME` / `DOMAIN` of the deployed app. `STACK_NAME` / `DOMAIN` of the deployed app.
3. Generate secrets (`openssl rand -hex 32` works well) for `PAYLOAD_SECRET` and 3. Make sure that DNS records for `$DOMAIN` and `admin.$DOMAIN`, pointing to
`$HOST`, are defined.
4. Generate secrets (`openssl rand -hex 32` works well) for `PAYLOAD_SECRET` and
`MONGO_PASSWORD`. Insert the personal user token for a Drone bot user (e.g. `MONGO_PASSWORD`. Insert the personal user token for a Drone bot user (e.g.
`autono-bot`) as `TOKEN`). For all of them, use something like `echo "foobar" `autono-bot`) as `TOKEN`). For all of them, use something like `echo "foobar"
| docker secret create paystro_swarm-demo_autonomic_zone_token_v1 -`, where | docker secret create paystro_swarm-demo_autonomic_zone_token_v1 -`, where
`paystro_swarm-demo_autonomic_zone` is the `STACK_NAME`. `paystro_swarm-demo_autonomic_zone` is the `STACK_NAME`.
4. Activate the repo in Drone 5. Activate the repo in Drone
# Paystro ---
Paystro is a pre-configured setup for Astro and Payloadcms, designed to make it easy for you to start building your website. With Paystro, you'll have a complete development environment that you can run locally using Docker. This setup simplifies the testing and development of your website before deploying it to a production environment. # ${REPO_NAME}
Paystro is a fork of [Astroad](https://github.com/mooxl/astroad).
## Prerequisites ## Prerequisites
Before getting started with Paystro, make sure you have Docker installed (and, if your Docker doesn't include `docker compose`, the separate `docker-compose` tool). Before getting started, make sure you have Docker installed (and, if your Docker doesn't include `docker compose`, the separate `docker-compose` tool).
## Configuration ## Configuration
@ -44,8 +61,4 @@ The `docker-compose.yml` file includes everything you need to run the containers
Whenever the repository is updated, Drone builds new Docker images for Payload and Astro, and deploys a new Docker Swarm stack to the `HOST` configured in `.drone.yml`. Whenever the repository is updated, Drone builds new Docker images for Payload and Astro, and deploys a new Docker Swarm stack to the `HOST` configured in `.drone.yml`.
Unlike Astroad where the "Astro" image is the built static site served with Nginx Paystro's Astro image is a builder image. Whenever changes are made to Payload content on the live site, Drone uses the Astro builder image to regenerate the static site, and publish it to the Nginx container by copying it into the Docker volume.
In Paystro, the Docker stack just contains Payload and a generic Nginx container.
Whenever changes are made to Payload content, Drone uses the Astro builder image to regenerate the static site, and publish it to the Nginx container by copying it into the Docker volume.