diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e1d75c5a8..46f9ed3f0e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,9 @@ on: - master - version-* +env: + GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx2g -Xms2g + jobs: branch-build: # Only run this on repositories in the 'spinnaker' org, not on forks. @@ -28,8 +31,4 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - name: Build - env: - BINTRAY_USER: ${{ secrets.BINTRAY_USER }} - BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }} - GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false - run: ./gradlew -PenableCrossCompilerPlugin=true -PenablePublishing=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" build snapshot --stacktrace + run: ./gradlew -PenableCrossCompilerPlugin=true build --stacktrace diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 41601f9e79..d13d376afd 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -2,6 +2,9 @@ name: PR Build on: [ pull_request ] +env: + GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx2g -Xms2g + jobs: build: runs-on: ubuntu-latest @@ -22,6 +25,4 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - name: Build - env: - GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false - run: ./gradlew -PenableCrossCompilerPlugin=true build javadoc + run: ./gradlew -PenableCrossCompilerPlugin=true build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35abb94f54..2c98234641 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,9 @@ on: - "v[0-9]+.[0-9]+.[0-9]+" - "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" +env: + GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx2g -Xms2g + jobs: release: runs-on: ubuntu-latest @@ -31,26 +34,18 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - . .github/workflows/release_info.sh ${{ github.event.repository.name }} + . .github/workflows/release_info.sh ${{ github.event.repository.full_name }} echo ::set-output name=CHANGELOG::$(echo -e "${CHANGELOG}") echo ::set-output name=SKIP_RELEASE::${SKIP_RELEASE} echo ::set-output name=IS_CANDIDATE::${IS_CANDIDATE} - - name: Candidate build - if: steps.release_info.outputs.IS_CANDIDATE == 'true' - env: - BINTRAY_USER: ${{ secrets.BINTRAY_USER }} - BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }} - GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false - run: | - ./gradlew -PenableCrossCompilerPlugin=true -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" candidate + echo ::set-output name=RELEASE_VERSION::${RELEASE_VERSION} - name: Release build - if: steps.release_info.outputs.IS_CANDIDATE == 'false' env: BINTRAY_USER: ${{ secrets.BINTRAY_USER }} BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }} - GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false + RELEASE_VERSION: ${{ steps.release_info.outputs.RELEASE_VERSION }} run: | - ./gradlew -PenableCrossCompilerPlugin=true -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" final + ./gradlew -PenableCrossCompilerPlugin=true --info -Pversion="${RELEASE_VERSION}" -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" publish - name: Create release if: steps.release_info.outputs.SKIP_RELEASE == 'false' uses: actions/create-release@v1 diff --git a/.github/workflows/release_info.sh b/.github/workflows/release_info.sh index b4b8eb97d1..0cadf01b76 100755 --- a/.github/workflows/release_info.sh +++ b/.github/workflows/release_info.sh @@ -1,7 +1,7 @@ #!/bin/bash -x # Only look to the latest release to determine the previous tag -- this allows us to skip unsupported tag formats (like `version-1.0.0`) -export PREVIOUS_TAG=`curl --silent "https://api.github.com/repos/spinnaker/$1/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'` +export PREVIOUS_TAG=`curl --silent "https://api.github.com/repos/$1/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'` echo "PREVIOUS_TAG=$PREVIOUS_TAG" export NEW_TAG=${GITHUB_REF/refs\/tags\//} echo "NEW_TAG=$NEW_TAG" @@ -29,3 +29,7 @@ SEMVER_REGEX="\ # Used in downstream steps to determine if the release should be marked as a "prerelease" and if the build should build candidate release artifacts export IS_CANDIDATE=`[[ $NEW_TAG =~ $SEMVER_REGEX && ! -z ${BASH_REMATCH[4]} ]] && echo "true" || echo "false"` + +# This is the version string we will pass to the build, trim off leading 'v' if present +export RELEASE_VERSION=`[[ $NEW_TAG =~ $SEMVER_REGEX ]] && echo "${NEW_TAG:1}" || echo "${NEW_TAG}"` +echo "RELEASE_VERSION=$RELEASE_VERSION" diff --git a/build.gradle b/build.gradle index 847e4331eb..84570a6c7c 100644 --- a/build.gradle +++ b/build.gradle @@ -14,29 +14,16 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - maven { url "https://spinnaker.bintray.com/gradle" } - maven { url "https://plugins.gradle.org/m2/" } - } - dependencies { - classpath "com.netflix.spinnaker.gradle:spinnaker-dev-plugin:$spinnakerGradleVersion" - if (Boolean.valueOf(enablePublishing)) { - classpath "com.netflix.spinnaker.gradle:spinnaker-gradle-project:$spinnakerGradleVersion" - } - classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8' - } +plugins { + id 'io.spinnaker.project' version "$spinnakerGradleVersion" apply false + id 'com.google.protobuf' version "0.8.12" apply false } -allprojects { +subprojects { group = "com.netflix.spinnaker.halyard" - apply plugin: 'spinnaker.base-project' + apply plugin: 'io.spinnaker.project' apply plugin: 'java-library' apply plugin: 'groovy' - if (Boolean.valueOf(enablePublishing)) { - apply plugin: 'spinnaker.project' - } test { testLogging { @@ -47,6 +34,13 @@ allprojects { maxHeapSize = "512m" } + if ([korkVersion, fiatVersion, clouddriverVersion, front50Version].any { it.endsWith("-SNAPSHOT") }) { + logger.info("Enabling mavenLocal") + repositories { + mavenLocal() + } + } + dependencies { implementation platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion") @@ -77,12 +71,3 @@ def createScript(project, mainClass, name) { } } } - -subprojects { project -> - if ([korkVersion, fiatVersion, clouddriverVersion, front50Version].any { it.endsWith("-SNAPSHOT") }) { - logger.info("Enabling mavenLocal") - repositories { - mavenLocal() - } - } -} diff --git a/gradle.properties b/gradle.properties index 966ab65d03..6a44551658 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,6 @@ clouddriverVersion=5.57.0 -enablePublishing=false fiatVersion=1.18.3 front50Version=2.17.1 korkVersion=7.37.0 org.gradle.parallel=true -spinnakerGradleVersion=7.11.6 +spinnakerGradleVersion=8.0.0-rc.3 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 5c2d1cf016..490fda8577 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5028f28f8e..a4b4429748 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 83f2acfdc3..2fe81a7d95 100755 --- a/gradlew +++ b/gradlew @@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -175,14 +175,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 24467a141f..9109989e3c 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" diff --git a/halyard-web/halyard-web.gradle b/halyard-web/halyard-web.gradle index 7dc4c77145..57ea6b1502 100644 --- a/halyard-web/halyard-web.gradle +++ b/halyard-web/halyard-web.gradle @@ -1,5 +1,5 @@ apply plugin: 'com.google.protobuf' -apply plugin: 'spinnaker.application' +apply plugin: 'io.spinnaker.package' ext { springConfigLocation = System.getProperty('spring.config.additional-location', "${System.getProperty('user.home')}/.spinnaker/")