fix: secrets
This commit is contained in:
parent
29530f3b17
commit
47979bf16d
@ -148,13 +148,13 @@ import * as buildpacks from '../lib/buildPacks';
|
||||
(s) => s.name === secret.name && s.isPRMRSecret
|
||||
);
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
if (isSecretFound[0].value.includes('\\n')|| isSecretFound[0].value.includes("'")) {
|
||||
envs.push(`${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${isSecretFound[0].value}'`);
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
@ -162,7 +162,7 @@ import * as buildpacks from '../lib/buildPacks';
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
@ -718,13 +718,13 @@ import * as buildpacks from '../lib/buildPacks';
|
||||
(s) => s.name === secret.name && s.isPRMRSecret
|
||||
);
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
if (isSecretFound[0].value.includes('\\n') || isSecretFound[0].value.includes("'")) {
|
||||
envs.push(`${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${isSecretFound[0].value}'`);
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
@ -732,7 +732,7 @@ import * as buildpacks from '../lib/buildPacks';
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
|
@ -792,13 +792,13 @@ export async function buildCacheImageWithNode(data, imageForBuild) {
|
||||
if (pullmergeRequestId) {
|
||||
const isSecretFound = secrets.filter((s) => s.name === secret.name && s.isPRMRSecret);
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
if (isSecretFound[0].value.includes('\\n')|| isSecretFound[0].value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${isSecretFound[0].value}'`);
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
@ -806,7 +806,7 @@ export async function buildCacheImageWithNode(data, imageForBuild) {
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
@ -842,14 +842,14 @@ export async function buildCacheImageForLaravel(data, imageForBuild) {
|
||||
if (pullmergeRequestId) {
|
||||
const isSecretFound = secrets.filter(s => s.name === secret.name && s.isPRMRSecret)
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
if (isSecretFound[0].value.includes('\\n')|| isSecretFound[0].value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
|
||||
Dockerfile.push(`ARG ${secret.name}='${isSecretFound[0].value}'`);
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
@ -857,7 +857,7 @@ export async function buildCacheImageForLaravel(data, imageForBuild) {
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
|
@ -31,13 +31,13 @@ export default async function (data) {
|
||||
if (pullmergeRequestId) {
|
||||
const isSecretFound = secrets.filter((s) => s.name === secret.name && s.isPRMRSecret);
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
if (isSecretFound[0].value.includes('\\n')|| isSecretFound[0].value.includes("'")) {
|
||||
envs.push(`${secret.name}='${isSecretFound[0].value}'`);
|
||||
} else {
|
||||
envs.push(`${secret.name}=${isSecretFound[0].value}`);
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
@ -45,7 +45,7 @@ export default async function (data) {
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
|
@ -29,14 +29,14 @@ const createDockerfile = async (data, image): Promise<void> => {
|
||||
if (pullmergeRequestId) {
|
||||
const isSecretFound = secrets.filter(s => s.name === secret.name && s.isPRMRSecret)
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
if (isSecretFound[0].value.includes('\\n')|| isSecretFound[0].value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
|
||||
Dockerfile.push(`ARG ${secret.name}='${isSecretFound[0].value}'`);
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
@ -44,7 +44,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
|
@ -21,7 +21,7 @@ export default async function (data) {
|
||||
) {
|
||||
Dockerfile.forEach((line, index) => {
|
||||
if (line.startsWith('FROM')) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.splice(index + 1, 0, `ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.splice(index + 1, 0, `ARG ${secret.name}='${secret.value}'`);
|
||||
|
@ -29,13 +29,13 @@ const createDockerfile = async (data, image): Promise<void> => {
|
||||
if (pullmergeRequestId) {
|
||||
const isSecretFound = secrets.filter(s => s.name === secret.name && s.isPRMRSecret)
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
if (isSecretFound[0].value.includes('\\n')|| isSecretFound[0].value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${isSecretFound[0].value}'`);
|
||||
}
|
||||
} else {
|
||||
if (secrets.value.includes('\\n')) {
|
||||
if (secrets.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
@ -43,7 +43,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secrets.value.includes('\\n')) {
|
||||
if (secrets.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
|
@ -25,14 +25,14 @@ const createDockerfile = async (data, image): Promise<void> => {
|
||||
if (pullmergeRequestId) {
|
||||
const isSecretFound = secrets.filter(s => s.name === secret.name && s.isPRMRSecret)
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
if (isSecretFound[0].value.includes('\\n')|| isSecretFound[0].value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
|
||||
Dockerfile.push(`ARG ${secret.name}='${isSecretFound[0].value}'`);
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
@ -40,7 +40,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
|
@ -29,14 +29,14 @@ const createDockerfile = async (data, image): Promise<void> => {
|
||||
if (pullmergeRequestId) {
|
||||
const isSecretFound = secrets.filter(s => s.name === secret.name && s.isPRMRSecret)
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
if (isSecretFound[0].value.includes('\\n')|| isSecretFound[0].value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
|
||||
Dockerfile.push(`ARG ${secret.name}='${isSecretFound[0].value}'`);
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
@ -44,7 +44,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
|
@ -18,14 +18,14 @@ const createDockerfile = async (data, image, htaccessFound): Promise<void> => {
|
||||
if (pullmergeRequestId) {
|
||||
const isSecretFound = secrets.filter(s => s.name === secret.name && s.isPRMRSecret)
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
if (isSecretFound[0].value.includes('\\n')|| isSecretFound[0].value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
|
||||
Dockerfile.push(`ARG ${secret.name}='${isSecretFound[0].value}'`);
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
@ -33,7 +33,7 @@ const createDockerfile = async (data, image, htaccessFound): Promise<void> => {
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
|
@ -23,14 +23,14 @@ const createDockerfile = async (data, image): Promise<void> => {
|
||||
if (pullmergeRequestId) {
|
||||
const isSecretFound = secrets.filter(s => s.name === secret.name && s.isPRMRSecret)
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
if (isSecretFound[0].value.includes('\\n')|| isSecretFound[0].value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
|
||||
Dockerfile.push(`ARG ${secret.name}='${isSecretFound[0].value}'`);
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
@ -38,7 +38,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
|
@ -30,14 +30,14 @@ const createDockerfile = async (data, image): Promise<void> => {
|
||||
if (pullmergeRequestId) {
|
||||
const isSecretFound = secrets.filter(s => s.name === secret.name && s.isPRMRSecret)
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
if (isSecretFound[0].value.includes('\\n')|| isSecretFound[0].value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
|
||||
Dockerfile.push(`ARG ${secret.name}='${isSecretFound[0].value}'`);
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
@ -45,7 +45,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
Dockerfile.push(`ARG ${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
Dockerfile.push(`ARG ${secret.name}='${secret.value}'`);
|
||||
|
@ -468,14 +468,14 @@ export async function restartApplication(request: FastifyRequest<RestartApplicat
|
||||
if (pullmergeRequestId) {
|
||||
const isSecretFound = secrets.filter(s => s.name === secret.name && s.isPRMRSecret)
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
if (isSecretFound[0].value.includes('\\n')|| isSecretFound[0].value.includes("'")) {
|
||||
envs.push(`${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${isSecretFound[0].value}'`);
|
||||
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
@ -483,7 +483,7 @@ export async function restartApplication(request: FastifyRequest<RestartApplicat
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
@ -1182,13 +1182,13 @@ export async function restartPreview(request: FastifyRequest<RestartPreviewAppli
|
||||
if (pullmergeRequestId) {
|
||||
const isSecretFound = secrets.filter(s => s.name === secret.name && s.isPRMRSecret)
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
if (isSecretFound[0].value.includes('\\n')|| isSecretFound[0].value.includes("'")) {
|
||||
envs.push(`${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${isSecretFound[0].value}'`);
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
@ -1196,7 +1196,7 @@ export async function restartPreview(request: FastifyRequest<RestartPreviewAppli
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
|
@ -210,13 +210,13 @@ export const applicationsRouter = router({
|
||||
if (pullmergeRequestId) {
|
||||
const isSecretFound = secrets.filter((s) => s.name === secret.name && s.isPRMRSecret);
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
if (isSecretFound[0].value.includes('\\n') || isSecretFound[0].value.includes("'")) {
|
||||
envs.push(`${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${isSecretFound[0].value}'`);
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
@ -224,12 +224,12 @@ export const applicationsRouter = router({
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
if (secret.value.includes('\\n')|| secret.value.includes("'")) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user