chore: various things, preparing for mpv tasks

main
Antonio De Lucreziis 10 months ago
parent 6ee977d8c6
commit d4b49d9955

@ -29,7 +29,7 @@ export const Deploy = ({ deploy }) => {
<a href={`/deploys/${deploy.name}`}>{deploy.name}</a> <a href={`/deploys/${deploy.name}`}>{deploy.name}</a>
</div> </div>
<div class="shield">{deploy.type}</div> <div class="shield">{deploy.type}</div>
{deploy.type === 'docker' ? ( {deploy.type === 'docker-image' ? (
<div class="description">{deploy.options.image}</div> <div class="description">{deploy.options.image}</div>
) : ( ) : (
<> <>

@ -18,7 +18,7 @@ export const NewDeployForm = () => {
<option value="initial" disabled> <option value="initial" disabled>
Select a deploy type... Select a deploy type...
</option> </option>
<option value="docker">Docker</option> <option value="docker-image">Docker</option>
<option value="dockerfile">Dockerfile</option> <option value="dockerfile">Dockerfile</option>
<option value="docker-compose">Docker Compose</option> <option value="docker-compose">Docker Compose</option>
<option value="shell">Shell</option> <option value="shell">Shell</option>
@ -74,7 +74,7 @@ const DeployRefOptions = ({}) => {
const DeployOptions = ({ type }) => { const DeployOptions = ({ type }) => {
switch (type) { switch (type) {
case 'docker': case 'docker-image':
return <DockerDeploy /> return <DockerDeploy />
case 'dockerfile': case 'dockerfile':
return <DockerfileDeploy /> return <DockerfileDeploy />

@ -31,7 +31,7 @@ const DockerRunOptions = z.object({
export const DockerDeploy = z.object({ export const DockerDeploy = z.object({
name: z.string(), name: z.string(),
type: z.literal('docker'), type: z.literal('docker-image'),
options: DockerRunOptions.extend({ options: DockerRunOptions.extend({
image: z.string(), image: z.string(),
}), }),

@ -33,7 +33,7 @@ export function parseDeploy(form: Record<string, any>): Deploy {
const name = form['deploy-name'] const name = form['deploy-name']
const type = form['deploy-type'] const type = form['deploy-type']
if (type === 'docker') { if (type === 'docker-image') {
// const url = notEmpty(form['deploy-url'], 'must provide an url') // const url = notEmpty(form['deploy-url'], 'must provide an url')
const containerName = form['deploy-options-name'] as string const containerName = form['deploy-options-name'] as string
const image = notEmpty(form['deploy-options-image'], 'must provide an image name') const image = notEmpty(form['deploy-options-image'], 'must provide an image name')
@ -43,7 +43,7 @@ export function parseDeploy(form: Record<string, any>): Deploy {
return { return {
name, name,
type: 'docker', type: 'docker-image',
options: { options: {
image, image,
name: containerName, name: containerName,

@ -17,11 +17,15 @@ export const POST: APIRoute = async ({ request }) => {
const { deploys } = await loadConfig() const { deploys } = await loadConfig()
for (const deploy of deploys) { for (const deploy of deploys) {
if (deploy.type !== 'docker') { if (deploy.type !== 'docker-image') {
if (URLS.includes(normalizeURL(deploy.url))) { if (URLS.includes(normalizeURL(deploy.url))) {
debug(`[Webhook] Triggering deploy for "${deploy.url}"`) debug(`[Webhook] Triggering deploy for "${deploy.url}"`)
const [jobBase, deployFn] = createDeployJob(deploy, { event: 'webhook', url: deploy.url }) const [jobBase, deployFn] = createDeployJob(deploy, {
event: 'webhook',
url: deploy.url,
})
await enqueueJob(jobBase, deployFn) await enqueueJob(jobBase, deployFn)
} }
} }

Loading…
Cancel
Save