diff --git a/osx/installerplugins/installerplugins.xcodeproj/project.pbxproj b/osx/installerplugins/installerplugins.xcodeproj/project.pbxproj index 3e16fc9859..4708ce2aa1 100644 --- a/osx/installerplugins/installerplugins.xcodeproj/project.pbxproj +++ b/osx/installerplugins/installerplugins.xcodeproj/project.pbxproj @@ -7,14 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 1B4C91481B8500A700A06068 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1B4C91461B8500A700A06068 /* InfoPlist.strings */; }; - 1B4C914B1B8500A700A06068 /* managevmpluginPane.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B4C914A1B8500A700A06068 /* managevmpluginPane.m */; }; - 1B4C914E1B8500A700A06068 /* managevmplugin.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1B4C914C1B8500A700A06068 /* managevmplugin.xib */; }; - 1B4C91511B8500A700A06068 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1B4C914F1B8500A700A06068 /* Localizable.strings */; }; - 1B4C91531B8500A700A06068 /* InstallerSections.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1B4C91521B8500A700A06068 /* InstallerSections.plist */; }; - 1B4C915A1B8500BB00A06068 /* toolboxcheck.png in Resources */ = {isa = PBXBuildFile; fileRef = 1B4C91571B8500BB00A06068 /* toolboxcheck.png */; }; - 1B4C915B1B8500BB00A06068 /* boot2docker.png in Resources */ = {isa = PBXBuildFile; fileRef = 1B4C91581B8500BB00A06068 /* boot2docker.png */; }; - 1B4C915C1B8500BB00A06068 /* toolbox.png in Resources */ = {isa = PBXBuildFile; fileRef = 1B4C91591B8500BB00A06068 /* toolbox.png */; }; 1B4C91B91B85198100A06068 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1B4C91B71B85198100A06068 /* InfoPlist.strings */; }; 1B4C91BC1B85198100A06068 /* quickstartpluginPane.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B4C91BB1B85198100A06068 /* quickstartpluginPane.m */; }; 1B4C91BF1B85198100A06068 /* quickstartplugin.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1B4C91BD1B85198100A06068 /* quickstartplugin.xib */; }; @@ -31,17 +23,6 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 1B4C91421B8500A700A06068 /* managevmplugin.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = managevmplugin.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; - 1B4C91451B8500A700A06068 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 1B4C91471B8500A700A06068 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 1B4C91491B8500A700A06068 /* managevmpluginPane.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = managevmpluginPane.h; sourceTree = ""; }; - 1B4C914A1B8500A700A06068 /* managevmpluginPane.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = managevmpluginPane.m; sourceTree = ""; }; - 1B4C914D1B8500A700A06068 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/managevmplugin.xib; sourceTree = ""; }; - 1B4C91501B8500A700A06068 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; - 1B4C91521B8500A700A06068 /* InstallerSections.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = InstallerSections.plist; sourceTree = ""; }; - 1B4C91571B8500BB00A06068 /* toolboxcheck.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = toolboxcheck.png; sourceTree = ""; }; - 1B4C91581B8500BB00A06068 /* boot2docker.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = boot2docker.png; sourceTree = ""; }; - 1B4C91591B8500BB00A06068 /* toolbox.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = toolbox.png; sourceTree = ""; }; 1B4C915E1B85023200A06068 /* mixpanel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mixpanel.h; path = common/mixpanel.h; sourceTree = ""; }; 1B4C91B31B85198100A06068 /* quickstartplugin.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = quickstartplugin.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 1B4C91B61B85198100A06068 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -65,13 +46,6 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 1B4C913F1B8500A700A06068 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 1B4C91B01B85198100A06068 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -93,40 +67,13 @@ isa = PBXGroup; children = ( 1BF102BB1B8BDEDA00FCB650 /* overviewplugin.bundle */, - 1B4C91421B8500A700A06068 /* managevmplugin.bundle */, 1B4C91B31B85198100A06068 /* quickstartplugin.bundle */, 1BF102BC1B8BDEDA00FCB650 /* overviewplugin */, - 1B4C91431B8500A700A06068 /* managevmplugin */, 1B4C91B41B85198100A06068 /* quickstartplugin */, 1B4C915D1B85021200A06068 /* common */, ); sourceTree = ""; }; - 1B4C91431B8500A700A06068 /* managevmplugin */ = { - isa = PBXGroup; - children = ( - 1B4C91571B8500BB00A06068 /* toolboxcheck.png */, - 1B4C91581B8500BB00A06068 /* boot2docker.png */, - 1B4C91591B8500BB00A06068 /* toolbox.png */, - 1B4C91491B8500A700A06068 /* managevmpluginPane.h */, - 1B4C914A1B8500A700A06068 /* managevmpluginPane.m */, - 1B4C914C1B8500A700A06068 /* managevmplugin.xib */, - 1B4C914F1B8500A700A06068 /* Localizable.strings */, - 1B4C91521B8500A700A06068 /* InstallerSections.plist */, - 1B4C91441B8500A700A06068 /* Supporting Files */, - ); - path = managevmplugin; - sourceTree = ""; - }; - 1B4C91441B8500A700A06068 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 1B4C91451B8500A700A06068 /* Info.plist */, - 1B4C91461B8500A700A06068 /* InfoPlist.strings */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; 1B4C915D1B85021200A06068 /* common */ = { isa = PBXGroup; children = ( @@ -185,23 +132,6 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 1B4C91411B8500A700A06068 /* managevmplugin */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1B4C91541B8500A700A06068 /* Build configuration list for PBXNativeTarget "managevmplugin" */; - buildPhases = ( - 1B4C913E1B8500A700A06068 /* Sources */, - 1B4C913F1B8500A700A06068 /* Frameworks */, - 1B4C91401B8500A700A06068 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = managevmplugin; - productName = managevmplugin; - productReference = 1B4C91421B8500A700A06068 /* managevmplugin.bundle */; - productType = "com.apple.product-type.bundle"; - }; 1B4C91B21B85198100A06068 /* quickstartplugin */ = { isa = PBXNativeTarget; buildConfigurationList = 1B4C91C51B85198100A06068 /* Build configuration list for PBXNativeTarget "quickstartplugin" */; @@ -245,9 +175,6 @@ LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Docker Inc"; TargetAttributes = { - 1B4C91411B8500A700A06068 = { - CreatedOnToolsVersion = 6.4; - }; 1B4C91B21B85198100A06068 = { CreatedOnToolsVersion = 6.4; }; @@ -269,7 +196,6 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 1B4C91411B8500A700A06068 /* managevmplugin */, 1B4C91B21B85198100A06068 /* quickstartplugin */, 1BF102BA1B8BDEDA00FCB650 /* overviewplugin */, ); @@ -277,20 +203,6 @@ /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 1B4C91401B8500A700A06068 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1B4C915C1B8500BB00A06068 /* toolbox.png in Resources */, - 1B4C914E1B8500A700A06068 /* managevmplugin.xib in Resources */, - 1B4C91511B8500A700A06068 /* Localizable.strings in Resources */, - 1B4C915B1B8500BB00A06068 /* boot2docker.png in Resources */, - 1B4C91481B8500A700A06068 /* InfoPlist.strings in Resources */, - 1B4C915A1B8500BB00A06068 /* toolboxcheck.png in Resources */, - 1B4C91531B8500A700A06068 /* InstallerSections.plist in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 1B4C91B11B85198100A06068 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -319,14 +231,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 1B4C913E1B8500A700A06068 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1B4C914B1B8500A700A06068 /* managevmpluginPane.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 1B4C91AF1B85198100A06068 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -346,30 +250,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ - 1B4C91461B8500A700A06068 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 1B4C91471B8500A700A06068 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - 1B4C914C1B8500A700A06068 /* managevmplugin.xib */ = { - isa = PBXVariantGroup; - children = ( - 1B4C914D1B8500A700A06068 /* Base */, - ); - name = managevmplugin.xib; - sourceTree = ""; - }; - 1B4C914F1B8500A700A06068 /* Localizable.strings */ = { - isa = PBXVariantGroup; - children = ( - 1B4C91501B8500A700A06068 /* en */, - ); - name = Localizable.strings; - sourceTree = ""; - }; 1B4C91B71B85198100A06068 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( @@ -501,38 +381,6 @@ }; name = Release; }; - 1B4C91551B8500A700A06068 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)/../mpkg/Plugins"; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = managevmplugin/Info.plist; - INSTALL_PATH = "$(HOME)/Library/Bundles"; - PRODUCT_BUNDLE_IDENTIFIER = "com.docker.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = bundle; - }; - name = Debug; - }; - 1B4C91561B8500A700A06068 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)/../mpkg/Plugins"; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = managevmplugin/Info.plist; - INSTALL_PATH = "$(HOME)/Library/Bundles"; - PRODUCT_BUNDLE_IDENTIFIER = "com.docker.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = bundle; - }; - name = Release; - }; 1B4C91C61B85198100A06068 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -607,15 +455,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 1B4C91541B8500A700A06068 /* Build configuration list for PBXNativeTarget "managevmplugin" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1B4C91551B8500A700A06068 /* Debug */, - 1B4C91561B8500A700A06068 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 1B4C91C51B85198100A06068 /* Build configuration list for PBXNativeTarget "quickstartplugin" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/osx/installerplugins/managevmplugin/Base.lproj/managevmplugin.xib b/osx/installerplugins/managevmplugin/Base.lproj/managevmplugin.xib deleted file mode 100644 index 4f472ca20c..0000000000 --- a/osx/installerplugins/managevmplugin/Base.lproj/managevmplugin.xib +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osx/installerplugins/managevmplugin/Info.plist b/osx/installerplugins/managevmplugin/Info.plist deleted file mode 100644 index 216ca414b8..0000000000 --- a/osx/installerplugins/managevmplugin/Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - Installer Version - %INSTALLER_VERSION% - InstallerSectionTitle - VM Migration - Mixpanel Token - %MIXPANEL_TOKEN% - NSHumanReadableCopyright - Copyright © 2015 Docker Inc. All rights reserved. - NSMainNibFile - managevmplugin - NSPrincipalClass - InstallerSection - - diff --git a/osx/installerplugins/managevmplugin/InstallerSections.plist b/osx/installerplugins/managevmplugin/InstallerSections.plist deleted file mode 100644 index 9b0ee1d807..0000000000 --- a/osx/installerplugins/managevmplugin/InstallerSections.plist +++ /dev/null @@ -1,16 +0,0 @@ - - - - - SectionOrder - - Introduction - ReadMe - License - managevmplugin.bundle - Target - PackageSelection - Install - - - diff --git a/osx/installerplugins/managevmplugin/boot2docker.png b/osx/installerplugins/managevmplugin/boot2docker.png deleted file mode 100644 index afb01dff8d..0000000000 Binary files a/osx/installerplugins/managevmplugin/boot2docker.png and /dev/null differ diff --git a/osx/installerplugins/managevmplugin/en.lproj/InfoPlist.strings b/osx/installerplugins/managevmplugin/en.lproj/InfoPlist.strings deleted file mode 100644 index 42043511ee..0000000000 --- a/osx/installerplugins/managevmplugin/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -InstallerSectionTitle = "VM Migration"; - diff --git a/osx/installerplugins/managevmplugin/en.lproj/Localizable.strings b/osx/installerplugins/managevmplugin/en.lproj/Localizable.strings deleted file mode 100644 index f53ffaaa4f..0000000000 --- a/osx/installerplugins/managevmplugin/en.lproj/Localizable.strings +++ /dev/null @@ -1,3 +0,0 @@ -/* Localized versions of Info.plist keys */ - -"PaneTitle" = "VM Migration"; \ No newline at end of file diff --git a/osx/installerplugins/managevmplugin/managevmpluginPane.h b/osx/installerplugins/managevmplugin/managevmpluginPane.h deleted file mode 100644 index 5155fc4f07..0000000000 --- a/osx/installerplugins/managevmplugin/managevmpluginPane.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// managevmpluginPane.h -// managevmplugin -// -// Created by Jeffrey Dean Morgan on 8/19/15. -// Copyright (c) 2015 Docker Inc. All rights reserved. -// - -#import - -@interface managevmpluginPane : InstallerPane - -@property (weak) IBOutlet NSImageView *statusImage; -@property (weak) IBOutlet NSButton *migrateCheckbox; -@property (weak) IBOutlet NSTextField *migrateExtraLabel; -@property (weak) IBOutlet NSProgressIndicator *migrationProgress; -@property (weak) IBOutlet NSTextField *migrationStatusLabel; -@property (unsafe_unretained) IBOutlet NSTextView *migrationLogsTextView; -@property (weak) IBOutlet NSScrollView *migrationLogsScrollView; -@property (weak) IBOutlet NSButton *submitButton; - -- (IBAction)submitButtonClicked:(id)sender; - -@end diff --git a/osx/installerplugins/managevmplugin/managevmpluginPane.m b/osx/installerplugins/managevmplugin/managevmpluginPane.m deleted file mode 100644 index 0dd51605c0..0000000000 --- a/osx/installerplugins/managevmplugin/managevmpluginPane.m +++ /dev/null @@ -1,293 +0,0 @@ -// -// managevmpluginPane.m -// managevmplugin -// -// Created by Jeffrey Dean Morgan on 8/19/15. -// Copyright (c) 2015 Docker Inc. All rights reserved. -// - -#import "managevmpluginPane.h" -#import "mixpanel.h" - -@interface managevmpluginPane() -@property BOOL upgrading; -@property BOOL locked; -@property BOOL successful; -@end - -@implementation managevmpluginPane - -NSString *vBoxManagePath = @"/Applications/VirtualBox.app/Contents/MacOS/VBoxManage"; -NSString *dockerMachinePath = @"/usr/local/bin/docker-machine"; - -- (BOOL) vmExists:(NSString*)name { - NSTask* task = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/sudo" arguments:[NSArray arrayWithObjects:@"-i", @"-u", NSUserName(), vBoxManagePath, @"showvminfo", name, nil]]; - [task waitUntilExit]; - return [task terminationStatus] != 1; -} - -- (NSString *) boot2dockerISOVersionAtPath:(NSString*)path { - NSTask* task = [[NSTask alloc] init]; - task.arguments = [NSArray arrayWithObjects:path, nil]; - task.launchPath = @"/usr/bin/file"; - - NSPipe * out = [NSPipe pipe]; - [task setStandardOutput:out]; - [task launch]; - [task waitUntilExit]; - - if (task.terminationStatus != 0) { - return nil; - } - - NSFileHandle * read = [out fileHandleForReading]; - NSData * dataRead = [read readDataToEndOfFile]; - NSString * stringRead = [[NSString alloc] initWithData:dataRead encoding:NSUTF8StringEncoding]; - - NSCharacterSet *delimiters = [NSCharacterSet characterSetWithCharactersInString:@"v'"]; - NSArray *splitString = [stringRead componentsSeparatedByCharactersInSet:delimiters]; - - if (splitString.count < 3) { - return nil; - } - - NSString *version = [[splitString objectAtIndex:2] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; - return version; -} - -- (BOOL) canMigrateBoot2DockerVM { - // VirtualBox and Docker Machine exist - if (![[NSFileManager defaultManager] fileExistsAtPath:vBoxManagePath] || ![[NSFileManager defaultManager] fileExistsAtPath:dockerMachinePath]) { - return NO; - } - - // Boot2Docker certs exist - if (![[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/.boot2docker/certs/boot2docker-vm/ca.pem", NSHomeDirectory()]] || - ![[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/.boot2docker/certs/boot2docker-vm/cert.pem", NSHomeDirectory()]] || - ![[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/.boot2docker/certs/boot2docker-vm/key.pem", NSHomeDirectory()]]) { - return NO; - } - - // Boot2Docker ssh keys exist - if (![[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/.ssh/id_boot2docker", NSHomeDirectory()]] || - ![[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/.ssh/id_boot2docker.pub", NSHomeDirectory()]]) { - return NO; - } - - if (![self vmExists:@"boot2docker-vm"] || [self vmExists:@"default"]) { - return NO; - } - return YES; -} - -- (BOOL) canUpgradeBoot2DockerVM { - // VirtualBox and Docker Machine exist - if (![[NSFileManager defaultManager] fileExistsAtPath:vBoxManagePath] || ![[NSFileManager defaultManager] fileExistsAtPath:dockerMachinePath]) { - return NO; - } - - // docker-machine path and VirtualBox VM exist - if (![self vmExists:@"default"] || - ![[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/.docker/machine/machines/default", NSHomeDirectory()]] || - ![[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/.docker/machine/machines/default/boot2docker.iso", NSHomeDirectory()]]) { - return NO; - } - - NSString *incomingVersion = [self boot2dockerISOVersionAtPath:[NSString stringWithFormat:@"%@/.docker/machine/cache/boot2docker.iso", NSHomeDirectory()]]; - NSString *existingVersion = [self boot2dockerISOVersionAtPath:[NSString stringWithFormat:@"%@/.docker/machine/machines/default/boot2docker.iso", NSHomeDirectory()]]; - - return incomingVersion != existingVersion && [incomingVersion compare:existingVersion options:NSNumericSearch] != NSOrderedAscending; -} - -- (void) migrateBoot2DockerVM { - self.locked = YES; - - // Remove existing vm if it exists - NSTask* removeVMTask = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/sudo" arguments:[NSArray arrayWithObjects:@"-i", @"-u", NSUserName(), dockerMachinePath, @"rm", @"-f", @"default", nil]]; - [removeVMTask waitUntilExit]; - - // Remove the VM dir in case there's anything left over - NSTask* removeDirTask = [NSTask launchedTaskWithLaunchPath:@"/bin/rm" arguments:[NSArray arrayWithObjects:@"-rf", [NSString stringWithFormat:@"%@/.docker/machine/machines/default", NSHomeDirectory()], nil]]; - [removeDirTask waitUntilExit]; - - // Do the migration - NSTask* migrateTask = [[NSTask alloc] init]; - migrateTask.launchPath = @"/usr/bin/sudo"; - migrateTask.arguments = [NSArray arrayWithObjects:@"-i", @"-u", NSUserName(), dockerMachinePath, @"-D", @"create", @"-d", @"virtualbox", @"--virtualbox-memory", @"2048", @"--virtualbox-import-boot2docker-vm", @"boot2docker-vm", @"default", nil]; - - - [self runTask:migrateTask onFinish:^void (int status) { - self.nextEnabled = YES; - self.statusImage.hidden = YES; - [self.migrationProgress stopAnimation:self]; - self.migrationProgress.hidden = YES; - - self.migrationStatusLabel.hidden = NO; - self.statusImage.hidden = NO; - - if (status == 0) { - self.successful = YES; - self.migrationStatusLabel.stringValue = @"Your Boot2Docker VM was successfully migrated to a Docker Machine VM named \"default\"."; - self.statusImage.image = [[NSImage alloc]initWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"toolboxcheck" ofType:@"png"]]; - [Mixpanel trackEvent:@"Boot2Docker Migration Succeeded" forPane:self]; - [self gotoNextPane]; - } else { - self.migrationLogsScrollView.hidden = NO; - self.submitButton.hidden = NO; - [Mixpanel trackEvent:@"Boot2Docker Migration Failed" forPane:self]; - self.migrationStatusLabel.hidden = NO; - self.migrationStatusLabel.stringValue = @"Creating the VM failed. Following the install, try creating a vm manually via docker-machine."; - } - - }]; -} - -- (void) upgradeBoot2DockerVM { - self.locked = YES; - - // Do the migration - NSTask* task = [[NSTask alloc] init]; - task.launchPath = @"/usr/bin/sudo"; - task.arguments = [NSArray arrayWithObjects:@"-i", @"-u", NSUserName(), [NSString stringWithFormat:@"%@ -D stop default; cp %@/.docker/machine/cache/boot2docker.iso %@/.docker/machine/machines/default/boot2docker.iso", dockerMachinePath, NSHomeDirectory(), NSHomeDirectory()], nil]; - - [self runTask:task onFinish:^void (int status) { - self.nextEnabled = YES; - self.statusImage.hidden = YES; - [self.migrationProgress stopAnimation:self]; - self.migrationProgress.hidden = YES; - - self.migrationStatusLabel.hidden = NO; - self.statusImage.hidden = NO; - - if (status == 0) { - self.successful = YES; - self.migrationStatusLabel.stringValue = @"Your VirtualBox Docker VM named \"default\" was successfully upgraded."; - self.statusImage.image = [[NSImage alloc]initWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"toolboxcheck" ofType:@"png"]]; - [Mixpanel trackEvent:@"VM Upgrade Succeeded" forPane:self]; - [self gotoNextPane]; - } else { - self.migrationLogsScrollView.hidden = NO; - self.submitButton.hidden = NO; - [Mixpanel trackEvent:@"VM Upgrade Failed" forPane:self]; - self.migrationStatusLabel.hidden = NO; - self.migrationStatusLabel.stringValue = @"Upgrading your VirtualBox Docker VM Failed. Try upgrading again manually via the docker-machine command."; - } - - }]; -} - -- (void) runTask:(NSTask *)task onFinish:(void (^)(int))finish { - // Remove certificates, ssh keys from logs - NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"BEGIN.*END" options:NSRegularExpressionDotMatchesLineSeparators error:NULL]; - NSFont *font = [NSFont fontWithName:@"Menlo" size:10.0]; - NSDictionary *attrsDictionary = [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName]; - NSMutableData* fullData = [[NSMutableData alloc] init]; - - void (^appendOutput)(NSFileHandle*) = ^(NSFileHandle *file) { - NSData *data = [file availableData]; - [fullData appendData:data]; - NSMutableString *str = [[NSMutableString alloc] initWithData:fullData encoding:NSUTF8StringEncoding]; - [regex replaceMatchesInString:str options:0 range:NSMakeRange(0, [str length]) withTemplate:@""]; - - dispatch_async(dispatch_get_main_queue(), ^{ - [self.migrationLogsTextView.textStorage setAttributedString:[[NSAttributedString alloc] initWithString:str attributes:attrsDictionary]]; - [self.migrationLogsTextView scrollRangeToVisible:NSMakeRange([[self.migrationLogsTextView string] length], 0)]; - }); - }; - - task.standardOutput = [NSPipe pipe]; - task.standardError = [NSPipe pipe]; - - [[task.standardOutput fileHandleForReading] setReadabilityHandler:appendOutput]; - [[task.standardError fileHandleForReading] setReadabilityHandler:appendOutput]; - - task.terminationHandler = ^(NSTask* task) { - dispatch_async(dispatch_get_main_queue(), ^{ - [task.standardOutput fileHandleForReading].readabilityHandler = nil; - finish(task.terminationStatus); - }); - }; - - [task launch]; -} - -- (id) init { - self.upgrading = NO; - self.successful = NO; - self = [super init]; - return self; -} - -- (NSString *)title { - return [[NSBundle bundleForClass:[self class]] localizedStringForKey:@"PaneTitle" value:nil table:nil]; -} - -- (void) didEnterPane:(InstallerSectionDirection)dir { - [Mixpanel trackEvent:@"Installing Files Succeeded" forPane:self]; - self.previousEnabled = NO; - - NSImage *toolboxImage = [[NSImage alloc]initWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"toolbox" ofType:@"png"]]; - NSImage *boot2dockerImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"boot2docker" ofType:@"png"]]; - - [self.migrationProgress startAnimation:self]; - - if ([self canUpgradeBoot2DockerVM]) { - self.migrateCheckbox.title = [NSString stringWithFormat:@"Upgrade your Docker Toolbox VM to Docker %@", [self boot2dockerISOVersionAtPath:[NSString stringWithFormat:@"%@/.docker/machine/cache/boot2docker.iso", NSHomeDirectory()]]] ; - self.migrateExtraLabel.stringValue = @"Your existing Docker Toolbox VM will not be affected. This should take about a minute."; - self.statusImage.image = toolboxImage; - self.upgrading = YES; - } /*else if ([self canMigrateBoot2DockerVM]) { - self.statusImage.image = boot2dockerImage; - }*/ else { - [self gotoNextPane]; - } - - self.statusImage.hidden = NO; - self.migrateCheckbox.hidden = NO; - self.migrateCheckbox.enabled = YES; - self.migrateExtraLabel.hidden = NO; - self.migrationProgress.hidden = YES; - [self.migrationProgress stopAnimation:self]; -} - -- (BOOL) shouldExitPane:(InstallerSectionDirection)dir { - if (dir != InstallerDirectionForward) { - return YES; - } - - if (self.migrateCheckbox.enabled && self.migrateCheckbox.state == NSOnState) { - self.nextEnabled = false; - self.migrationProgress.hidden = NO; - self.migrationStatusLabel.hidden = NO; - self.migrateCheckbox.enabled = NO; - [self.migrationProgress startAnimation:self]; - - if (self.upgrading) { - [Mixpanel trackEvent:@"VM Upgrade Started" forPane:self]; - self.migrationStatusLabel.stringValue = @"Upgrading..."; - [self upgradeBoot2DockerVM]; - } else { - [Mixpanel trackEvent:@"Boot2Docker Migration Started" forPane:self]; - self.migrationStatusLabel.stringValue = @"Migrating..."; - [self migrateBoot2DockerVM]; - } - - return NO; - } else if (self.migrateCheckbox.state == NSOffState) { - if (self.upgrading) { - [Mixpanel trackEvent:@"VM Upgrade Skipped" forPane:self]; - } else { - [Mixpanel trackEvent:@"Boot2Docker Migration Skipped" forPane:self]; - } - - } - - return YES; -} - -- (IBAction)submitButtonClicked:(id)sender { - NSURL *url = [[NSURL alloc] initWithString: @"https://github.com/docker/toolbox/issues"]; - [[NSWorkspace sharedWorkspace] openURL:url]; -} - -@end diff --git a/osx/installerplugins/managevmplugin/toolbox.png b/osx/installerplugins/managevmplugin/toolbox.png deleted file mode 100644 index fe42b97d7f..0000000000 Binary files a/osx/installerplugins/managevmplugin/toolbox.png and /dev/null differ diff --git a/osx/installerplugins/managevmplugin/toolboxcheck.png b/osx/installerplugins/managevmplugin/toolboxcheck.png deleted file mode 100644 index b17767f3be..0000000000 Binary files a/osx/installerplugins/managevmplugin/toolboxcheck.png and /dev/null differ diff --git a/osx/installerplugins/quickstartplugin/quickstartpluginPane.m b/osx/installerplugins/quickstartplugin/quickstartpluginPane.m index 8758a158e2..132bed3480 100644 --- a/osx/installerplugins/quickstartplugin/quickstartpluginPane.m +++ b/osx/installerplugins/quickstartplugin/quickstartpluginPane.m @@ -17,6 +17,7 @@ - (void) didEnterPane:(InstallerSectionDirection)dir { self.previousEnabled = NO; + [Mixpanel trackEvent:@"Installing Files Succeeded" forPane:self]; } - (void) willEnterPane:(InstallerSectionDirection)dir { diff --git a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Info.plist b/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Info.plist deleted file mode 100644 index 6d6d41b201..0000000000 --- a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Info.plist +++ /dev/null @@ -1,56 +0,0 @@ - - - - - BuildMachineOSBuild - 15C50 - CFBundleDevelopmentRegion - en - CFBundleExecutable - managevmplugin - CFBundleIdentifier - com.docker.managevmplugin - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - managevmplugin - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleSupportedPlatforms - - MacOSX - - CFBundleVersion - 1 - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 7C68 - DTPlatformVersion - GM - DTSDKBuild - 15C43 - DTSDKName - macosx10.11 - DTXcode - 0720 - DTXcodeBuild - 7C68 - Installer Version - %INSTALLER_VERSION% - InstallerSectionTitle - VM Migration - Mixpanel Token - %MIXPANEL_TOKEN% - NSHumanReadableCopyright - Copyright © 2015 Docker Inc. All rights reserved. - NSMainNibFile - managevmplugin - NSPrincipalClass - InstallerSection - - diff --git a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/MacOS/managevmplugin b/osx/mpkg/Plugins/managevmplugin.bundle/Contents/MacOS/managevmplugin deleted file mode 100755 index 605480beb2..0000000000 Binary files a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/MacOS/managevmplugin and /dev/null differ diff --git a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/Base.lproj/managevmplugin.nib b/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/Base.lproj/managevmplugin.nib deleted file mode 100644 index 613ac232c2..0000000000 Binary files a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/Base.lproj/managevmplugin.nib and /dev/null differ diff --git a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/InstallerSections.plist b/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/InstallerSections.plist deleted file mode 100644 index 9b0ee1d807..0000000000 --- a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/InstallerSections.plist +++ /dev/null @@ -1,16 +0,0 @@ - - - - - SectionOrder - - Introduction - ReadMe - License - managevmplugin.bundle - Target - PackageSelection - Install - - - diff --git a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/boot2docker.png b/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/boot2docker.png deleted file mode 100644 index afb01dff8d..0000000000 Binary files a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/boot2docker.png and /dev/null differ diff --git a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/en.lproj/InfoPlist.strings b/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/en.lproj/InfoPlist.strings deleted file mode 100644 index fd1d0c413b..0000000000 Binary files a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/en.lproj/InfoPlist.strings and /dev/null differ diff --git a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/en.lproj/Localizable.strings b/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/en.lproj/Localizable.strings deleted file mode 100644 index 9e5f5543b1..0000000000 Binary files a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/en.lproj/Localizable.strings and /dev/null differ diff --git a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/toolbox.png b/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/toolbox.png deleted file mode 100644 index fe42b97d7f..0000000000 Binary files a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/toolbox.png and /dev/null differ diff --git a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/toolboxcheck.png b/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/toolboxcheck.png deleted file mode 100644 index b17767f3be..0000000000 Binary files a/osx/mpkg/Plugins/managevmplugin.bundle/Contents/Resources/toolboxcheck.png and /dev/null differ diff --git a/osx/mpkg/boot2dockeriso.pkg/Scripts/postinstall b/osx/mpkg/boot2dockeriso.pkg/Scripts/postinstall index 5494943a71..8bb1f0858f 100755 --- a/osx/mpkg/boot2dockeriso.pkg/Scripts/postinstall +++ b/osx/mpkg/boot2dockeriso.pkg/Scripts/postinstall @@ -2,13 +2,21 @@ CONSOLE_USER=$(stat -f '%Su' /dev/console) CONSOLE_USER_HOME=$(su $CONSOLE_USER -c 'echo $HOME') - -# Place boot2docker ISO in cache -mkdir -p $CONSOLE_USER_HOME/.docker/machine/cache -cp /usr/local/share/boot2docker/boot2docker.iso $CONSOLE_USER_HOME/.docker/machine/cache/boot2docker.iso -chown -R $CONSOLE_USER:staff $CONSOLE_USER_HOME/.docker +VM=default # Fix permissions on binaries chown -R $CONSOLE_USER:admin /usr/local/bin/docker || true -chown -R $CONSOLE_USER:admin /usr/local/bin/docker-machine* || true +chown -R $CONSOLE_USER:admin /usr/local/bin/docker-machine || true chown -R $CONSOLE_USER:admin /usr/local/bin/docker-compose || true + +# Place boot2docker ISO in cache & upgrade the boot2docker VM +mkdir -p $CONSOLE_USER_HOME/.docker/machine/cache +cp /usr/local/share/boot2docker/boot2docker.iso $CONSOLE_USER_HOME/.docker/machine/cache/boot2docker.iso + +if [ -d "$CONSOLE_USER_HOME/.docker/machine/machines/$VM" ] && [ -f /usr/local/bin/docker-machine ]; then + sudo -i -u "$CONSOLE_USER" "/usr/local/bin/docker-machine stop $VM || true" + cp /usr/local/share/boot2docker/boot2docker.iso $CONSOLE_USER_HOME/.docker/machine/machines/$VM/boot2docker.iso +fi + +chown -R $CONSOLE_USER:staff $CONSOLE_USER_HOME/.docker +