Bläddra i källkod

Many updates for docker-magento 26.0.0 (see CHANGELOG)

Mark Shust 5 år sedan
förälder
incheckning
b23f44ef97
64 ändrade filer med 29 tillägg och 250 borttagningar
  1. 13 0
      CHANGELOG.md
  2. 6 6
      README.md
  3. 2 24
      SETUP.md
  4. 0 0
      compose/.gitignore
  5. 0 0
      compose/.vscode/launch.json
  6. 0 0
      compose/bin/bash
  7. 0 0
      compose/bin/cli
  8. 0 0
      compose/bin/clinotty
  9. 0 0
      compose/bin/composer
  10. 0 0
      compose/bin/copyfromcontainer
  11. 0 0
      compose/bin/copytocontainer
  12. 0 0
      compose/bin/dev-urn-catalog-generate
  13. 0 0
      compose/bin/devconsole
  14. 0 0
      compose/bin/download
  15. 0 0
      compose/bin/fixowns
  16. 0 0
      compose/bin/fixperms
  17. 0 0
      compose/bin/grunt
  18. 0 0
      compose/bin/magento
  19. 0 0
      compose/bin/n98-magerun2
  20. 0 0
      compose/bin/node
  21. 0 0
      compose/bin/npm
  22. 0 0
      compose/bin/pwa-studio
  23. 0 0
      compose/bin/redis
  24. 0 0
      compose/bin/remove
  25. 0 0
      compose/bin/removevolumes
  26. 0 0
      compose/bin/restart
  27. 0 0
      compose/bin/root
  28. 0 0
      compose/bin/rootnotty
  29. 0 0
      compose/bin/setup
  30. 0 0
      compose/bin/setup-pwa-studio
  31. 0 0
      compose/bin/start
  32. 0 0
      compose/bin/status
  33. 0 0
      compose/bin/stop
  34. 2 3
      compose/bin/update
  35. 0 0
      compose/bin/xdebug
  36. 1 1
      compose/docker-compose.dev.yml
  37. 1 1
      compose/docker-compose.yml
  38. 0 0
      compose/env/db.env
  39. 0 14
      compose/magento-2-windows/.vscode/launch.json
  40. 0 1
      compose/magento-2-windows/bin/bash.ps1
  41. 0 6
      compose/magento-2-windows/bin/cli.ps1
  42. 0 6
      compose/magento-2-windows/bin/clinotty.ps1
  43. 0 1
      compose/magento-2-windows/bin/composer.ps1
  44. 0 6
      compose/magento-2-windows/bin/copydir.ps1
  45. 0 11
      compose/magento-2-windows/bin/copydirall.ps1
  46. 0 1
      compose/magento-2-windows/bin/copymagento.ps1
  47. 0 27
      compose/magento-2-windows/bin/download.ps1
  48. 0 8
      compose/magento-2-windows/bin/fixperms.ps1
  49. 0 1
      compose/magento-2-windows/bin/grunt.ps1
  50. 0 1
      compose/magento-2-windows/bin/magento.ps1
  51. 0 1
      compose/magento-2-windows/bin/node.ps1
  52. 0 1
      compose/magento-2-windows/bin/npm.ps1
  53. 0 1
      compose/magento-2-windows/bin/restart.ps1
  54. 0 6
      compose/magento-2-windows/bin/root.ps1
  55. 0 28
      compose/magento-2-windows/bin/setup.ps1
  56. 0 5
      compose/magento-2-windows/bin/start.ps1
  57. 0 1
      compose/magento-2-windows/bin/stop.ps1
  58. 0 16
      compose/magento-2-windows/bin/xdebug.ps1
  59. 0 63
      compose/magento-2-windows/docker-compose.yml
  60. 0 1
      compose/magento-2-windows/src/.gitignore
  61. 0 4
      compose/magento-2/env/db.env
  62. 0 1
      compose/magento-2/src/.gitignore
  63. 1 1
      lib/onelinesetup
  64. 3 3
      lib/template

+ 13 - 0
CHANGELOG.md

@@ -8,6 +8,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
 
 N/A
 
+## [26.0.0] - 2019-12-30
+
+## Added
+- Ability for `src` directory to be a symlink
+
+### Fixed
+- Fixed Magento2 setup script with n98-magerun2.phar
+- Fixed dev-urn-catalog-generate script
+
+## Removed
+- All Windows-specific setup and helper scripts. This involved changing directory structure of `compose` folder, there is no longer specific `magento-2` and `magento-2-windows` specific folders. Windows support works on Docker with WSL.
+- Support for PHP 7.1 (EOL)
+
 ## [25.0.0] - 2019-10-22
 
 ### Added

+ 6 - 6
README.md

@@ -117,7 +117,7 @@ Same result as the one-liner above. Just replace `magento2.test` references with
 
 ```bash
 # Download the Docker Compose template:
-curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash -s -- magento-2
+curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash
 
 # Download the version of Magento you want to use with:
 bin/download 2.3.3
@@ -147,7 +147,7 @@ open https://magento2.test
 
 ```bash
 # Download the Docker Compose template:
-curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash -s -- magento-2
+curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash
 
 # Remove existing src directory:
 rm -rf src
@@ -203,13 +203,13 @@ It is recommended to keep your root docker config files in one repository, and y
 
 ### Older Versions
 
-Versions older than `24.0.0` did not include a `bin/update` helper script. In this situation, you can download the file to your project by running:
+Versions older than `24.0.0` did not include a `bin/update` helper script, and versions older than `26.0.0` had a different directory structure. For both of these situations, you can download the most recent file to your project by running:
 
 ```
-(cd bin && curl -OL https://raw.githubusercontent.com/markshust/docker-magento/master/compose/magento-2/bin/update && chmod +x update)
+(cd bin && curl -OL https://raw.githubusercontent.com/markshust/docker-magento/master/compose/bin/update && chmod +x update)
 ```
 
-You'll now have the `bin/update` helper script, and can run it to update your project.
+You'll now have an updated `bin/update` helper script, and can run it to update your project.
 
 ## Custom CLI Commands
 
@@ -297,7 +297,7 @@ For more information about Redis usage with Magento, <a href="https://devdocs.ma
 
 Install and enable the PHP Debug extension from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug).
 
-Otherwise, this project now automatically sets up Xdebug support with VS Code. If you wish to set this up manually, please see the [`.vscode/launch.json`](https://github.com/markshust/docker-magento/blame/master/compose/magento-2/.vscode/launch.json) file.
+Otherwise, this project now automatically sets up Xdebug support with VS Code. If you wish to set this up manually, please see the [`.vscode/launch.json`](https://github.com/markshust/docker-magento/blame/master/compose/.vscode/launch.json) file.
 
 ### Xdebug & PHPStorm
 

+ 2 - 24
SETUP.md

@@ -3,7 +3,7 @@
 ## New Magento 2 Project (macOS/Linux)
 
 1. Create the project template by going to the place you want the new project (ex. cd ~/Sites/magento2), then run
-	- `curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template|bash -s -- magento-2`
+	- `curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash`
 
 2. Extract the contents of your current Magento site to the `src` folder, or download a fresh copy of the Magento source code for starting a new project with:
     - `bin/download 2.3.0`
@@ -22,26 +22,4 @@
 
 ## New Magento 2 Project (Windows)
 
-> **Windows Configurations**: The Windows configuration does not currently work and is in need of a contributor to get functional once again. Please see [issue 100](https://github.com/markshust/docker-magento/issues/100) to contribute.
-
-The following scripts are meant to run with Powershell. Note that the execution policy for scripts needs to be set accordingly [Execution policy](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/get-executionpolicy?view=powershell-6).
-
-1. Create the project template by going to the place you want the new project (ex. cd ~/Sites/magento2), then run
-	- `curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template|bash -s -- magento-2-windows`
-
-2. Extract the contents of your current Magento site to the `src` folder, or download a fresh copy of the Magento source code for starting a new project with the following line. Note that the default untar command is quite slow. If you want to speed that up install [7-Zip](http://www.7-zip.org/) and add it to your PATH. The script will automatically use 7-Zip if it is available:
-    - `bin/download 2.3.0`
-
-3. Copy magento into the docker container with `bin/copymagento`. This is needed because of permission restrictions of shared data in Windows (see [Troubleshooting Docker](https://docs.docker.com/docker-for-windows/troubleshoot/#permissions-errors-on-data-directories-for-shared-volumes)). The `app` folder will however be shared with Windows for ease of development. For this folder the default permission 755 works just fine.
-
-4. Add an entry to `C:\Windows\System32\drivers\etc\hosts` with your custom domain: `127.0.0.1 magento2.test` (assuming the domain  you want to setup is `magento2.test`). Be sure to use a `.test` tld, as `.localhost` and `.dev` will present issues with domain resolution.
-
-5. Start your Docker containers with the provided helper script:
-    - `bin/start`
-
-6. For new projects: run Magento's setup install process with the below helper script. Feel free to edit this file to your liking; at the very least you will probably need to update the `base-url` value to the domain you setup in step 4. Also, be sure to setup [Composer Authentication](https://github.com/markshust/docker-magento#composer-authentication) before initiating the setup script.
-    - `bin/setup magento2.test`
-
-7. You may now access your site! Check out whatever domain you setup from within a web browser.
-    - `open http://magento2.test`
-
+Works with Docker in WSL. Full instructions to follow.

+ 0 - 0
compose/magento-2/.gitignore → compose/.gitignore


+ 0 - 0
compose/magento-2/.vscode/launch.json → compose/.vscode/launch.json


+ 0 - 0
compose/magento-2/bin/bash → compose/bin/bash


+ 0 - 0
compose/magento-2/bin/cli → compose/bin/cli


+ 0 - 0
compose/magento-2/bin/clinotty → compose/bin/clinotty


+ 0 - 0
compose/magento-2/bin/composer → compose/bin/composer


+ 0 - 0
compose/magento-2/bin/copyfromcontainer → compose/bin/copyfromcontainer


+ 0 - 0
compose/magento-2/bin/copytocontainer → compose/bin/copytocontainer


+ 0 - 0
compose/magento-2/bin/dev-urn-catalog-generate → compose/bin/dev-urn-catalog-generate


+ 0 - 0
compose/magento-2/bin/devconsole → compose/bin/devconsole


+ 0 - 0
compose/magento-2/bin/download → compose/bin/download


+ 0 - 0
compose/magento-2/bin/fixowns → compose/bin/fixowns


+ 0 - 0
compose/magento-2/bin/fixperms → compose/bin/fixperms


+ 0 - 0
compose/magento-2/bin/grunt → compose/bin/grunt


+ 0 - 0
compose/magento-2/bin/magento → compose/bin/magento


+ 0 - 0
compose/magento-2/bin/n98-magerun2 → compose/bin/n98-magerun2


+ 0 - 0
compose/magento-2/bin/node → compose/bin/node


+ 0 - 0
compose/magento-2/bin/npm → compose/bin/npm


+ 0 - 0
compose/magento-2/bin/pwa-studio → compose/bin/pwa-studio


+ 0 - 0
compose/magento-2/bin/redis → compose/bin/redis


+ 0 - 0
compose/magento-2/bin/remove → compose/bin/remove


+ 0 - 0
compose/magento-2/bin/removevolumes → compose/bin/removevolumes


+ 0 - 0
compose/magento-2/bin/restart → compose/bin/restart


+ 0 - 0
compose/magento-2/bin/root → compose/bin/root


+ 0 - 0
compose/magento-2/bin/rootnotty → compose/bin/rootnotty


+ 0 - 0
compose/magento-2/bin/setup → compose/bin/setup


+ 0 - 0
compose/magento-2/bin/setup-pwa-studio → compose/bin/setup-pwa-studio


+ 0 - 0
compose/magento-2/bin/start → compose/bin/start


+ 0 - 0
compose/magento-2/bin/status → compose/bin/status


+ 0 - 0
compose/magento-2/bin/stop → compose/bin/stop


+ 2 - 3
compose/magento-2/bin/update → compose/bin/update

@@ -1,7 +1,6 @@
 #!/bin/bash
-mkdir -p tmpupdate
-cd tmpupdate
-curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template|bash -s - magento-2
+mkdir -p tmpupdate && cd $_
+curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash
 rm -rf .git
 rsync -av ./ ../
 cd ..

+ 0 - 0
compose/magento-2/bin/xdebug → compose/bin/xdebug


+ 1 - 1
compose/magento-2/docker-compose.dev.yml → compose/docker-compose.dev.yml

@@ -1,5 +1,5 @@
 # Mark Shust's Docker Configuration for Magento (https://github.com/markshust/docker-magento)
-# Version 25.0.0
+# Version 26.0.0
 
 version: "3"
 

+ 1 - 1
compose/magento-2/docker-compose.yml → compose/docker-compose.yml

@@ -1,5 +1,5 @@
 # Mark Shust's Docker Configuration for Magento (https://github.com/markshust/docker-magento)
-# Version 25.0.0
+# Version 26.0.0
 
 version: "3"
 

+ 0 - 0
compose/magento-2-windows/env/db.env → compose/env/db.env


+ 0 - 14
compose/magento-2-windows/.vscode/launch.json

@@ -1,14 +0,0 @@
-{
-  "version": "0.2.0",
-  "configurations": [
-    {
-      "name": "Listen for XDebug",
-      "type": "php",
-      "request": "launch",
-      "pathMappings": {
-        "/var/www/html": "${workspaceFolder}/src"
-      },
-      "port": 9001
-    }
-  ]
-}

+ 0 - 1
compose/magento-2-windows/bin/bash.ps1

@@ -1 +0,0 @@
-docker-compose exec phpfpm bash

+ 0 - 6
compose/magento-2-windows/bin/cli.ps1

@@ -1,6 +0,0 @@
-if ($args.length -eq 0) {
-    Write-Host "Please specify a CLI command (ex. ls)"
-    exit
-} else {
-    docker-compose exec phpfpm $args
-}

+ 0 - 6
compose/magento-2-windows/bin/clinotty.ps1

@@ -1,6 +0,0 @@
-if ($args.length -eq 0) {
-    Write-Host "Please specify a CLI command (ex. ls)"
-    exit
-} else {
-    docker-compose exec -T phpfpm $args
-}

+ 0 - 1
compose/magento-2-windows/bin/composer.ps1

@@ -1 +0,0 @@
-bin/cli composer $args

+ 0 - 6
compose/magento-2-windows/bin/copydir.ps1

@@ -1,6 +0,0 @@
-[CmdletBinding()]
-Param(
-  [Parameter(Mandatory=$True,Position=1)]
-  [string]$dir
-)
-docker cp $(docker-compose ps -q phpfpm|awk '{print $dir}'):/var/www/html/$dir src/

+ 0 - 11
compose/magento-2-windows/bin/copydirall.ps1

@@ -1,11 +0,0 @@
-bin/copydir app
-bin/copydir bin
-bin/copydir dev
-bin/copydir generated
-bin/copydir lib
-bin/copydir phpserver
-bin/copydir pub
-bin/copydir setup
-bin/copydir update
-bin/copydir var
-bin/copydir vendor

+ 0 - 1
compose/magento-2-windows/bin/copymagento.ps1

@@ -1 +0,0 @@
-docker-compose run --user=root --no-deps --rm -v $PWD/src/.:/src phpfpm cp -r /src/. /var/www/html

+ 0 - 27
compose/magento-2-windows/bin/download.ps1

@@ -1,27 +0,0 @@
-[CmdletBinding()]
-Param(
-  [Parameter(Mandatory=$True,Position=1)]
-  [string]$version
-)
-function Expand-Targz($tarFile, $dest) {
-  if (Get-Command "7z.exe" -ErrorAction SilentlyContinue) {
-    & cmd.exe "/C 7z x $tarFile.tar.gz -so | 7z x -aoa -si -ttar -o$dest"
-    Remove-Item "$tarFile.tar.gz"
-  }
-  else {
-    if (-not (Get-Command Expand-7Zip -ErrorAction Ignore)) {
-      Install-Package -Scope CurrentUser -Force 7Zip4PowerShell > $null
-    }
-    Expand-7Zip "$tarFile.tar.gz" $dest
-    Expand-7Zip "$tarFile.tar" $dest
-    Remove-Item "$tarFile.tar.gz"
-    Remove-Item "$tarFile.tar"
-  }
-}
-
-If( -not (Test-Path -Path .\src) )
-{
-    mkdir .\src | Out-Null
-}
-Start-BitsTransfer "http://pubfiles.nexcess.net/magento/ce-packages/magento2-$version.tar.gz" ".\src\magento2-$version.tar.gz"
-Expand-Targz ".\src\magento2-$version" ".\src"

+ 0 - 8
compose/magento-2-windows/bin/fixperms.ps1

@@ -1,8 +0,0 @@
-Write-Host "Correcting filesystem permissions..."
-
-bin/rootcli chown -R app:app /var/www
-bin/rootcli find var vendor pub/static pub/media app/etc -type f -exec chmod u+w `{`} `;
-bin/rootcli find var vendor pub/static pub/media app/etc -type d -exec chmod u+w `{`} `;
-bin/rootcli chmod u+x bin/magento
-
-Write-Host "Filesystem permissions corrected."

+ 0 - 1
compose/magento-2-windows/bin/grunt.ps1

@@ -1 +0,0 @@
-bin/cli node_modules/grunt/bin/grunt $args

+ 0 - 1
compose/magento-2-windows/bin/magento.ps1

@@ -1 +0,0 @@
-bin/cli bin/magento $args

+ 0 - 1
compose/magento-2-windows/bin/node.ps1

@@ -1 +0,0 @@
-bin/cli node $args

+ 0 - 1
compose/magento-2-windows/bin/npm.ps1

@@ -1 +0,0 @@
-bin/cli npm $args

+ 0 - 1
compose/magento-2-windows/bin/restart.ps1

@@ -1 +0,0 @@
-docker-compose rm

+ 0 - 6
compose/magento-2-windows/bin/root.ps1

@@ -1,6 +0,0 @@
-if ($args.length -eq 0) {
-    Write-Host "Please specify a CLI command (ex. ls)"
-    exit
-} else {
-    docker-compose exec -u root phpfpm $args
-}

+ 0 - 28
compose/magento-2-windows/bin/setup.ps1

@@ -1,28 +0,0 @@
-bin/cli chmod u+x bin/magento
-
-BASE_URL=${1:-magento2.test}
-
-bin/cli bin/magento setup:install `
-  --db-host=db `
-  --db-name=magento `
-  --db-user=magento `
-  --db-password=magento `
-  --base-url=https://$BASE_URL/ `
-  --admin-firstname=John `
-  --admin-lastname=Smith `
-  --admin-email=john.smith@gmail.com `
-  --admin-user=john.smith `
-  --admin-password=password123 `
-  --language=en_US `
-  --currency=USD `
-  --timezone=America/New_York `
-  --use-rewrites=1
-
-bin/fixperms
-
-echo "Turning on developer mode.."
-bin/magento deploy:mode:set developer
-
-bin/magento indexer:reindex
-
-bin/magento cache:enable

+ 0 - 5
compose/magento-2-windows/bin/start.ps1

@@ -1,5 +0,0 @@
-docker-compose up -d
-
-echo "Initiating bi-directional sync between host & containers..."
-bin/copydirall
-echo "All containers have started successfully."

+ 0 - 1
compose/magento-2-windows/bin/stop.ps1

@@ -1 +0,0 @@
-docker-compose stop

+ 0 - 16
compose/magento-2-windows/bin/xdebug.ps1

@@ -1,16 +0,0 @@
-[CmdletBinding()]
-Param(
-  [Parameter(Mandatory=$True,Position=1)]
-  [string]$enable_disable_xdebug
-)
-if ( "$enable_disable_xdebug" -eq "disable" ) {
-  bin/cli sed -i -e 's/^zend_extension/\;zend_extension/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
-  bin/restart
-  Write-Host "Xdebug has been disabled."
-} elseif ( "$enable_disable_xdebug" -eq "enable" ) {
-  bin/cli sed -i -e 's/^\;zend_extension/zend_extension/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
-  bin/restart
-  Write-Host "Xdebug has been enabled."
-} else {
-  Write-Host "Please specify either 'enable' or 'disable' as an argument"
-}

+ 0 - 63
compose/magento-2-windows/docker-compose.yml

@@ -1,63 +0,0 @@
-# Mark Shust's Docker Configuration for Magento (https://github.com/markshust/docker-magento)
-# Version 20.1.0
-
-version: "3"
-
-services:
-  app:
-    image: markoshust/magento-nginx:1.13-6
-    ports:
-      - "80:8000"
-      - "443:8443"
-    links:
-      - db
-      - phpfpm
-    volumes: &appvolumes
-      - ./src:/var/www/html:delegated
-      - ~/.composer:/var/www/.composer:delegated
-      - appdata:/sock
-      - appdata:/var/www/html/app
-      - appdata:/var/www/html/bin
-      - appdata:/var/www/html/dev
-      - appdata:/var/www/html/generated
-      - appdata:/var/www/html/lib
-      - appdata:/var/www/html/phpserver
-      - appdata:/var/www/html/pub
-      - appdata:/var/www/html/setup
-      - appdata:/var/www/html/update
-      - appdata:/var/www/html/var
-      - appdata:/var/www/html/vendor
-
-  phpfpm:
-    image: markoshust/magento-php:7.1-fpm-9
-    links:
-      - db
-    volumes: *appvolumes
-
-  # Disabling cron by default as it uses higher CPU, enable if needed
-  #cron:
-  #  image: markoshust/magento-php:7.1-fpm-9
-  #  user: root
-  #  command: /usr/local/bin/cronstart
-  #  tty: true
-  #  links:
-  #    - db
-  #  volumes: *appvolumes
-
-  db:
-    image: percona:5.7
-    ports:
-      - "3306:3306"
-    env_file: env/db.env
-    volumes:
-      - dbdata:/var/lib/mysql
-
-  elasticsearch:
-    image: elasticsearch:5.6
-    ports:
-      - "9200:9200"
-      - "9300:9300"
-
-volumes:
-  appdata:
-  dbdata:

+ 0 - 1
compose/magento-2-windows/src/.gitignore

@@ -1 +0,0 @@
-!.gitignore

+ 0 - 4
compose/magento-2/env/db.env

@@ -1,4 +0,0 @@
-MYSQL_ROOT_PASSWORD=magento
-MYSQL_DATABASE=magento
-MYSQL_USER=magento
-MYSQL_PASSWORD=magento

+ 0 - 1
compose/magento-2/src/.gitignore

@@ -1 +0,0 @@
-!.gitignore

+ 1 - 1
lib/onelinesetup

@@ -2,7 +2,7 @@
 DOMAIN=${1:-magento2.test}
 VERSION=${2:-2.3.3}
 
-curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template|bash -s - magento-2
+curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash
 bin/download $VERSION
 
 echo "Your system password has been requested to add an entry to /etc/hosts..."

+ 3 - 3
lib/template

@@ -2,8 +2,8 @@
 git init -qqq
 git remote add origin https://github.com/markshust/docker-magento
 git fetch origin -qqq
-git checkout origin/master -- compose/$1
-mv compose/$1/* ./
-mv compose/$1/.vscode ./
+git checkout origin/master -- compose
+mv compose/* ./
+mv compose/.vscode ./
 rm -rf compose .git
 git init