feature: initial support for specific git commit

This commit is contained in:
ThallesP
2022-10-25 13:26:03 -03:00
parent 1d93658e56
commit dfd29dc37a
10 changed files with 209 additions and 70 deletions

View File

@@ -60,6 +60,7 @@ import * as buildpacks from '../lib/buildPacks';
gitSource,
configHash,
fqdn,
gitCommitHash,
projectId,
secrets,
phpModules,
@@ -160,6 +161,8 @@ import * as buildpacks from '../lib/buildPacks';
githubAppId: gitSource.githubApp?.id,
gitlabAppId: gitSource.gitlabApp?.id,
customPort: gitSource.customPort,
gitCommitHash: gitCommitHash,
configuration,
repository,
branch,
buildId,

View File

@@ -9,6 +9,7 @@ export default async function ({
githubAppId,
repository,
apiUrl,
gitCommitHash,
htmlUrl,
branch,
buildId,
@@ -20,6 +21,7 @@ export default async function ({
githubAppId: string;
repository: string;
apiUrl: string;
gitCommitHash?: string;
htmlUrl: string;
branch: string;
buildId: string;
@@ -36,7 +38,7 @@ export default async function ({
applicationId
});
await asyncExecShell(
`git clone -q -b ${branch} https://${url}/${repository}.git ${workdir}/ && cd ${workdir} && git submodule update --init --recursive && git lfs pull && cd .. `
`git clone -q -b ${branch} https://${url}/${repository}.git ${workdir}/ && cd ${workdir} && git checkout ${gitCommitHash} && git submodule update --init --recursive && git lfs pull && cd .. `
);
} else {

View File

@@ -327,6 +327,7 @@ export async function saveApplication(request: FastifyRequest<SaveApplication>,
dockerFileLocation,
denoMainFile,
denoOptions,
gitCommitHash,
baseImage,
baseBuildImage,
deploymentType,
@@ -365,6 +366,7 @@ export async function saveApplication(request: FastifyRequest<SaveApplication>,
pythonVariable,
denoOptions,
baseImage,
gitCommitHash,
baseBuildImage,
deploymentType,
dockerComposeFile,
@@ -383,6 +385,7 @@ export async function saveApplication(request: FastifyRequest<SaveApplication>,
exposePort,
pythonWSGI,
pythonModule,
gitCommitHash,
pythonVariable,
denoOptions,
baseImage,

View File

@@ -19,6 +19,7 @@ export interface SaveApplication extends OnlyId {
denoMainFile: string,
denoOptions: string,
baseImage: string,
gitCommitHash: string,
baseBuildImage: string,
deploymentType: string,
baseDatabaseBranch: string,