diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100755 index 01a3844..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,33 +0,0 @@ -## Changelog (Current version: 0.0.4) - ------------------ -### 0.0.1 (2016 Oct 20) - -* [d12e256] first commit - -### 0.0.2 (2016 Oct 20) - -* [9b65131] Added audit-this-step. Checked for yarn dependency. - -### 0.0.3 (2016 Oct 20) - -* [107ab5c] Fixed step lib source path. Fixed project type tags. Updated descriptions. -* [c0ec93e] Fixed default_step_lib_source. -* [6336074] Changed is_skippable to false. - -### 0.0.4 (2016 Nov 30) - -* [5ca8f3b] Added dependency check for Ubuntu - -### 0.0.5 (2018 Mar 29) - -* [f2be21c] Print Yarn version to make debugging easier @trapacska - -### 0.0.6 (2018 Mar 29) - -* [c179b90] Fixed input arguments - now will correctly run arguments added in Bitrise @viktorbenei -* [6e2698c] Fix: removed incorrect project_type_tags and type_tags - -### 0.0.7 (2018 Mar 29) - -* [f3e70f8] Updated ubuntu installation to match instructions on https://yarnpkg.com/en/docs/install \ No newline at end of file diff --git a/LICENSE b/LICENSE index ec518f4..021df7b 100755 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Jonathan Irwin +Copyright (c) 2015 bitrise-steplib Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index a11cb6a..fd39e62 100755 --- a/README.md +++ b/README.md @@ -1,2 +1,93 @@ # yarn step + [Bitrise](https://bitrise.io) build step for running [`yarn`](https://yarnpkg.com) commands. + +## How to use this Step + +Can be run directly with the [bitrise CLI](https://github.com/bitrise-io/bitrise), +just `git clone` this repository, `cd` into it's folder in your Terminal/Command Line +and call `bitrise run test`. + +*Check the `bitrise.yml` file for required inputs which have to be +added to your `.bitrise.secrets.yml` file!* + +Step by step: + +1. Open up your Terminal / Command Line +2. `git clone` the repository +3. `cd` into the directory of the step (the one you just `git clone`d) +5. Create a `.bitrise.secrets.yml` file in the same directory of `bitrise.yml` + (the `.bitrise.secrets.yml` is a git ignored file, you can store your secrets in it) +6. Check the `bitrise.yml` file for any secret you should set in `.bitrise.secrets.yml` + * Best practice is to mark these options with something like `# define these in your .bitrise.secrets.yml`, in the `app:envs` section. +7. Once you have all the required secret parameters in your `.bitrise.secrets.yml` you can just run this step with the [bitrise CLI](https://github.com/bitrise-io/bitrise): `bitrise run test` + +An example `.bitrise.secrets.yml` file: + +``` +envs: +- A_SECRET_PARAM_ONE: the value for secret one +- A_SECRET_PARAM_TWO: the value for secret two +``` + +## How to create your own step + +1. Create a new git repository for your step (**don't fork** the *step template*, create a *new* repository) +2. Copy the [step template](https://github.com/bitrise-steplib/step-template) files into your repository +3. Fill the `step.sh` with your functionality +4. Wire out your inputs to `step.yml` (`inputs` section) +5. Fill out the other parts of the `step.yml` too +6. Provide test values for the inputs in the `bitrise.yml` +7. Run your step with `bitrise run test` - if it works, you're ready + +__For Step development guidelines & best practices__ check this documentation: [https://github.com/bitrise-io/bitrise/blob/master/_docs/step-development-guideline.md](https://github.com/bitrise-io/bitrise/blob/master/_docs/step-development-guideline.md). + +**NOTE:** + +If you want to use your step in your project's `bitrise.yml`: + +1. git push the step into it's repository +2. reference it in your `bitrise.yml` with the `git::PUBLIC-GIT-CLONE-URL@BRANCH` step reference style: + +``` +- git::https://github.com/user/my-step.git@branch: + title: My step + inputs: + - my_input_1: "my value 1" + - my_input_2: "my value 2" +``` + +You can find more examples of step reference styles +in the [bitrise CLI repository](https://github.com/bitrise-io/bitrise/blob/master/_examples/tutorials/steps-and-workflows/bitrise.yml#L65). + +## How to contribute to this Step + +1. Fork this repository +2. `git clone` it +3. Create a branch you'll work on +4. To use/test the step just follow the **How to use this Step** section +5. Do the changes you want to +6. Run/test the step before sending your contribution + * You can also test the step in your `bitrise` project, either on your Mac or on [bitrise.io](https://www.bitrise.io) + * You just have to replace the step ID in your project's `bitrise.yml` with either a relative path, or with a git URL format + * (relative) path format: instead of `- original-step-id:` use `- path::./relative/path/of/script/on/your/Mac:` + * direct git URL format: instead of `- original-step-id:` use `- git::https://github.com/user/step.git@branch:` + * You can find more example of alternative step referencing at: https://github.com/bitrise-io/bitrise/blob/master/_examples/tutorials/steps-and-workflows/bitrise.yml +7. Once you're done just commit your changes & create a Pull Request + + +## Share your own Step + +You can share your Step or step version with the [bitrise CLI](https://github.com/bitrise-io/bitrise). If you use the `bitrise.yml` included in this repository, all you have to do is: + +1. In your Terminal / Command Line `cd` into this directory (where the `bitrise.yml` of the step is located) +1. Run: `bitrise run test` to test the step +1. Run: `bitrise run audit-this-step` to audit the `step.yml` +1. Check the `share-this-step` workflow in the `bitrise.yml`, and fill out the + `envs` if you haven't done so already (don't forget to bump the version number if this is an update + of your step!) +1. Then run: `bitrise run share-this-step` to share the step (version) you specified in the `envs` +1. Send the Pull Request, as described in the logs of `bitrise run share-this-step` + +That's all ;) + diff --git a/bitrise.yml b/bitrise.yml index 791e77f..1fa2d3a 100755 --- a/bitrise.yml +++ b/bitrise.yml @@ -4,32 +4,36 @@ default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git app: envs: - RELEASE_VERSION: 0.0.6 + - SAMPLE_APP_URL: https://github.com/bitrise-samples/react-native-expo.git workflows: test: + before_run: + - audit-this-step steps: + - script: + inputs: + - content: |- + #!/bin/bash + set -ex + rm -rf "./_tmp" + mkdir "_tmp" + - change-workdir: + title: Switch working dir to test / _tmp dir + run_if: true + inputs: + - path: ${BITRISE_SOURCE_DIR}/_tmp + - is_create_path: true + - script: + title: Clone sample app + inputs: + - content: git clone $SAMPLE_APP_URL . - path::./: inputs: # - workdir: $BITRISE_SOURCE_DIR # - command: install # - options: -d -ll - # ---------------------------------------------------------------- - # --- workflow to create Release version - create-release: - steps: - - script: - title: - inputs: - - content: | - #!/bin/bash - set -ex - go get -u github.com/bitrise-tools/releaseman - export CI=true - releaseman create --version "$RELEASE_VERSION" - - # ---------------------------------------------------------------- - # --- workflows to Share this step into a Step Library audit-this-step: steps: - script: @@ -39,38 +43,3 @@ workflows: set -ex stepman audit --step-yml ./step.yml -# ---------------------------------------------------------------- -# --- workflows to Share this step into a Step Library - share-this-step: - envs: - # if you want to share this step into a StepLib - - MY_STEPLIB_REPO_FORK_GIT_URL: https://github.com/SovTech/bitrise-steplib.git - - STEP_ID_IN_STEPLIB: yarn - - STEP_GIT_VERION_TAG_TO_SHARE: $RELEASE_VERSION - - STEP_GIT_CLONE_URL: https://github.com/jonoirwinrsa/steps-yarn.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. - steps: - - script: - inputs: - - content: |- - #!/bin/bash - set -e - set -x - 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 diff --git a/release_config.yml b/release_config.yml deleted file mode 100755 index 4a1f737..0000000 --- a/release_config.yml +++ /dev/null @@ -1,13 +0,0 @@ -release: - development_branch: master - release_branch: master -changelog: - path: CHANGELOG.md - content_template: |- - {{range .ContentItems}}### {{.EndTaggedCommit.Tag}} ({{.EndTaggedCommit.Date.Format "2006 Jan 02"}}) - - {{range .Commits}}* [{{firstChars .Hash 7}}] {{.Message}} - {{end}} - {{end}} - header_template: '## Changelog (Current version: {{.Version}})' - footer_template: 'Updated: {{.CurrentDate.Format "2006 Jan 02"}}' diff --git a/step.yml b/step.yml index 20c61be..6aacae0 100755 --- a/step.yml +++ b/step.yml @@ -1,9 +1,9 @@ title: Run yarn command summary: Runs `yarn` with the given command and args. description: Runs `yarn` with the given command and args. -website: https://github.com/jonoirwinrsa/steps-yarn -source_code_url: https://github.com/jonoirwinrsa/steps-yarn -support_url: https://github.com/jonoirwinrsa/steps-yarn/issues +website: https://github.com/bitrise-community/steps-yarn +source_code_url: https://github.com/bitrise-community/steps-yarn +support_url: https://github.com/bitrise-community/steps-yarn/issues host_os_tags: - osx-10.11 type_tags: