Skip to content

Commit

Permalink
Auth file for magento 2 installation (laradock#2022)
Browse files Browse the repository at this point in the history
  • Loading branch information
salvo-github authored and fiksani committed Mar 2, 2019
1 parent 4662746 commit 553590c
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 0 deletions.
17 changes: 17 additions & 0 deletions DOCUMENTATION/content/documentation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1543,6 +1543,23 @@ Enabling Global Composer Install during the build for the container allows you t



<br>
<a name="Magento-2-authentication-credentials"></a>
## Magento 2 authentication credential (composer install)

1 - Open the `.env` file

2 - Search for the `WORKSPACE_COMPOSER_AUTH` argument under the Workspace Container and set it to `true`

3 - Now add your credentials to `workspace/auth.json`

4 - Re-build the Workspace Container `docker-compose build workspace`






<br>
<a name="Install-Prestissimo"></a>
## Install Prestissimo
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ services:
- INSTALL_AEROSPIKE=${WORKSPACE_INSTALL_AEROSPIKE}
- INSTALL_V8JS=${WORKSPACE_INSTALL_V8JS}
- COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL}
- COMPOSER_AUTH=${WORKSPACE_COMPOSER_AUTH}
- COMPOSER_REPO_PACKAGIST=${WORKSPACE_COMPOSER_REPO_PACKAGIST}
- INSTALL_WORKSPACE_SSH=${WORKSPACE_INSTALL_WORKSPACE_SSH}
- INSTALL_LARAVEL_ENVOY=${WORKSPACE_INSTALL_LARAVEL_ENVOY}
Expand Down
1 change: 1 addition & 0 deletions env-example
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ DOCKER_SYNC_STRATEGY=native_osx
### WORKSPACE #############################################

WORKSPACE_COMPOSER_GLOBAL_INSTALL=true
WORKSPACE_COMPOSER_AUTH=false
WORKSPACE_COMPOSER_REPO_PACKAGIST=
WORKSPACE_INSTALL_NODE=true
WORKSPACE_NODE_VERSION=node
Expand Down
12 changes: 12 additions & 0 deletions workspace/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ USER root
# Add the composer.json
COPY ./composer.json /home/laradock/.composer/composer.json

# Add the auth.json for magento 2 credentials
COPY ./auth.json /home/laradock/.composer/auth.json

# Make sure that ~/.composer belongs to laradock
RUN chown -R laradock:laradock /home/laradock/.composer

Expand All @@ -132,6 +135,15 @@ RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \
composer global install \
;fi

# Check if auth file is disabled
ARG COMPOSER_AUTH=false
ENV COMPOSER_AUTH ${COMPOSER_AUTH}

RUN if [ ${COMPOSER_AUTH} = false ]; then \
# remove the file
rm /home/laradock/.composer/auth.json
;fi

ARG COMPOSER_REPO_PACKAGIST
ENV COMPOSER_REPO_PACKAGIST ${COMPOSER_REPO_PACKAGIST}

Expand Down
8 changes: 8 additions & 0 deletions workspace/auth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"http-basic": {
"repo.magento.com": {
"username": "",
"password": ""
}
}
}

0 comments on commit 553590c

Please sign in to comment.