diff --git a/README.md b/README.md index 4edfe68..6c43606 100644 --- a/README.md +++ b/README.md @@ -80,24 +80,6 @@ to other developers. An example would be if you want to use a different PHP vers #### Custom Services → see [📚 in-depth docs about custom service container](docs/services.md). -#### Using NFS Mount for Host Volume - -On macOS or Windows, you may instruct ssdev to mount the host directory via NFS. In the past, this has worked -well for improving performance, but with the addition of new and faster file-sharing implementations, -this has become a legacy feature and has been disabled by default in version `1.3.0`. - -If you want to re-enable it, simply add the `--use-nfs` flag or add the following to your config: -```json -{ - "ssdev": { - "use-nfs": true - } -} -``` - - -→ see [📚 Configuring NFS on macOS](docs/nfs/macos.md). - ## ➕ More Infos Check out the following for more informations: diff --git a/cli.js b/cli.js index 77561c5..d60cea9 100755 --- a/cli.js +++ b/cli.js @@ -37,11 +37,11 @@ require('yargs') // eslint-disable-line description: 'Ports to publish from the database container', default: ['3306:3306'], }) - .option('use-nfs', { - type: 'boolean', - description: 'flag to enable nfs mount on macOS or Windows systems', - default: false, - }) + // .option('use-nfs', { + // type: 'boolean', + // description: 'flag to enable nfs mount on macOS or Windows systems', + // default: false, + // }) // Serve the devenv .command( 'up', diff --git a/docker/getRootComposeFile/hostVolumes.js b/docker/getRootComposeFile/hostVolumes.js index 951ffbb..9902f88 100644 --- a/docker/getRootComposeFile/hostVolumes.js +++ b/docker/getRootComposeFile/hostVolumes.js @@ -9,11 +9,14 @@ const os = require('os'); */ function hostVolumes(args) { // eslint-disable-line no-unused-vars const volumes = { - volumes: [{ - type: 'volume', - source: 'host_data', - target: '/var/www/html', - }], + volumes: [ + '${PWD}:/var/www/html', // eslint-disable-line no-template-curly-in-string + ], + // volumes: [{ + // type: 'volume', + // source: 'host_data', + // target: '/var/www/html', + // }], }; if (os.platform() !== 'darwin' && os.platform() !== 'win32') { volumes.volumes = [ diff --git a/docker/getRootComposeFile/hostVolumes.test.js b/docker/getRootComposeFile/hostVolumes.test.js index 16a51da..b34cb05 100644 --- a/docker/getRootComposeFile/hostVolumes.test.js +++ b/docker/getRootComposeFile/hostVolumes.test.js @@ -13,11 +13,7 @@ const args = {}; test('contains a default volumes definition', () => { expect('volumes' in hostVolumes(args)).toBeTruthy(); const volumes = hostVolumes(args).volumes; - expect(volumes).toContainEqual({ - type: 'volume', - source: 'host_data', - target: '/var/www/html', - }); + expect(volumes).toContainEqual('${PWD}:/var/www/html'); }); test('contains pwd on linux', () => { diff --git a/docker/getRootComposeFile/volumeDefinition.js b/docker/getRootComposeFile/volumeDefinition.js index d4998ce..f8f1296 100644 --- a/docker/getRootComposeFile/volumeDefinition.js +++ b/docker/getRootComposeFile/volumeDefinition.js @@ -1,4 +1,4 @@ -const os = require('os'); +// const os = require('os'); /** * getVolumeDefinition - returns the volume definition as needed in the @@ -12,25 +12,25 @@ const os = require('os'); function getVolumeDefinition(args) { // eslint-disable-line no-unused-vars const definition = { db_data: null, - host_data: { - driver: 'local', - driver_opts: { - type: 'none', - o: 'bind', - device: '${PWD}', // eslint-disable-line no-template-curly-in-string - }, - }, + // host_data: { + // driver: 'local', + // driver_opts: { + // type: 'none', + // o: 'bind', + // device: '${PWD}', // eslint-disable-line no-template-curly-in-string + // }, + // }, + // }; + // if (args['use-nfs'] && (os.platform() === 'darwin' || os.platform() === 'win32')) { + // definition.host_data = { + // driver: 'local', + // driver_opts: { + // type: 'nfs', + // o: 'addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3', + // device: ':${PWD}', // eslint-disable-line no-template-curly-in-string + // }, + // }; }; - if (args['use-nfs'] && (os.platform() === 'darwin' || os.platform() === 'win32')) { - definition.host_data = { - driver: 'local', - driver_opts: { - type: 'nfs', - o: 'addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3', - device: ':${PWD}', // eslint-disable-line no-template-curly-in-string - }, - }; - } return { volumes: definition }; } diff --git a/docker/getRootComposeFile/volumeDefinition.test.js b/docker/getRootComposeFile/volumeDefinition.test.js index c514bfa..2ad57ca 100644 --- a/docker/getRootComposeFile/volumeDefinition.test.js +++ b/docker/getRootComposeFile/volumeDefinition.test.js @@ -16,58 +16,58 @@ test('contains a default volumes definition', () => { expect('db_data' in definition).toBeTruthy(); expect(definition.db_data).toBeNull(); - expect('host_data' in definition).toBeTruthy(); + // expect('host_data' in definition).toBeTruthy(); }); -test('contains a default mount for all systems by default', () => { - os.platform.mockReturnValue('linux'); - const linuxDefinition = volumeDefinition(args).volumes.host_data; - expect(linuxDefinition.driver).toBe('local'); - expect(linuxDefinition.driver_opts).toEqual({ - type: 'none', - o: 'bind', - device: '${PWD}', - }); +// test('contains a default mount for all systems by default', () => { +// os.platform.mockReturnValue('linux'); +// const linuxDefinition = volumeDefinition(args).volumes.host_data; +// expect(linuxDefinition.driver).toBe('local'); +// expect(linuxDefinition.driver_opts).toEqual({ +// type: 'none', +// o: 'bind', +// device: '${PWD}', +// }); - os.platform.mockReturnValue('win32'); - const winDefinition = volumeDefinition(args).volumes.host_data; - expect(winDefinition.driver).toBe('local'); - expect(winDefinition.driver_opts).toEqual({ - type: 'none', - o: 'bind', - device: '${PWD}', - }); +// os.platform.mockReturnValue('win32'); +// const winDefinition = volumeDefinition(args).volumes.host_data; +// expect(winDefinition.driver).toBe('local'); +// expect(winDefinition.driver_opts).toEqual({ +// type: 'none', +// o: 'bind', +// device: '${PWD}', +// }); - os.platform.mockReturnValue('darwin'); - const darwinDefinition = volumeDefinition(args).volumes.host_data; - expect(darwinDefinition.driver).toBe('local'); - expect(darwinDefinition.driver_opts).toEqual({ - type: 'none', - o: 'bind', - device: '${PWD}', - }); -}); +// os.platform.mockReturnValue('darwin'); +// const darwinDefinition = volumeDefinition(args).volumes.host_data; +// expect(darwinDefinition.driver).toBe('local'); +// expect(darwinDefinition.driver_opts).toEqual({ +// type: 'none', +// o: 'bind', +// device: '${PWD}', +// }); +// }); -test('correctly handles nfs on windows or macOS', () => { - os.platform.mockReturnValue('win32'); - var definition = volumeDefinition({ - 'use-nfs': true, - }).volumes.host_data; - expect(definition.driver).toBe('local'); - expect(definition.driver_opts).toEqual({ - type: 'nfs', - o: 'addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3', - device: ':${PWD}', - }); +// test('correctly handles nfs on windows or macOS', () => { +// os.platform.mockReturnValue('win32'); +// var definition = volumeDefinition({ +// 'use-nfs': true, +// }).volumes.host_data; +// expect(definition.driver).toBe('local'); +// expect(definition.driver_opts).toEqual({ +// type: 'nfs', +// o: 'addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3', +// device: ':${PWD}', +// }); - os.platform.mockReturnValue('darwin'); - definition = volumeDefinition({ - 'use-nfs': true, - }).volumes.host_data; - expect(definition.driver).toBe('local'); - expect(definition.driver_opts).toEqual({ - type: 'nfs', - o: 'addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3', - device: ':${PWD}', - }); -}); +// os.platform.mockReturnValue('darwin'); +// definition = volumeDefinition({ +// 'use-nfs': true, +// }).volumes.host_data; +// expect(definition.driver).toBe('local'); +// expect(definition.driver_opts).toEqual({ +// type: 'nfs', +// o: 'addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3', +// device: ':${PWD}', +// }); +// });