This repository was archived by the owner on Aug 28, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +1608
-487
lines changed Expand file tree Collapse file tree 9 files changed +1608
-487
lines changed Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ trim_trailing_whitespace = true
1111[* .md ]
1212trim_trailing_whitespace = false
1313
14- [* .{yml,yaml} ]
14+ [* .{yml,yaml,json } ]
1515indent_size = 2
Original file line number Diff line number Diff line change 55.env
66.env.backup
77.phpunit.result.cache
8+ artifacts /
9+ junit.xml
Original file line number Diff line number Diff line change 1- image : docker:18
1+ image : docker:19
22
33services :
44 - docker:dind
55
66stages :
77 - build
88
9- build :
9+ app :
1010 stage : build
11+ only :
12+ - branches
13+ - merge_requests
14+ - tags
1115 script :
12- - docker build --tag test .
16+ - docker build .
17+ after_script :
18+ - CID=$(docker create $(docker images --format='{{.ID}}' | head -1))
19+ - docker cp ${CID}:/srv/artifacts .
20+ artifacts :
21+ reports :
22+ junit : artifacts/*.xml
Original file line number Diff line number Diff line change 1- make insights
1+ make quality
Original file line number Diff line number Diff line change @@ -42,12 +42,18 @@ COPY . /srv
4242RUN composer dump-autoload
4343
4444FROM dependencies as test
45- RUN composer quality
45+ RUN composer quality || echo "error" > error.exit
46+
47+ RUN mv junit.xml artifacts/psalm.xml
48+ RUN [[ ! -f error.exit ]] && exit 0
4649
4750FROM dependencies as clean
4851RUN composer install --no-dev
4952RUN composer dump-autoload --optimize
5053
5154FROM php
5255COPY . /srv
56+ COPY --from=test /srv/artifacts /srv/artifacts
5357COPY --from=clean /srv/vendor /srv/vendor
58+
59+ WORKDIR /srv
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ begin:
1919serve :
2020 docker-compose up
2121
22+ # Build the application Docker image
23+ build :
24+ docker build . && (docker images --format='{{.ID}}' | head -1)
25+
2226# Run the application's quality check
2327quality :
2428 ${COMPOSER_COMMAND} quality
Original file line number Diff line number Diff line change 6868 " @php artisan insights --ansi --no-interaction --config-path=config/insights.php"
6969 ],
7070 "static" : [
71- " vendor/bin/psalm --long-progress"
71+ " vendor/bin/psalm --long-progress --report=junit.xml "
7272 ]
7373 }
7474}
You can’t perform that action at this time.
0 commit comments