Skip to content

Commit

Permalink
Fix json schema validation issues. (#82)
Browse files Browse the repository at this point in the history
* Fix json schema validation issues.

* Update README

* Update verbose input

* Better error message for pod install command

* Bump pinned ruby version to 2.7.0

* Revert to Ruby 2.6 in E2E test

* Pin Ruby 2.6.4

* Use sample with Gemfile for pinned E2E test

* Add new E2E sample test

Co-authored-by: Olivér Falvai <oliver.falvai@bitrise.io>
  • Loading branch information
godrei and ofalvai authored Jan 17, 2022
1 parent 85f8fdd commit 22238b3
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 33 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

[![Step changelog](https://shields.io/github/v/release/bitrise-io/steps-cocoapods-install?include_prereleases&label=changelog&color=blueviolet)](https://github.com/bitrise-io/steps-cocoapods-install/releases)

You don't need to keep the installed Pods in your repo. Simply add this Step
and Bitrise will do the Pod install for you on the VM!
This Step uses CocoaPods' `pod install` or `pod update` command to install your dependencies.

<details>
<summary>Description</summary>


CocoaPods is a dependency manager for Swift and Objective-C projects. This Step uses CocoaPods' `pod install` or `pod update` command to install your dependencies on the virtual machine where your Bitrise build runs.
CocoaPods is a dependency manager for Swift and Objective-C projects. This Step uses CocoaPods' `pod install` or `pod update` command to install your dependencies on the virtual machine where your Bitrise build runs.

CocoaPods version is determined based on the Podfile.lock file or on the Gemfile.lock file. If your Gemfile.lock file contains the `cocoapods` gem, then the Step will call the pod `install` command with `bundle exec`. Otherwise, the Cocoapods version in the Podfile.lock will be installed as a global gem.
If no Cocoapods version is defined in Podfile.lock or Gemfile.lock, the preinstalled sytem Cocoapods version will be used.

Expand All @@ -23,7 +23,8 @@ If no Cocoapods version is defined in Podfile.lock or Gemfile.lock, the preinsta

### Troubleshooting

If the Step fails, check out the Podfile and the Gemfile of your app. Make sure there is no compatibility issue with the different versions of your Pods.
If the Step fails, check out the Podfile and the Gemfile of your app. Make sure there is no compatibility issue with the different versions of your Pods.

Check that both Podfile.lock and Gemfile.lock is committed and the Cocoapods versions defined in both match.

You can set the **Execute cocoapods in verbose mode?** input to true to get detailed logs of the Step.
Expand Down Expand Up @@ -52,11 +53,11 @@ You can also run this step directly with [Bitrise CLI](https://github.com/bitris

| Key | Description | Flags | Default |
| --- | --- | --- | --- |
| `command` | Use pod `install` to download the explicit version listed in the Podfile.lock without trying to check if a newer version is available. Use pod `update` to update every Pod listed in your Podfile to the latest version possible. | required | `install` |
| `source_root_path` | Directory path where the project's Podfile (and optionally Gemfile) is placed. CocoaPods commands will be executed in this directory. | required | `$BITRISE_SOURCE_DIR` |
| `podfile_path` | By specifying this input `Workdir` gets overriden by the provided file's directory path. | | |
| `verbose` | If enabled the `--verbose` flag will be appended to all CocoaPods commands. | | `false` |
| `is_cache_disabled` | By default the Step adds the Pods directory in the `Workdir` to the Bitrise Build Cache. Set this input to disable automatic cache item collection for this Step. | | `false` |
| `command` | CocoaPods command to use for installing dependencies. Available options: - `install`: Use `pod install` to download the explicit version listed in the Podfile.lock without trying to check if a newer version is available. - `update`: Use `pod update` to update every Pod listed in your Podfile to the latest version possible. | required | `install` |
| `source_root_path` | Directory path where the project's Podfile (and optionally Gemfile) is placed. CocoaPods commands will be executed in this directory. | required | `$BITRISE_SOURCE_DIR` |
| `podfile_path` | Path of the project's Podfile. By specifying this input `Workdir` gets overriden by the provided file's directory path. | | |
| `verbose` | Execute all CocoaPods commands in verbose mode. If enabled the `--verbose` flag will be appended to all CocoaPods commands. | | `false` |
| `is_cache_disabled` | Disables automatic cache content collection. By default the Step adds the Pods directory in the `Workdir` to the Bitrise Build Cache. Set this input to disable automatic cache item collection for this Step. | | `false` |
</details>

<details>
Expand Down
22 changes: 16 additions & 6 deletions e2e/bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ workflows:
test_with_no_podfile_lock:
envs:
# With Only Gemfile (no Podfile.lock):
- TEST_APP_URL: https://github.com/bitrise-samples/ios-cocoapods-1.x-Gemfile.git
- TEST_APP_URL: https://github.com/bitrise-io/ios-cocoapods-1.x-Gemfile.git
- TEST_APP_BRANCH: no-podfile-lock
- COMMAND: install
after_run:
Expand All @@ -22,7 +22,7 @@ workflows:
test_update_with_gemfile:
envs:
# With Gemfile:
- TEST_APP_URL: https://github.com/bitrise-samples/ios-cocoapods-1.x-Gemfile.git
- TEST_APP_URL: https://github.com/bitrise-io/ios-cocoapods-1.x-Gemfile.git
- TEST_APP_BRANCH: master
- COMMAND: update
after_run:
Expand All @@ -32,7 +32,7 @@ workflows:
test_without_gemfile:
envs:
# Without Gemfile:
- TEST_APP_URL: https://github.com/bitrise-samples/ios-cocoapods-1.x.git
- TEST_APP_URL: https://github.com/bitrise-io/ios-cocoapods-1.x.git
- TEST_APP_BRANCH: master
- COMMAND: install
after_run:
Expand All @@ -42,7 +42,7 @@ workflows:
test_without_gemfile_with_podfile_path:
envs:
# Without Gemfile:
- TEST_APP_URL: https://github.com/bitrise-samples/ios-cocoapods-1.x.git
- TEST_APP_URL: https://github.com/bitrise-io/ios-cocoapods-1.x.git
- TEST_APP_BRANCH: master
- PODFILE_PTH: CocoaPods1X/Podfile
- COMMAND: install
Expand All @@ -53,7 +53,7 @@ workflows:
test_with_verbose:
envs:
# With Gemfile:
- TEST_APP_URL: https://github.com/bitrise-samples/ios-cocoapods-1.x-Gemfile.git
- TEST_APP_URL: https://github.com/bitrise-io/ios-cocoapods-1.x-Gemfile.git
- TEST_APP_BRANCH: master
- COMMAND: install
- VERBOSE: "true"
Expand All @@ -64,7 +64,7 @@ workflows:
test_with_specific_ruby:
envs:
# Podfile is in repo root
- TEST_APP_URL: https://github.com/bitrise-samples/ios-cocoapods-1.x.git
- TEST_APP_URL: https://github.com/bitrise-io/ios-cocoapods-1.x-Gemfile.git
- TEST_APP_BRANCH: master
- COMMAND: install
- PIN_RUBY: "true"
Expand All @@ -82,6 +82,15 @@ workflows:
- _run
- _check_cache_include_paths

test_recent_cocoapods:
envs:
- TEST_APP_URL: https://github.com/bitrise-io/Bitrise-iOS-Cocoapods-Sample.git
- TEST_APP_BRANCH: main
- COMMAND: install
after_run:
- _run
- _check_cache_include_paths

_run:
steps:
- script:
Expand All @@ -98,6 +107,7 @@ workflows:
- script:
run_if: |-
{{ enveq "PIN_RUBY" "true" }}
title: Pin Ruby version
inputs:
- content: |-
#!/bin/bash
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ func main() {

cmd.SetDir(podfileDir)

if err := cmd.Run(); err != nil {
failf("Command failed, error: %s", err)
if out, err := cmd.RunAndReturnTrimmedCombinedOutput(); err != nil {
failf("Command failed: %s\noutput: %s", err, out)
}
}
} else {
Expand Down
45 changes: 29 additions & 16 deletions step.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
title: Run CocoaPods install
summary: |-
You don't need to keep the installed Pods in your repo. Simply add this Step
and Bitrise will do the Pod install for you on the VM!
summary: This Step uses CocoaPods' `pod install` or `pod update` command to install your dependencies.
description: |-
CocoaPods is a dependency manager for Swift and Objective-C projects. This Step uses CocoaPods' `pod install` or `pod update` command to install your dependencies on the virtual machine where your Bitrise build runs.
Expand Down Expand Up @@ -37,8 +35,7 @@ description: |-
website: https://github.com/bitrise-io/steps-cocoapods-install
source_code_url: https://github.com/bitrise-io/steps-cocoapods-install
support_url: https://github.com/bitrise-io/steps-cocoapods-install/issues
host_os_tags:
- osx-10.10

project_type_tags:
- ios
- macos
Expand All @@ -48,7 +45,7 @@ project_type_tags:
- flutter
type_tags:
- dependency
is_requires_admin_user: true

is_always_run: false
is_skippable: false
toolkit:
Expand All @@ -58,39 +55,55 @@ inputs:
- command: install
opts:
title: CocoaPods command
description: |-
Use pod `install` to download the explicit version listed in the Podfile.lock without trying to check if a newer version is available.
Use pod `update` to update every Pod listed in your Podfile to the latest version possible.
summary: CocoaPods command to use for installing dependencies.
description: |
CocoaPods command to use for installing dependencies.
Available options:
- `install`: Use `pod install` to download the explicit version listed in the Podfile.lock without trying to check if a newer version is available.
- `update`: Use `pod update` to update every Pod listed in your Podfile to the latest version possible.
is_required: true
value_options:
- install
- update
- source_root_path: $BITRISE_SOURCE_DIR
opts:
title: Workdir
description: |-
summary: Directory path where the project's Podfile (and optionally Gemfile) is placed.
description: |
Directory path where the project's Podfile (and optionally Gemfile) is placed.
CocoaPods commands will be executed in this directory.
is_required: true
- podfile_path: ""
opts:
title: Podfile path
summary: Path of the project's Podfile.
description: |-
Path of the project's Podfile.
By specifying this input `Workdir` gets overriden by the provided file's directory path.
- verbose: "false"
opts:
title: Execute all CocoaPods commands in verbose mode?
title: Enable verbose logging
summary: Execute all CocoaPods commands in verbose mode.
description: |
Execute all CocoaPods commands in verbose mode.
If enabled the `--verbose` flag will be appended to all CocoaPods commands.
value_options:
- true
- false
- "true"
- "false"
- is_cache_disabled: "false"
opts:
title: Disable automatic cache item collection
title: Disable collecting cache content
summary: Disables automatic cache content collection.
description: |
Disables automatic cache content collection.
By default the Step adds the Pods directory in the `Workdir` to the Bitrise Build Cache.
Set this input to disable automatic cache item collection for this Step.
value_options:
- true
- false
- "true"
- "false"

0 comments on commit 22238b3

Please sign in to comment.