Skip to content

Commit

Permalink
Execute binary steplib steps
Browse files Browse the repository at this point in the history
  • Loading branch information
ofalvai committed Sep 6, 2024
1 parent f751db3 commit 07c8d8f
Show file tree
Hide file tree
Showing 10 changed files with 241 additions and 112 deletions.
29 changes: 29 additions & 0 deletions _tests/integration/steplib_step_executable/step.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
title: Dummy step
summary: Dummy step
description: Dummy step
website: https://github.com/...
source_code_url: https://github.com/...
support_url: https://github.com/.../issues
project_type_tags:
- ios
type_tags:
- script
is_always_run: false
is_skippable: false

toolkit:
go:
package_name: github.com/bitrise-io/steps-go-toolkit-test

source:
git: https://github.com/bitrise-steplib/steps-deploy-to-bitrise-io.git
commit: 45842c8d910ffd036a494cfb7456a730f6c7a0b5

executables:
darwin-arm64:
url:
hash:
darwin-amd64:
linux-amd64:

inputs: []
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/bitrise-io/go-utils v1.0.13
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.22
github.com/bitrise-io/goinp v0.0.0-20240103152431-054ed78518ef
github.com/bitrise-io/stepman v0.0.0-20240828074035-6ae1a5f5efde
github.com/bitrise-io/stepman v0.0.0-20240827073840-3b3418afd742
github.com/go-git/go-git/v5 v5.12.0
github.com/gofrs/uuid v4.3.1+incompatible
github.com/hashicorp/go-version v1.4.0
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.22 h1:/SD9xE4LlX/Ju9YZ+n/yW/uDs7h
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.22/go.mod h1:Laih4ji980SQkRgdnMCH0g4u2GZI/5nnbqmYT9UfKFQ=
github.com/bitrise-io/goinp v0.0.0-20240103152431-054ed78518ef h1:R5FOa8RHjqZwMN9g1FQ8W7nXxQAG7iwq1Cw+mUk5S9A=
github.com/bitrise-io/goinp v0.0.0-20240103152431-054ed78518ef/go.mod h1:27ldH2bkCdYN5CEJ6x92EK+gkd5EcDBkA7dMrSKQFYU=
github.com/bitrise-io/stepman v0.0.0-20240828074035-6ae1a5f5efde h1:LinFhZG5OdayDh1T1JO8QANsNwQWzqORZ0A9EGHQ0ps=
github.com/bitrise-io/stepman v0.0.0-20240828074035-6ae1a5f5efde/go.mod h1:Lq9nEqKerBD35w3eSU8lf83F7uZPkXfmRSZEUDJN40w=
github.com/bitrise-io/stepman v0.0.0-20240827070535-210db1eae58e h1:bTy1G+zKuDZOckY7e9F1tKKS3pvi8Yxwj8hwTFumPX4=
github.com/bitrise-io/stepman v0.0.0-20240827070535-210db1eae58e/go.mod h1:Lq9nEqKerBD35w3eSU8lf83F7uZPkXfmRSZEUDJN40w=
github.com/bitrise-io/stepman v0.0.0-20240827073840-3b3418afd742 h1:n9T1IXoYrv53dgA6ok55qpATMOHO1GO1a1XEzFgdJ+E=
github.com/bitrise-io/stepman v0.0.0-20240827073840-3b3418afd742/go.mod h1:Lq9nEqKerBD35w3eSU8lf83F7uZPkXfmRSZEUDJN40w=
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
Expand Down
17 changes: 0 additions & 17 deletions tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
envmanModels "github.com/bitrise-io/envman/models"
"github.com/bitrise-io/go-utils/command"
"github.com/bitrise-io/go-utils/pathutil"
stepman "github.com/bitrise-io/stepman/cli"
stepmanModels "github.com/bitrise-io/stepman/models"
"golang.org/x/sys/unix"
)

Expand Down Expand Up @@ -125,21 +123,6 @@ func InstallFromURL(toolBinName, downloadURL string) error {
return nil
}

// ------------------
// --- Stepman

// StepmanSetup ...
func StepmanSetup(collection string) error {
log := log.NewLogger(log.GetGlobalLoggerOpts())
return stepman.Setup(collection, "", log)
}

// StepmanStepInfo ...
func StepmanStepInfo(collection, stepID, stepVersion string) (stepmanModels.StepInfoModel, error) {
log := log.NewLogger(log.GetGlobalLoggerOpts())
return stepman.QueryStepInfo(collection, stepID, stepVersion, log)
}

//
// Share

Expand Down
17 changes: 0 additions & 17 deletions tools/tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"github.com/bitrise-io/envman/models"

"github.com/bitrise-io/bitrise/configs"
"github.com/bitrise-io/go-utils/command"
"github.com/bitrise-io/go-utils/pathutil"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -71,22 +70,6 @@ func TestMoveFileDifferentDevices(t *testing.T) {
}
}

func TestStepmanJSONStepLibStepInfo(t *testing.T) {
// setup
require.NoError(t, configs.InitPaths())

// Valid params -- Err should empty, output filled
require.Equal(t, nil, StepmanSetup("https://github.com/bitrise-io/bitrise-steplib"))

info, err := StepmanStepInfo("https://github.com/bitrise-io/bitrise-steplib", "script", "0.9.0")
require.NoError(t, err)
require.NotEqual(t, "", info.JSON())

// Invalid params -- Err returned, output is invalid
info, err = StepmanStepInfo("https://github.com/bitrise-io/bitrise-steplib", "script", "2.x")
require.Error(t, err)
}

func TestEnvmanJSONPrint(t *testing.T) {
// Initialized envstore -- Err should empty, output filled
testDirPth, err := pathutil.NormalizedOSTempDirPath("test_env_store")
Expand Down
99 changes: 30 additions & 69 deletions vendor/github.com/bitrise-io/stepman/activator/steplib/activate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 07c8d8f

Please sign in to comment.