Merge branch 'main' into exposePort

This commit is contained in:
Aaron Charcoal Styles
2022-04-08 18:48:16 +00:00
committed by GitHub
105 changed files with 2338 additions and 1208 deletions

View File

@@ -20,12 +20,9 @@ import {
setDefaultConfiguration
} from '$lib/buildPacks/common';
import yaml from 'js-yaml';
import type { ComposeFile } from '$lib/types/composeFile';
export default async function (job) {
/*
Edge cases:
1 - Change build pack and redeploy, what should happen?
*/
let {
id: applicationId,
repository,
@@ -276,7 +273,7 @@ export default async function (job) {
}
};
});
const compose = {
const composeFile: ComposeFile = {
version: '3.8',
services: {
[imageId]: {
@@ -285,8 +282,8 @@ export default async function (job) {
volumes,
env_file: envFound ? [`${workdir}/.env`] : [],
networks: [docker.network],
labels: labels,
ports: exposePort ? [`${exposePort}:${port}`] : [],
labels,
depends_on: [],
restart: 'always'
}
@@ -298,7 +295,7 @@ export default async function (job) {
},
volumes: Object.assign({}, ...composeVolumes)
};
await fs.writeFile(`${workdir}/docker-compose.yml`, yaml.dump(compose));
await fs.writeFile(`${workdir}/docker-compose.yml`, yaml.dump(composeFile));
await asyncExecShell(
`DOCKER_HOST=${host} docker compose --project-directory ${workdir} up -d`
);