blob: f822516ca508f233368f000a9fef288e438b7c85 [file] [log] [blame]
#!/usr/bin/env groovy
/*
* Build cache configuration for gradle-keygen-plugin
* Copyright © 2018 Basil Peace
*
* This file is part of gradle-keygen-plugin.
*
* Licensed under the Apache License, Version 2.0 (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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* WORKAROUND:
* Jenkins doesn't set CI environment variable
* https://issues.jenkins-ci.org/browse/JENKINS-36707
* <grv87 2018-06-27>
*/
ext.pushToRemoteCache = System.getenv().with { containsKey('CI') || containsKey('JENKINS_URL') } || hasProperty('gradle.cache.push') && getProperty('gradle.cache.push')
buildCache {
local {
enabled = !pushToRemoteCache
removeUnusedEntriesAfterDays = 30
}
remote(HttpBuildCache) {
url = 'https://fidata.jfrog.io/fidata/local.gradle.cache/'
credentials {
username = settings.ext.artifactoryUser
password = settings.ext.artifactoryPassword
}
push = pushToRemoteCache
}
}