Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
services
t3o sites
extensions.typo3.org
extensions.typo3.org
Commits
0b5dd356
Commit
0b5dd356
authored
Nov 13, 2016
by
Sascha Marcel Schmidt
Browse files
adds composer script that uses composer container and is now being used
instead of the php container
parent
c8fc4357
Changes
2
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
0b5dd356
...
...
@@ -19,6 +19,6 @@ log:
down
:
$(DOCKER_COMPOSE)
down
--remove-orphans
composer-install
:
$(
DOCKER_COMPOSE)
run
--rm
--no-deps
php composer
install
$(
COMPOSER)
--working-dir
=
data/typo3
install
composer-update
:
$(
DOCKER_
COMPOSE)
run
--rm
--no-deps
php composer update
$(COMPOSE
R
)
--working-dir
=
data/typo3 up
data/scripts/composer.sh
0 → 100755
View file @
0b5dd356
#!/bin/bash
#
# Run composer in a container
#
# This script will attempt to mirror the host paths by using volumes for the
# following paths:
# * $(pwd)
# * $(dirname $COMPOSE_FILE) if it's set
# * $HOME if it's set
#
# You can add additional volumes (or any docker run options) using
# the $COMPOSER_OPTIONS environment variable.
#
set
-e
VERSION
=
"1.2-alpine"
IMAGE
=
"composer/composer:
$VERSION
"
SSH_IDENTITY_FILE
=
${
SSH_IDENTITY_FILE
:-
~/.ssh/id_rsa
}
COMPOSER_CACHE
=
${
COMPOSER_CACHE
:-
/tmp/composer
}
# Setup volume mounts for composer config, context and ssh keys
if
[
"
$(
pwd
)
"
!=
'/'
]
;
then
VOLUMES
=
"-v
$(
pwd
)
:
$(
pwd
)
"
fi
if
[
-n
"
$COMPOSER_FILE
"
]
;
then
composer_dir
=
$(
dirname
$COMPOSER_FILE
)
fi
# TODO: also check --file argument
if
[
-n
"
$composer_dir
"
]
;
then
VOLUMES
=
"
$VOLUMES
-v
$composer_dir
:
$composer_dir
"
fi
if
[
-n
"
$SSH_IDENTITY_FILE
"
]
;
then
ssh_identity_dir
=
$(
dirname
$SSH_IDENTITY_FILE
)
fi
# TODO: also check --file argument
if
[
-n
"
$ssh_identity_dir
"
]
;
then
VOLUMES
=
"
$VOLUMES
-v
$ssh_identity_dir
:/root/.ssh"
fi
if
[
-n
"
$COMPOSER_CACHE
"
]
;
then
composer_cache_dir
=
$(
dirname
$COMPOSER_CACHE
)
fi
# TODO: also check --file argument
if
[
-n
"
$composer_cache_dir
"
]
;
then
VOLUMES
=
"
$VOLUMES
-v
$composer_cache_dir
:/composer/cache"
fi
if
[
-n
"
$HOME
"
]
;
then
VOLUMES
=
"
$VOLUMES
-v
$HOME
:
$HOME
-v
$HOME
:/root"
# mount $HOME in /root to share docker.config
fi
# Only allocate tty if we detect one
if
[
-t
1
]
;
then
DOCKER_RUN_OPTIONS
=
"-t"
fi
if
[
-t
0
]
;
then
DOCKER_RUN_OPTIONS
=
"
$DOCKER_RUN_OPTIONS
-i"
fi
exec
docker run
--rm
-u
$(
id
-u
)
$DOCKER_RUN_OPTIONS
$COMPOSER_OPTIONS
$VOLUMES
-w
"
$(
pwd
)
"
$IMAGE
"
$@
"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment