mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-22 15:22:16 -05:00
Merge pull request #565 from github/MoreDocker
adding more tests and cool logic
This commit is contained in:
commit
38df0a6df2
3 changed files with 29 additions and 14 deletions
13
.automation/test/docker/good/Dockerfile.dev
Normal file
13
.automation/test/docker/good/Dockerfile.dev
Normal file
|
@ -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"]
|
24
Dockerfile
24
Dockerfile
|
@ -104,13 +104,13 @@ RUN bundle install
|
|||
##############################
|
||||
# Installs Perl dependencies #
|
||||
##############################
|
||||
RUN curl -sL https://cpanmin.us/ | perl - -nq --no-wget Perl::Critic
|
||||
RUN curl --retry 5 --retry-delay 5 -sL https://cpanmin.us/ | perl - -nq --no-wget Perl::Critic
|
||||
|
||||
##############################
|
||||
# Install Phive dependencies #
|
||||
##############################
|
||||
RUN wget -O phive.phar https://phar.io/releases/phive.phar \
|
||||
&& wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc \
|
||||
RUN wget --tries=5 -O phive.phar https://phar.io/releases/phive.phar \
|
||||
&& wget --tries=5 -O phive.phar.asc https://phar.io/releases/phive.phar.asc \
|
||||
&& gpg --keyserver pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79 \
|
||||
&& gpg --verify phive.phar.asc phive.phar \
|
||||
&& chmod +x phive.phar \
|
||||
|
@ -126,7 +126,7 @@ RUN wget -O phive.phar https://phar.io/releases/phive.phar \
|
|||
# Slightly modified to always retrieve latest stable Powershell version
|
||||
# If changing PWSH_VERSION='latest' to a specific version, use format PWSH_VERSION='tags/v7.0.2'
|
||||
RUN mkdir -p ${PWSH_DIRECTORY} \
|
||||
&& curl -s https://api.github.com/repos/powershell/powershell/releases/${PWSH_VERSION} \
|
||||
&& curl --retry 5 --retry-delay 5 -s https://api.github.com/repos/powershell/powershell/releases/${PWSH_VERSION} \
|
||||
| grep browser_download_url \
|
||||
| grep linux-alpine-x64 \
|
||||
| cut -d '"' -f 4 \
|
||||
|
@ -142,7 +142,7 @@ RUN mkdir -p ${PWSH_DIRECTORY} \
|
|||
# Reference https://github.com/Azure/arm-ttk
|
||||
# Reference https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/test-toolkit
|
||||
ENV ARM_TTK_PSD1="${ARM_TTK_DIRECTORY}/arm-ttk-master/arm-ttk/arm-ttk.psd1"
|
||||
RUN curl -sLO "${ARM_TTK_URI}" \
|
||||
RUN curl --retry 5 --retry-delay 5 -sLO "${ARM_TTK_URI}" \
|
||||
&& unzip "${ARM_TTK_NAME}" -d "${ARM_TTK_DIRECTORY}" \
|
||||
&& rm "${ARM_TTK_NAME}" \
|
||||
&& ln -sTf "${ARM_TTK_PSD1}" /usr/bin/arm-ttk
|
||||
|
@ -190,16 +190,16 @@ COPY --from=dockerfile-lint /bin/hadolint /usr/bin/hadolint
|
|||
##################
|
||||
# Install ktlint #
|
||||
##################
|
||||
RUN curl -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && chmod a+x ktlint \
|
||||
RUN curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && chmod a+x ktlint \
|
||||
&& mv "ktlint" /usr/bin/
|
||||
|
||||
####################
|
||||
# Install dart-sdk #
|
||||
####################
|
||||
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
|
||||
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk
|
||||
RUN wget --tries=5 -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
|
||||
RUN wget --tries=5 https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk
|
||||
RUN apk add --no-cache glibc-${GLIBC_VERSION}.apk && rm glibc-${GLIBC_VERSION}.apk
|
||||
RUN wget https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip -O - -q | unzip -q - \
|
||||
RUN wget --tries=5 https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip -O - -q | unzip -q - \
|
||||
&& chmod +x dart-sdk/bin/dart* \
|
||||
&& mv dart-sdk/bin/* /usr/bin/ && mv dart-sdk/lib/* /usr/lib/ && mv dart-sdk/include/* /usr/include/ \
|
||||
&& rm -r dart-sdk/
|
||||
|
@ -219,19 +219,19 @@ RUN CHECKSTYLE_LATEST=$(curl -s https://api.github.com/repos/checkstyle/checksty
|
|||
| grep browser_download_url \
|
||||
| grep ".jar" \
|
||||
| cut -d '"' -f 4) \
|
||||
&& curl -sSL $CHECKSTYLE_LATEST \
|
||||
&& curl --retry 5 --retry-delay 5 -sSL $CHECKSTYLE_LATEST \
|
||||
--output /usr/bin/checkstyle
|
||||
|
||||
####################
|
||||
# Install luacheck #
|
||||
####################
|
||||
RUN wget https://www.lua.org/ftp/lua-5.3.5.tar.gz -O - -q | tar -xzf - \
|
||||
RUN wget --tries=5 https://www.lua.org/ftp/lua-5.3.5.tar.gz -O - -q | tar -xzf - \
|
||||
&& cd lua-5.3.5 \
|
||||
&& make linux \
|
||||
&& make install \
|
||||
&& cd .. && rm -r lua-5.3.5/
|
||||
|
||||
RUN wget https://github.com/cvega/luarocks/archive/v3.3.1-super-linter.tar.gz -O - -q | tar -xzf - \
|
||||
RUN wget --tries=5 https://github.com/cvega/luarocks/archive/v3.3.1-super-linter.tar.gz -O - -q | tar -xzf - \
|
||||
&& cd luarocks-3.3.1-super-linter \
|
||||
&& ./configure --with-lua-include=/usr/local/include \
|
||||
&& make \
|
||||
|
|
|
@ -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 #
|
||||
################################
|
||||
|
|
Loading…
Reference in a new issue