Skip to content

Commit e9723d3

Browse files
committed
fix: cleanup build cache as well
1 parent 6baec72 commit e9723d3

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

apps/api/src/lib/common.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,6 +1977,12 @@ export async function cleanupDockerStorage(dockerId, lowDiskSpace, force) {
19771977
} catch (error) {
19781978
//console.log(error);
19791979
}
1980+
// Cleanup build caches
1981+
try {
1982+
await executeDockerCmd({ dockerId, command: `docker builder prune -a -f` })
1983+
} catch (error) {
1984+
//console.log(error);
1985+
}
19801986
}
19811987
}
19821988

@@ -2022,3 +2028,27 @@ export function defaultComposeConfiguration(network: string): any {
20222028
}
20232029
}
20242030
}
2031+
export function decryptApplication(application: any) {
2032+
if (application) {
2033+
if (application?.gitSource?.githubApp?.clientSecret) {
2034+
application.gitSource.githubApp.clientSecret = decrypt(application.gitSource.githubApp.clientSecret) || null;
2035+
}
2036+
if (application?.gitSource?.githubApp?.webhookSecret) {
2037+
application.gitSource.githubApp.webhookSecret = decrypt(application.gitSource.githubApp.webhookSecret) || null;
2038+
}
2039+
if (application?.gitSource?.githubApp?.privateKey) {
2040+
application.gitSource.githubApp.privateKey = decrypt(application.gitSource.githubApp.privateKey) || null;
2041+
}
2042+
if (application?.gitSource?.gitlabApp?.appSecret) {
2043+
application.gitSource.gitlabApp.appSecret = decrypt(application.gitSource.gitlabApp.appSecret) || null;
2044+
}
2045+
if (application?.secrets.length > 0) {
2046+
application.secrets = application.secrets.map((s: any) => {
2047+
s.value = decrypt(s.value) || null
2048+
return s;
2049+
});
2050+
}
2051+
2052+
return application;
2053+
}
2054+
}

0 commit comments

Comments
 (0)