Skip to content

Commit

Permalink
Make Activate SSH Step optional (#113)
Browse files Browse the repository at this point in the history
*  Pass weather repo is private
*  Typo fixes, removed duplicated before_run
  • Loading branch information
lpusok authored Jan 25, 2022
1 parent 40dfdc5 commit 2a02ab9
Show file tree
Hide file tree
Showing 20 changed files with 80 additions and 68 deletions.
4 changes: 1 addition & 3 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ workflows:
test:
before_run:
- audit-this-step
- test_repo_clone
title: Bitrise Init Test
description: Bitrise Init Test
envs:
Expand Down Expand Up @@ -125,10 +126,7 @@ workflows:
- output_dir: $ORIG_BITRISE_SOURCE_DIR/result
- scan_result_submit_url: $BITRISE_SCAN_RESULT_POST_URL
- scan_result_submit_api_token: $BITRISE_APP_API_TOKEN
before_run:
- test_repo_clone


test_repo_clone:
envs:
- CLONE_INTO_DIR: _tmp
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.15

require (
github.com/bitrise-io/bitrise v0.0.0-20210623145422-513e39485248 // indirect
github.com/bitrise-io/bitrise-init v0.0.0-20211201163403-80ed402ddf62
github.com/bitrise-io/bitrise-init v0.0.0-20220125141216-6682bda67ae6
github.com/bitrise-io/envman v0.0.0-20210630102032-df85af51bd1a // indirect
github.com/bitrise-io/go-steputils v0.0.0-20210527075147-910ce7a105a1
github.com/bitrise-io/go-utils v0.0.0-20210713111255-08be784d45d0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ github.com/bitrise-io/bitrise v0.0.0-20210519130014-380842fb41c1/go.mod h1:Jqf2P
github.com/bitrise-io/bitrise v0.0.0-20210623145422-513e39485248 h1:GfhBF379/Uwu4fmalhwwoJv3RcqlrlEo8+gGEcuXLsw=
github.com/bitrise-io/bitrise v0.0.0-20210623145422-513e39485248/go.mod h1:jqk9VdrvlRpRfIqA2DZHVNEMvPycmlpBfpiKxk89R6w=
github.com/bitrise-io/bitrise-init v0.0.0-20210518121553-1e678625c45d/go.mod h1:2bxvLp7xgXC3HsacG2Z5nn6WOjk8kbNOmLWjinnhnKg=
github.com/bitrise-io/bitrise-init v0.0.0-20211201163403-80ed402ddf62 h1:+odtVYBzY6JfxkF6qLmq9SjW1A3X1fFN1CKkZoQwSME=
github.com/bitrise-io/bitrise-init v0.0.0-20211201163403-80ed402ddf62/go.mod h1:I9KSWJm177/IOBMQHzn6BLgymVLQ0xlv/gMwDCYkWYU=
github.com/bitrise-io/bitrise-init v0.0.0-20220125141216-6682bda67ae6 h1:S4p3zAStpUrqHqk+Rvkx0Ms56OYj5F3ei1PucXCRooM=
github.com/bitrise-io/bitrise-init v0.0.0-20220125141216-6682bda67ae6/go.mod h1:I9KSWJm177/IOBMQHzn6BLgymVLQ0xlv/gMwDCYkWYU=
github.com/bitrise-io/colorstring v0.0.0-20180614154802-a8cd70115192/go.mod h1:CIHVcxZUvsG99XUJV6JlR7okNsMMGY81jMvPC20W+O0=
github.com/bitrise-io/envman v0.0.0-20200512105748-919e33f391ee/go.mod h1:m8pTp1o3Sw9uzDxb1WRm5IBRnMau2iOvPMSnRCAhQNI=
github.com/bitrise-io/envman v0.0.0-20210517135508-b2b4fe89eac5/go.mod h1:m8pTp1o3Sw9uzDxb1WRm5IBRnMau2iOvPMSnRCAhQNI=
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ func main() {
failf("failed to expand path (%s), error: %s", cfg.ScanDirectory, err)
}

result, platformsDetected := scanner.GenerateScanResult(searchDir)
isPrivateRepo := cfg.SSHRsaPrivateKey != ""
result, platformsDetected := scanner.GenerateScanResult(searchDir, isPrivateRepo)

// Upload results
if resultClient != nil {
Expand Down
6 changes: 3 additions & 3 deletions submitresult.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (c *resultClient) uploadErrorResult(stepID string, err error) error {
func (c *resultClient) uploadResults(result models.ScanResultModel) error {
bytes, err := json.MarshalIndent(result, "", "\t")
if err != nil {
return fmt.Errorf("failed to marshal results, error: %v", err)
return fmt.Errorf("failed to marshal results: %v", err)
}

if err := retry.Times(1).Wait(5 * time.Second).Try(func(attempt uint) error {
Expand All @@ -100,9 +100,9 @@ func (c *resultClient) uploadResults(result models.ScanResultModel) error {

req, err := http.NewRequest(http.MethodPost, c.URL.String(), strings.NewReader(string(bytes)))
if err != nil {
return fmt.Errorf("faield to create http reques: %v", err)
return fmt.Errorf("failed to create request: %v", err)
}
req.Header.Add("Conent-Type", "application/json")
req.Header.Add("Content-Type", "application/json")

reqDump, err := httputil.DumpRequestOut(req, true)
if err != nil {
Expand Down
14 changes: 7 additions & 7 deletions vendor/github.com/bitrise-io/bitrise-init/scanner/config.go

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

11 changes: 5 additions & 6 deletions vendor/github.com/bitrise-io/bitrise-init/scanner/result.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.

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.

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.

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.

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.

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.

36 changes: 36 additions & 0 deletions vendor/github.com/bitrise-io/bitrise-init/steps/steps.go

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

Loading

0 comments on commit 2a02ab9

Please sign in to comment.