zrhoffman commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r536365028



##########
File path: pkg
##########
@@ -156,12 +175,28 @@ while (( "$#" )); do
                if (( "$verbose" == 0 )); then
                        exec >/dev/null 2>&1
                fi
+
+               # Build the project
                if [[ $build_images -eq 1 ]]; then
                        "${COMPOSECMD[@]}" -f $COMPOSE_FILE build $1 || exit 1
                else
                        "${COMPOSECMD[@]}" -f $COMPOSE_FILE pull $1 || exit 1
                fi
                "${COMPOSECMD[@]}" -f $COMPOSE_FILE run "${RUN_OPTIONS[@]}" 
--rm $1 || exit 1
+
+               # Check for a chained compose file for this particular project.
+               # A chained compose file will be named exactly the same as main 
docker-compose, with .service added,
+               # where <service> is the name of the specific service to be 
chained. The file may be a symlink to another
+               # compose file, in which case the symlink will be followed 
before it is processed.
+               # A "dist" symlink will be temporarily created in that 
directory to facilitate the collation of artefacts.
+               if [ -e "$COMPOSE_FILE.$1" ] ; then
+                       ln -sf "$(dirname -- "$(realpath -e -- "$SELF")")/dist" 
"$(dirname -- "$(realpath -e -- "$COMPOSE_FILE.$1")")/dist" || exit 1
+                       $SELF -f $(realpath -e "$COMPOSE_FILE.$1") $([ 
"$verbose" == 0 ] || echo "-v") $([ "$quiet" == 0 ] || echo "-q") $([ "$debug" 
== 0 ] || echo "-d") $([ "$build" == 0 ] || echo "-b") $("${COMPOSECMD[@]}" -f 
$(realpath -e "$COMPOSE_FILE.$1") config --services) || exit 1
+                       rm "$(dirname -- "$(realpath -e -- 
"$COMPOSE_FILE.$1")")/dist"
+               fi
+
+               # Update the ownership of the artefacts to match the main repo.
+               chown -R "$(stat -c '%u:%g' .)" dist

Review comment:
       This permissions issue will affect people using the optional 
docker-compose, so people building other components won't be affected. We can 
address this later.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to