diff --git a/build.gradle b/build.gradle index 26f542d7..2b825f7c 100644 --- a/build.gradle +++ b/build.gradle @@ -14,18 +14,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - buildscript { repositories { - jcenter() + mavenCentral() + gradlePluginPortal() } dependencies { - classpath "cz.alenkacz:gradle-scalafmt:${gradle.scalafmt.version}" + // Correct coordinates for modern Scalafmt plugin + classpath "cz.alenkacz.gradle.scalafmt:cz.alenkacz.gradle.scalafmt.gradle.plugin:${gradle.scalafmt.version}" } } subprojects { - apply plugin: 'scalafmt' - scalafmt.configFilePath = gradle.scalafmt.config -} + // Only apply the plugin to projects that actually use Scala (like the 'tests' project) + plugins.withId('scala') { + apply plugin: 'cz.alenkacz.gradle.scalafmt' + scalafmt.configFilePath = gradle.scalafmt.config + } + // Optional: Keep support for the manual property + if (project.hasProperty('scalafmt')) { + apply plugin: 'cz.alenkacz.gradle.scalafmt' + scalafmt.configFilePath = gradle.scalafmt.config + } +} diff --git a/golang1.15/Dockerfile b/golang1.15/Dockerfile index 6e1c37e5..eda84201 100644 --- a/golang1.15/Dockerfile +++ b/golang1.15/Dockerfile @@ -21,7 +21,10 @@ FROM golang:1.15 RUN echo "deb http://archive.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list && \ echo "deb http://archive.debian.org/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list && \ echo "deb http://archive.debian.org/debian buster-backports main contrib non-free" >> /etc/apt/sources.list && \ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AED4B06F473041FA && \ + # MODIFIED: Added resilient keyserver handling with fallbacks to avoid connection timeouts + (apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys AED4B06F473041FA || \ + apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys AED4B06F473041FA || \ + apt-key adv --keyserver keys.openpgp.org --recv-keys AED4B06F473041FA || true) && \ echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \ apt-get update && \ # Upgrade installed packages to get latest security fixes if the base image does not contain them already. diff --git a/golang1.17/Dockerfile b/golang1.17/Dockerfile index 7c09b05c..896ac76a 100644 --- a/golang1.17/Dockerfile +++ b/golang1.17/Dockerfile @@ -21,7 +21,10 @@ FROM golang:1.17-buster RUN echo "deb http://archive.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list && \ echo "deb http://archive.debian.org/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list && \ echo "deb http://archive.debian.org/debian buster-backports main contrib non-free" >> /etc/apt/sources.list && \ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AED4B06F473041FA && \ + # MODIFIED: Added resilient keyserver handling with fallbacks to avoid connection timeouts + (apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys AED4B06F473041FA || \ + apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys AED4B06F473041FA || \ + apt-key adv --keyserver keys.openpgp.org --recv-keys AED4B06F473041FA || true) && \ echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \ apt-get update && \ # Upgrade installed packages to get latest security fixes if the base image does not contain them already. diff --git a/golang1.20/Dockerfile b/golang1.20/Dockerfile index bb82d1a3..0e1abc10 100644 --- a/golang1.20/Dockerfile +++ b/golang1.20/Dockerfile @@ -25,8 +25,9 @@ RUN curl -L ${DEPLOYER_DOWNLOAD} | tar xzf - \ && rm -fr /usr/local/lib/dosls && mv dosls /usr/local/lib \ && rm -f /usr/local/bin/dosls && ln -s /usr/local/lib/dosls/bootstrap /usr/local/bin/dosls -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ +# MODIFIED: Added Acquire::Retries=3 to handle transient network issues during package installation +RUN apt-get -o Acquire::Retries=3 update \ + && apt-get -o Acquire::Retries=3 install -y --no-install-recommends \ # For tests, mostly. jq \ # To run the compile script. diff --git a/gradle/docker.gradle b/gradle/docker.gradle index 6ad68506..380bfec1 100644 --- a/gradle/docker.gradle +++ b/gradle/docker.gradle @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -29,13 +29,13 @@ import groovy.time.* * - dockerRegistry (optional): The registry to push to * - dockerImageTag (optional, default 'latest'): The tag for the image * - dockerImagePrefix (optional, default 'whisk'): The prefix for the image, - * 'controller' becomes 'whisk/controller' per default + * 'controller' becomes 'whisk/controller' per default * - dockerTimeout (optional, default 840): Timeout for docker operations in seconds * - dockerRetries (optional, default 3): How many times to retry docker operations * - dockerBinary (optional, default 'docker'): The binary to execute docker commands * - dockerBuildArgs (options, default ''): Project specific custom docker build arguments * - dockerHost (optional): The docker host to run commands on, default behaviour is - * docker's own DOCKER_HOST environment variable + * docker's own DOCKER_HOST environment variable */ ext { @@ -54,7 +54,10 @@ if(project.hasProperty('dockerHost')) { } if(project.hasProperty('dockerBuildArgs')) { - dockerBuildArgs.each { arg -> + // MODIFIED: Ensure we treat strings from the CLI as a single item list + // to prevent character-by-character iteration. + def argsList = project.dockerBuildArgs instanceof String ? [project.dockerBuildArgs] : project.dockerBuildArgs + argsList.each { arg -> dockerBuildArg += ['--build-arg', arg] } } diff --git a/settings.gradle b/settings.gradle index 857617d6..d5269562 100644 --- a/settings.gradle +++ b/settings.gradle @@ -38,7 +38,7 @@ gradle.ext.scala = [ ] gradle.ext.scalafmt = [ - version: '1.5.0', + version: '1.16.2', // Update this from 1.5.0 config: new File(rootProject.projectDir, '.scalafmt.conf') ]