feat: deploy specific commit for apps

feat: keep number of images locally to revert quickly
This commit is contained in:
Andras Bacsai
2022-11-29 11:47:20 +01:00
parent ec00548f1b
commit 028ee6d7b1
9 changed files with 117 additions and 23 deletions

View File

@@ -517,20 +517,28 @@
</div>
<div class="grid grid-cols-2 items-center">
<label for="repository">Git commit</label>
{#if isDisabled}
<div class="flex gap-2">
<input
class="w-full"
disabled={isDisabled || application.settings.isPublicRepository}
disabled={isDisabled}
placeholder="default: latest commit"
bind:value={application.gitCommitHash}
/>
{:else}
<input
class="w-full"
placeholder="default: latest commit"
bind:value={application.gitCommitHash}
/>
{/if}
<a href={application.gitSource.htmlUrl}/{application.repository}/commits/{application.branch} target="_blank" rel="noreferrer" class="btn btn-primary text-xs" >Commits<svg
xmlns="http://www.w3.org/2000/svg"
fill="currentColor"
viewBox="0 0 24 24"
stroke-width="3"
stroke="currentColor"
class="w-3 h-3 text-white ml-2"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M4.5 19.5l15-15m0 0H8.25m11.25 0v11.25"
/>
</svg></a>
</div>
</div>
<div class="grid grid-cols-2 items-center">
<label for="repository">{$t('application.git_repository')}</label>

View File

@@ -36,6 +36,7 @@
let maxPort = settings.maxPort;
let proxyDefaultRedirect = settings.proxyDefaultRedirect;
let doNotTrack = settings.doNotTrack;
let numberOfDockerImagesKeptLocally = settings.numberOfDockerImagesKeptLocally;
let forceSave = false;
let fqdn = settings.fqdn;
@@ -165,6 +166,9 @@
if (proxyDefaultRedirect !== settings.proxyDefaultRedirect) {
await post(`/settings`, { proxyDefaultRedirect });
}
if (numberOfDockerImagesKeptLocally !== settings.numberOfDockerImagesKeptLocally) {
await post(`/settings`, { numberOfDockerImagesKeptLocally });
}
if (minPort !== settings.minPort || maxPort !== settings.maxPort) {
await post(`/settings`, { minPort, maxPort });
settings.minPort = minPort;
@@ -393,6 +397,25 @@
on:click|preventDefault|stopPropagation={rollback}>Rollback</button
>
</div>
<div class="grid grid-cols-2 items-center">
<div>
Number of Docker Images kept locally
<Explainer
position="dropdown-bottom"
explanation="The number of Docker images kept locally on the server for EACH application. The oldest images will be deleted when the limit is reached.<br><br>Useful to rollback to a specific version of your applications quickly, but it will use more storage locally."
/>
</div>
<input
type="number"
class="w-full"
bind:value={numberOfDockerImagesKeptLocally}
readonly={!$appSession.isAdmin}
disabled={!$appSession.isAdmin}
name="numberOfDockerImagesKeptLocally"
id="numberOfDockerImagesKeptLocally"
placeholder="default: 3"
/>
</div>
<div class="grid grid-cols-2 items-center">
<div>
{$t('forms.public_port_range')}