File tree Expand file tree Collapse file tree 5 files changed +458
-831
lines changed Expand file tree Collapse file tree 5 files changed +458
-831
lines changed Original file line number Diff line number Diff line change 11/vendor /
22! /build /.gitkeep
3- /build /*
3+ /build /*
4+ /bin /version
Original file line number Diff line number Diff line change @@ -4,5 +4,8 @@ FROM composer:2
44# Install the BCMath extension
55RUN docker-php-ext-install bcmath
66
7+ # Configure git to trust any directory
8+ RUN git config --global --add safe.directory '*'
9+
710# build with: docker build -t aws-execfwd-build -f build.dockerfile .
811# Execute with: docker run --rm -it -e COMPOSER_PROCESS_TIMEOUT=0 -w $PWD -v $PWD:$PWD aws-execfwd-build build
Original file line number Diff line number Diff line change @@ -3,6 +3,21 @@ set -euo pipefail
33DIR=" $( realpath " $( dirname " ${BASH_SOURCE[0]} " ) " ) "
44cd " $DIR "
55
6+ # Build the Docker image
67docker build -t aws-execfwd-build -f build.dockerfile .
7- docker run --rm -it -e COMPOSER_PROCESS_TIMEOUT=0 -w $PWD -v $PWD :$PWD aws-execfwd-build install
8- docker run --rm -it -e COMPOSER_PROCESS_TIMEOUT=0 -w $PWD -v $PWD :$PWD aws-execfwd-build build
8+
9+ # Create a container with long sleep to keep it alive
10+ CONTAINER=$( docker create aws-execfwd-build sleep 7200)
11+ docker cp . $CONTAINER :/app/
12+
13+ # Start container and run commands
14+ docker start $CONTAINER
15+ docker exec $CONTAINER composer install --working-dir=/app
16+ docker exec $CONTAINER composer build --working-dir=/app
17+
18+ # Copy the build artifact back
19+ mkdir -p build
20+ docker cp $CONTAINER :/app/build/aws-excfwd ./build/
21+
22+ # Clean up
23+ docker rm -f $CONTAINER
Original file line number Diff line number Diff line change 2323 "require" : {
2424 "php" : " ^7 || ^8" ,
2525 "aws/aws-sdk-php" : " ^3.36" ,
26- "symfony/console" : " ^4" ,
27- "psr/log" : " ^3 "
26+ "symfony/console" : " ^6. 4" ,
27+ "psr/log" : " ^1 "
2828 },
2929 "require-dev" : {
30- "macfja /phar-builder " : " ^0.2.8 "
30+ "clue /phar-composer " : " ^1.4 "
3131 },
32+ "bin" : [
33+ " bin/cli.php"
34+ ],
3235 "scripts" : {
33- "build" : " php -d phar.readonly=0 vendor/bin/phar-builder package composer.json"
34- },
35- "extra" : {
36- "phar-builder" : {
37- "compression" : " GZip" ,
38- "name" : " aws-excfwd.phar" ,
39- "output-dir" : " build" ,
40- "entry-point" : " ./bin/cli.php" ,
41- "include" : [" bin" ],
42- "include-dev" : false ,
43- "skip-shebang" : false ,
44- "events" : {
45- "command.package.start" : " git rev-parse --short HEAD > bin/version" ,
46- "command.package.end" : [
47- " rm bin/version" ,
48- " chmod +x build/aws-excfwd.phar" ,
49- " mv build/aws-excfwd.phar build/aws-excfwd"
50- ]
51- }
52- }
36+ "build" : [
37+ " git rev-parse --short HEAD > bin/version" ,
38+ " php -d phar.readonly=0 vendor/bin/phar-composer build . build/aws-excfwd" ,
39+ " rm bin/version" ,
40+ " chmod +x build/aws-excfwd"
41+ ]
5342 }
5443}
You can’t perform that action at this time.
0 commit comments