Server-architectuur
Onderstaand diagram visualiseert de inrichting van de development- en productieservers, de pipelines en het deployen van een applicatie.
Architecture diagram
flowchart TD
subgraph REPOS["Git repositories"]
DEV_REPO["Development repository"]
INFRA["Infrastructure repository"]
APP_REPO["App repository"]
end
subgraph INFRA_PIPELINE["Infrastructure pipeline"]
subgraph INFRA_PIPELINE_STEPS["Steps"]
P_SSH["Deploy SSH keys"]
P_CADDY["Start Caddy"]
end
end
subgraph APP_PIPES["Application pipelines"]
subgraph APP_PIPES_STEPS["Steps"]
P_PUBLISH_APP["1. Publish pipeline"]
P_DEPLOY_APP["2. Deploy pipeline"]
end
end
REGISTRY[("Gitea image registry")]
subgraph SERVERS["Servers"]
PROD["Production server"]
DEV["Development server"]
end
INFRA --> INFRA_PIPELINE
P_SSH -->|"Registers SSH keys"| PROD
P_SSH -->|"Registers SSH keys"| DEV
P_CADDY -->|"Starts Caddy server"| PROD
P_CADDY -->|"Starts Caddy server"| DEV
DEV_REPO -->|"contains configurations and source code"| DEV
APP_REPO --> APP_PIPES
P_PUBLISH_APP -->|"Push image"| REGISTRY
P_DEPLOY_APP -->|"Pull image and start"| PROD
Sequence diagram
Deployen van SSH keys en Caddy servers
In deze diagram wordt uitgelegd hoe de SSH keys en caddy servers op de servers gezet worden. In deze diagram is vanuit gegaan dat deze op zowel development als production uitgevoerd worden.
sequenceDiagram
autonumber
actor User
participant Infra repository
participant Development Server
participant Production Server
Note right of User: ✅Development<br />✅Production
User->>Infra repository: Trigger pipeline
rect
Note right of User: SSH key step
Infra repository->>+User: Request manual approval for SSH key deploy step
User->>-Infra repository: Approve
Infra repository->>+Development Server: Deploy SSH keys
Development Server-->>-Infra repository: Completed
Infra repository->>+Production Server: Deploy SSH keys
Production Server-->>-Infra repository: Completed
end
rect
Note right of User: Caddy deploy step
Infra repository->>+User: Request manual approval for Caddy deploy step
User->>-Infra repository: Approve
Infra repository->>+Development Server: Deploy Caddy server
Development Server-->>-Infra repository: Completed
Infra repository->>+Production Server: Deploy Caddy server
Production Server-->>-Infra repository: Completed
end
Infra repository->>User: Completed
Deployen van een applicatie
In deze diagram wordt uitgelegd hoe een applicatie gedeployed kan worden.
sequenceDiagram
autonumber
actor User
participant App repository
participant Development Server
participant Production Server
participant Gitea image registry
User->>+App repository: Push to main
rect
Note right of User: Publish image step
App repository->>App repository: Build image
App repository->>+Gitea image registry: Publish image
Gitea image registry-->>-App repository: Completed
end
rect
Note right of User: Deploy to development server step
App repository->>+Development Server: Ansible SSH
Development Server->>+Gitea image registry: Pull image
Gitea image registry-->>-Development Server: Return image
Development Server->>Development Server: Start docker-compose
Development Server-->>-App repository: Completed
end
rect
Note right of User: Deploy to production server step
App repository->>+Production Server: Ansible SSH
Production Server->>+Gitea image registry: Pull image
Gitea image registry-->>-Production Server: Return image
Production Server->>Production Server: Start docker-compose
Production Server-->>-App repository: Completed
end
App repository-->>-User: Completed