github.com/drone/go-convert@v0.0.0-20240307072510-6bd371c65e61/convert/circle/internal/orbs/orbs.go (about)

     1  // Copyright 2022 Harness, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package orbs
    16  
    17  import (
    18  	browser_tools "github.com/drone/go-convert/convert/circle/internal/orbs/browser-tools"
    19  	"github.com/drone/go-convert/convert/circle/internal/orbs/datadog"
    20  	circle "github.com/drone/go-convert/convert/circle/yaml"
    21  	harness "github.com/drone/spec/dist/go"
    22  
    23  	"github.com/drone/go-convert/convert/circle/internal/orbs/codecov"
    24  	"github.com/drone/go-convert/convert/circle/internal/orbs/coveralls"
    25  	"github.com/drone/go-convert/convert/circle/internal/orbs/golang"
    26  	"github.com/drone/go-convert/convert/circle/internal/orbs/localstack"
    27  	"github.com/drone/go-convert/convert/circle/internal/orbs/node"
    28  	"github.com/drone/go-convert/convert/circle/internal/orbs/ruby"
    29  	"github.com/drone/go-convert/convert/circle/internal/orbs/saucelabs"
    30  	"github.com/drone/go-convert/convert/circle/internal/orbs/slack"
    31  )
    32  
    33  // Convert converts an Orb step to a Harness step.
    34  func Convert(name, command, version string, step *circle.Custom) *harness.Step {
    35  	switch name {
    36  	case "codecov/codecov":
    37  		return codecov.Convert(command, step)
    38  	case "coveralls/coveralls":
    39  		return coveralls.Convert(command, step)
    40  	case "circleci/browser-tools":
    41  		return browser_tools.Convert(command, version, step)
    42  	case "circleci/go":
    43  		return golang.Convert(command, step)
    44  	case "circleci/node":
    45  		return node.Convert(command, step)
    46  	case "circleci/ruby":
    47  		return ruby.Convert(command, step)
    48  	case "circleci/slack":
    49  		return slack.Convert(command, step)
    50  	case "datadog/agent":
    51  		return datadog.Convert(command, step)
    52  	case "localstack/platform":
    53  		return localstack.Convert(command, step)
    54  	case "saucelabs/saucectl-run":
    55  		return saucelabs.Convert(command, step)
    56  	default:
    57  		return nil
    58  	}
    59  }