Skip to content

Commit

Permalink
Merge pull request #55 from KeesKoffeman/circleci-support
Browse files Browse the repository at this point in the history
Adds CirclCI Provider
  • Loading branch information
rpalcolea authored Nov 6, 2019
2 parents 2a78d13 + 59ff104 commit 0ee00ac
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
45 changes: 45 additions & 0 deletions src/main/groovy/nebula/plugin/info/ci/CircleCIProvider.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright 2018-2019 Netflix, Inc.
*
* 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.
*/
package nebula.plugin.info.ci

import org.gradle.api.Project

class CircleCIProvider extends AbstractContinuousIntegrationProvider {
@Override
boolean supports(Project project) {
getEnvironmentVariable('CIRCLECI')
}

@Override
String calculateHost(Project project) {
return hostname()
}

@Override
String calculateJob(Project project) {
getEnvironmentVariable("CIRCLE_JOB")
}

@Override
String calculateBuildNumber(Project project) {
getEnvironmentVariable("CIRCLE_BUILD_NUM")
}

@Override
String calculateBuildId(Project project) {
getEnvironmentVariable("CIRCLE_BUILD_NUM")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ContinuousIntegrationInfoPlugin implements Plugin<Project>, InfoCollectorP
void apply(Project project) {
this.project = project

providers = [new DroneProvider(), new GitlabProvider(), new JenkinsProvider(), new TravisProvider(), new UnknownContinuousIntegrationProvider()] as List<ContinuousIntegrationInfoProvider>
providers = [new CircleCIProvider(), new DroneProvider(), new GitlabProvider(), new JenkinsProvider(), new TravisProvider(), new UnknownContinuousIntegrationProvider()] as List<ContinuousIntegrationInfoProvider>
selectedProvider = findProvider()

extension = project.extensions.create('ciinfo', ContinuousIntegrationInfoExtension)
Expand Down

0 comments on commit 0ee00ac

Please sign in to comment.