startBuild method

Future<String> startBuild({
  1. required String tag,
  2. required List<ContainerMountSpec> mounts,
  3. required String contextPath,
  4. String? dockerfilePath,
  5. bool private = false,
  6. List<DockerSecret> credentials = const [],
  7. String? contextArchivePath,
  8. String? contextArchiveRef,
  9. String? contextArchiveMountPath,
  10. String? contextArchiveArch,
})

Implementation

Future<String> startBuild({
  required String tag,
  required List<ContainerMountSpec> mounts,
  required String contextPath,
  String? dockerfilePath,
  bool private = false,
  List<DockerSecret> credentials = const [],
  String? contextArchivePath,
  String? contextArchiveRef,
  String? contextArchiveMountPath,
  String? contextArchiveArch,
}) async {
  final output = await room.invoke(
    toolkit: 'containers',
    tool: 'start_build',
    input: ToolContentInput(
      JsonContent(
        json: _buildRequestPayload(
          tag: tag,
          mounts: mounts,
          contextPath: contextPath,
          dockerfilePath: dockerfilePath,
          private: private,
          credentials: credentials,
          contextArchivePath: contextArchivePath,
          contextArchiveRef: contextArchiveRef,
          contextArchiveMountPath: contextArchiveMountPath,
          contextArchiveArch: contextArchiveArch,
        ),
      ),
    ),
  );
  if (output is! ToolContentOutput || output.content is! JsonContent) {
    throw _unexpectedResponseError(operation: 'start_build');
  }
  return (output.content as JsonContent).json['build_id'] as String;
}