chore: deploy styles

main
Antonio De Lucreziis 10 months ago
parent 90341a5cfa
commit 74eea2f97b

@ -1,2 +1,2 @@
DATA_PATH=./data.local DATA_PATH=./data.local
CONFIG_PATH=config.yaml CONFIG_PATH=./config.yaml

@ -15,6 +15,41 @@ $ pnpm dev
$ pnpm build $ pnpm build
``` ```
## Bootstrapping
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`).
```bash
$ git clone https://git.phc.dm.unipi.it/phc/phcd
$ docker built . -t phcd
$ echo 'deploys: []' > config.yaml
$ cp .env.sample .env
$ docker run -d \
--name phcd \
--restart unless-stopped \
-p 127.0.0.1:8080:4321 \
-v ./data.local:./data.local \
-v ./config.yaml:./config.yaml \
phcd
```
### Updating
```bash
$ git pull
$ docker stop phcd
$ docker built . -t phcd
$ docker run -d \
--name phcd \
--restart unless-stopped \
-p 127.0.0.1:8080:4321 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ./config.yaml:/app/config.yaml \
phcd
```
## Architecture ## Architecture
Everything is stored in the `config.yaml` file. This file contains a list of projects to deploy and the configuration for each one. Everything is stored in the `config.yaml` file. This file contains a list of projects to deploy and the configuration for each one.

@ -3,11 +3,11 @@
"type": "module", "type": "module",
"version": "0.0.1", "version": "0.0.1",
"scripts": { "scripts": {
"dev": "astro dev", "dev": "astro sync && astro dev",
"start": "astro dev", "lint": "astro check",
"build": "astro sync && astro check && astro build", "build": "astro build",
"preview": "astro preview", "preview": "astro preview",
"astro": "astro" "start": "node ./dist/server/entry.mjs",
}, },
"dependencies": { "dependencies": {
"@astrojs/check": "^0.5.6", "@astrojs/check": "^0.5.6",

@ -1,8 +1,30 @@
import { Value } from './Inspect.jsx' import { Value } from './Inspect.jsx'
// const GitRef = ({ type, value }) => {
// return type === 'default' ? (
// <div class="git-ref">default</div>
// ) : (
// <div class={'git-ref ' + type}>{value}</div>
// )
// }
// const BaseDeploy = ({ name, ...rest }) => <>
// <div class="name">{name}</div>
// <div class="url">
// <div class="material-symbols-outlined">commit</div>
// <div class="value">{url}</div>
// </div>
// <GitRef {...ref} />
// </>
export const Deploy = ({ deploy }) => { export const Deploy = ({ deploy }) => {
return ( return (
<div class="deploy"> <div class="deploy">
<div class="name">{deploy.name}</div>
<div class="type">{deploy.type}</div>
<div class="type">{deploy.type}</div>
<div class="type">{deploy.type}</div>
<Value value={deploy} borderless /> <Value value={deploy} borderless />
</div> </div>
) )

@ -7,7 +7,9 @@ import { Mutex } from 'async-mutex'
import { debug } from './logger' import { debug } from './logger'
export const GitRef = z.union([ export const GitRef = z.union([
z.object({ type: z.literal('default') }), z.object({
type: z.literal('default'),
}),
z.object({ z.object({
type: z.union([z.literal('branch'), z.literal('branch'), z.literal('branch')]), type: z.union([z.literal('branch'), z.literal('branch'), z.literal('branch')]),
value: z.string(), value: z.string(),

@ -297,9 +297,15 @@ form {
.deploy { .deploy {
width: 100%; width: 100%;
border: 1px solid #ddd; background: $accent-400;
padding: 1rem; padding: 1rem;
border-radius: 1rem; border-radius: 1rem;
display: grid;
// border: 1px solid #ddd;
// padding: 1rem;
// border-radius: 1rem;
} }
// //

Loading…
Cancel
Save