A very simple dashboard for managing Continuous Deployment for PHC projects based on docker, dockerfiles, docker-compose or even shell scripts
  • TypeScript 41.4%
  • JavaScript 29.7%
  • SCSS 15.6%
  • Astro 12.7%
  • Dockerfile 0.6%
Find a file
2024-04-09 02:06:49 +02:00
public intial commit 2024-02-25 01:52:08 +01:00
scripts feat: working jobs page with sse 2024-03-08 02:08:01 +01:00
src feat: dynamic latest logs in deploy page 2024-04-09 02:06:49 +02:00
.dockerignore feat: dockerfiles 2024-03-12 23:52:27 +01:00
.env.sample chore: deploy styles 2024-03-12 23:52:13 +01:00
.gitignore feat: working jobs page with sse 2024-03-08 02:08:01 +01:00
.prettierrc prototype of the deploys page using the inspect component 2024-02-25 14:52:10 +01:00
astro.config.mjs intial commit 2024-02-25 01:52:08 +01:00
docker-compose.yml fix: missing local ipv4 in docker-compose 2024-03-13 00:54:56 +01:00
Dockerfile chore: working dockerfile 2024-03-13 00:13:18 +01:00
package.json feat: dynamic latest logs in deploy page 2024-04-09 02:06:49 +02:00
pnpm-lock.yaml feat: dynamic latest logs in deploy page 2024-04-09 02:06:49 +02:00
README.md chore: updated readme 2024-03-13 01:04:40 +01:00
tsconfig.json feat: better deploys page and single deploy page 2024-03-28 00:58:30 +01:00

phCD

Continuous Deployment for PHC projects.

Development

# First install the dependencies
pnpm install

# Run the local server
pnpm dev

# Build all
pnpm build

Production Setup

Run the following command to bootstrap a phCD instance. As this service doesn't have auth for now, it's strongly recommended to publish only on a local ip like 127.0.0.1 and then access directly or via an ssh tunnel (something like ssh -L 8080:127.0.0.1:8080 server).

# Clone this repo
git clone https://git.phc.dm.unipi.it/phc/phcd

# Create config files and data folder
mkdir data.local
cp .env.sample .env
echo 'deploys: []' > config.yaml

# Build and start the container
docker compose up -d --build

# Then just do the following to start and stop
docker compose down
docker compose up -d

Updating

Just pull changes and update the docker image, then use the command from before to restart the main container.

git pull
docker compose up -d --build

TODO: Self-Updating

It should be possible to deploy itself using a git+dockerfile deployment. For now this is more complicated as this requires to stop itself and spawn a new docker container of itself.

Idea 1. Create another self-update.Dockerfile that also gets mounted /var/run/docker.sock, this new container will then run the previous commands [...] if we want the volume to be a folder this cannot be easily done

Configuration

Everything is stored in the config.yaml file. It can be updated directly or from the web interface.

This file contains a list of projects to deploy and the configuration for each one, here is an example

deploys:
  - name: project1
    url: https://github.com/username/project1
    ref: 
      type: branch
      value: main
    type: dockerfile
    options:
      ports: 
        - 80:8080
      volumes: 
        - /var/www/html:/var/www/html
  - name: project2
    url: ssh://example.org/username/project2.git
    ref:
      type: commit
      value: '1234567'
    type: docker-compose
    options:
      path: ./docker-compose.yml # already the default
  - name: project3
    url: https://github.com/username/project3
    type: shell
    options:
      path: ./deploy.sh # already the default

Schema of config.yaml

TODO