chore: various things, preparing for mpv tasks
This commit is contained in:
@@ -29,7 +29,7 @@ export const Deploy = ({ deploy }) => {
|
||||
<a href={`/deploys/${deploy.name}`}>{deploy.name}</a>
|
||||
</div>
|
||||
<div class="shield">{deploy.type}</div>
|
||||
{deploy.type === 'docker' ? (
|
||||
{deploy.type === 'docker-image' ? (
|
||||
<div class="description">{deploy.options.image}</div>
|
||||
) : (
|
||||
<>
|
||||
|
||||
@@ -18,7 +18,7 @@ export const NewDeployForm = () => {
|
||||
<option value="initial" disabled>
|
||||
Select a deploy type...
|
||||
</option>
|
||||
<option value="docker">Docker</option>
|
||||
<option value="docker-image">Docker</option>
|
||||
<option value="dockerfile">Dockerfile</option>
|
||||
<option value="docker-compose">Docker Compose</option>
|
||||
<option value="shell">Shell</option>
|
||||
@@ -74,7 +74,7 @@ const DeployRefOptions = ({}) => {
|
||||
|
||||
const DeployOptions = ({ type }) => {
|
||||
switch (type) {
|
||||
case 'docker':
|
||||
case 'docker-image':
|
||||
return <DockerDeploy />
|
||||
case 'dockerfile':
|
||||
return <DockerfileDeploy />
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ const DockerRunOptions = z.object({
|
||||
|
||||
export const DockerDeploy = z.object({
|
||||
name: z.string(),
|
||||
type: z.literal('docker'),
|
||||
type: z.literal('docker-image'),
|
||||
options: DockerRunOptions.extend({
|
||||
image: z.string(),
|
||||
}),
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@ export function parseDeploy(form: Record<string, any>): Deploy {
|
||||
const name = form['deploy-name']
|
||||
const type = form['deploy-type']
|
||||
|
||||
if (type === 'docker') {
|
||||
if (type === 'docker-image') {
|
||||
// const url = notEmpty(form['deploy-url'], 'must provide an url')
|
||||
const containerName = form['deploy-options-name'] as string
|
||||
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 {
|
||||
name,
|
||||
type: 'docker',
|
||||
type: 'docker-image',
|
||||
options: {
|
||||
image,
|
||||
name: containerName,
|
||||
|
||||
@@ -17,11 +17,15 @@ export const POST: APIRoute = async ({ request }) => {
|
||||
const { deploys } = await loadConfig()
|
||||
|
||||
for (const deploy of deploys) {
|
||||
if (deploy.type !== 'docker') {
|
||||
if (deploy.type !== 'docker-image') {
|
||||
if (URLS.includes(normalizeURL(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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user