Skip to content

Commit

Permalink
bitrise.yml update (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
BirmacherAkos authored and trapacska committed Nov 7, 2019
1 parent fe6bf24 commit 9654515
Showing 1 changed file with 15 additions and 131 deletions.
146 changes: 15 additions & 131 deletions bitrise.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
format_version: 1.3.1
format_version: 9
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git

app:
envs:
- STEP_VERSION: 1.0.4

workflows:
test:
before_run:
- go-tests
- audit-this-step
steps:
- go-list:
- golint:
- errcheck:
- go-test:
- change-workdir:
inputs:
- path: _tmp
Expand Down Expand Up @@ -57,98 +57,22 @@ workflows:
[[ $(grep -c -- '-s emulator-5554 shell getprop dev.bootcomplete' ./adb_log) == "3" ]] ||
exit 1
go-tests:
before_run:
- _install-test-tools
steps:
- script:
title: Export go files to test
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
no_vendor_paths="$(go list ./... | grep -v vendor)"
envman add --key GOLIST_WITHOUT_VENDOR --value "$no_vendor_paths"
- script:
title: Err check
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
errcheck -asserts=true -blank=true $GOLIST_WITHOUT_VENDOR
- script:
title: Go lint
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
while read -r line; do
echo "-> Linting: $line"
golint_out="$(golint $line)"
if [[ "${golint_out}" != "" ]] ; then
echo "=> Golint issues found:"
echo "${golint_out}"
exit 1
fi
done <<< "$GOLIST_WITHOUT_VENDOR"
- script:
title: Go test
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
go test ./...
_install-test-tools:
steps:
- script:
title: Install required testing tools
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
# Check for unhandled errors
go get -u -v github.com/kisielk/errcheck
# Go lint
go get -u -v github.com/golang/lint/golint
# ----------------------------------------------------------------
# --- Utility workflows
godeps-update:
title: Godeps update
dep-update:
title: Dep update
description: |
Used for updating bitrise dependencies with dep
steps:
- script:
title: Dependency update
inputs:
- content: |
#!/usr/bin/env bash
- content: |-
#!/bin/bash
set -ex
go get -u -v github.com/tools/godep
rm -rf ./Godeps
rm -rf ./vendor
go get -t -d ./...
godep save ./...
# ----------------------------------------------------------------
# --- workflows to create Release
create-release:
steps:
- script:
title:
inputs:
- content: |
#!/usr/bin/env bash
set -e
export CI=true
releaseman create --version $STEP_VERSION
go get -u -v github.com/golang/dep/cmd/dep
dep ensure -v
dep ensure -v -update
# ----------------------------------------------------------------
# --- workflows to Share this step into a Step Library
Expand All @@ -160,43 +84,3 @@ workflows:
#!/usr/bin/env bash
set -ex
stepman audit --step-yml ./step.yml
share-this-step:
envs:
# if you want to share this step into a StepLib
- MY_STEPLIB_REPO_FORK_GIT_URL: $MY_STEPLIB_REPO_FORK_GIT_URL
- STEP_ID_IN_STEPLIB: wait-for-android-emulator
- STEP_GIT_VERION_TAG_TO_SHARE: $STEP_VERSION
- STEP_GIT_CLONE_URL: https://github.com/bitrise-steplib/steps-wait-for-android-emulator.git
description: |-
If this is the first time you try to share a Step you should
first call: $ bitrise share
This will print you a guide, and information about how Step sharing
works. Please read it at least once!
As noted in the Step sharing guide you'll have to fork the
StepLib you want to share this step into. Once you're done with forking
the repository you should set your own fork's git clone URL
in the `.bitrise.secrets.yml` file, or here in the `envs` section,
as the value of the `MY_STEPLIB_REPO_FORK_GIT_URL` environment.
You're now ready to share this Step, just make sure that
the `STEP_ID_IN_STEPLIB` and `STEP_GIT_VERION_TAG_TO_SHARE`
environments are set to the desired values!
To share this Step into a StepLib you can just run: $ bitrise run share-this-step
Once it finishes the only thing left is to actually create a Pull Request,
the way described in the guide printed at the end of the process.
before_run:
- audit-this-step
steps:
- script:
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
bitrise share start -c ${MY_STEPLIB_REPO_FORK_GIT_URL}
bitrise share create --stepid ${STEP_ID_IN_STEPLIB} --tag ${STEP_GIT_VERION_TAG_TO_SHARE} --git ${STEP_GIT_CLONE_URL}
bitrise share finish

0 comments on commit 9654515

Please sign in to comment.