MCPcopy Index your code
hub / github.com/Dokploy/dokploy / deployLibsql

Function deployLibsql

packages/server/src/services/libsql.ts:130–167  ·  view source on GitHub ↗
(
	libsqlId: string,
	onData?: (data: any) => void,
)

Source from the content-addressed store, hash-verified

128};
129
130export const deployLibsql = async (
131 libsqlId: string,
132 onData?: (data: any) => void,
133) => {
134 const libsql = await findLibsqlById(libsqlId);
135 try {
136 await updateLibsqlById(libsqlId, {
137 applicationStatus: "running",
138 });
139 onData?.("Starting libsql deployment...");
140 if (libsql.serverId) {
141 await execAsyncRemote(
142 libsql.serverId,
143 `docker pull ${libsql.dockerImage}`,
144 onData,
145 );
146 } else {
147 await pullImage(libsql.dockerImage, onData);
148 }
149
150 await buildLibsql(libsql);
151 await updateLibsqlById(libsqlId, {
152 applicationStatus: "done",
153 });
154 onData?.("Deployment completed successfully!");
155 } catch (error) {
156 onData?.(`Error: ${error}`);
157 await updateLibsqlById(libsqlId, {
158 applicationStatus: "error",
159 });
160
161 throw new TRPCError({
162 code: "INTERNAL_SERVER_ERROR",
163 message: `Error on deploy libsql${error}`,
164 });
165 }
166 return libsql;
167};

Callers 2

rebuildDatabaseFunction · 0.90
libsql.tsFile · 0.90

Calls 6

execAsyncRemoteFunction · 0.90
pullImageFunction · 0.90
buildLibsqlFunction · 0.90
findLibsqlByIdFunction · 0.85
updateLibsqlByIdFunction · 0.85
onDataFunction · 0.50

Tested by

no test coverage detected