public void Dispose() { if (AttachLogFile) { if (fileSystem.FileExists(logPath)) { Log.NewOctopusArtifact(fileSystem.GetFullPath(logPath), fileSystem.GetFileName(logPath), fileSystem.GetFileSize(logPath)); } //When terraform crashes, the information would be contained in the crash.log file. We should attach this since //we don't want to blow that information away in case it provides something relevant https://www.terraform.io/docs/internals/debugging.html#interpreting-a-crash-log if (fileSystem.FileExists(crashLogPath)) { Log.NewOctopusArtifact(fileSystem.GetFullPath(crashLogPath), fileSystem.GetFileName(crashLogPath), fileSystem.GetFileSize(crashLogPath)); } } }
public void Dispose() { var attachLogFile = variables.GetFlag(TerraformSpecialVariables.Action.Terraform.AttachLogFile); if (attachLogFile) { var crashLogPath = Path.Combine(deployment.CurrentDirectory, "crash.log"); if (fileSystem.FileExists(logPath)) { log.NewOctopusArtifact(fileSystem.GetFullPath(logPath), fileSystem.GetFileName(logPath), fileSystem.GetFileSize(logPath)); } //When terraform crashes, the information would be contained in the crash.log file. We should attach this since //we don't want to blow that information away in case it provides something relevant https://www.terraform.io/docs/internals/debugging.html#interpreting-a-crash-log if (fileSystem.FileExists(crashLogPath)) { log.NewOctopusArtifact(fileSystem.GetFullPath(crashLogPath), fileSystem.GetFileName(crashLogPath), fileSystem.GetFileSize(crashLogPath)); } } }
private static Func <string> GetBucketKey(ICalamariFileSystem fileSystem, string filePath, IHaveBucketKeyBehaviour behaviour) { switch (behaviour.BucketKeyBehaviour) { case BucketKeyBehaviourType.Custom: return(() => behaviour.BucketKey); case BucketKeyBehaviourType.Filename: return(() => $"{behaviour.BucketKeyPrefix}{fileSystem.GetFileName(filePath)}"); default: throw new NotImplementedException(); } }