From 999413d224fd336b84e55b7d32260762ebd432a4 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Thu, 13 Aug 2020 12:40:21 -0500 Subject: [PATCH] adding more tests and cool logic --- .automation/test/docker/good/Dockerfile.dev | 13 +++++++++++++ lib/buildFileList.sh | 6 ++++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 .automation/test/docker/good/Dockerfile.dev diff --git a/.automation/test/docker/good/Dockerfile.dev b/.automation/test/docker/good/Dockerfile.dev new file mode 100644 index 00000000..33ed48d0 --- /dev/null +++ b/.automation/test/docker/good/Dockerfile.dev @@ -0,0 +1,13 @@ +FROM node:10 + +# Create app directory +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +# Install app dependencies +COPY package.json /usr/src/app/ +RUN npm install + +COPY server.js server.js +EXPOSE 3000 +CMD ["node", "server.js"] diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index ce85dedd..681e253f 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -79,11 +79,13 @@ function BuildFileList() { FILE_TYPE=${FILE##*.} # To lowercase FILE_TYPE=${FILE_TYPE,,} + # get the baseFile for additonal logic + BASE_FILE=$(basename "${FILE,,}") ############## # Print file # ############## - info "File:[${FILE}], File_type:[${FILE_TYPE}]" + info "File:[${FILE}], File_type:[${FILE_TYPE}], Base_file:[${BASE_FILE}]" ######### # DEBUG # @@ -432,7 +434,7 @@ function BuildFileList() { # Set the READ_ONLY_CHANGE_FLAG since this could be exec # ########################################################## READ_ONLY_CHANGE_FLAG=1 - elif [ "${FILE}" == "dockerfile" ] || [ "${FILE_TYPE}" == "dockerfile" ]; then + elif [ "${FILE_TYPE}" == "dockerfile" ] [ "${BASE_FILE}" == *"dockerfile."* ] ||; then ################################ # Append the file to the array # ################################