Skip to content

Commit

Permalink
Merge pull request #2 from nitro-build/beta
Browse files Browse the repository at this point in the history
feat: support custom s3 cache provider config
  • Loading branch information
jpgarcia authored Dec 19, 2022
2 parents 88689d8 + 988f2b3 commit 7d3593c
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 41 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [4.3.0-beta.1](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.2.1...4.3.0-beta.1) (2022-12-19)


### Features

* add arguments to specify custom s3 cache provider config ([8a9cf9d](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/8a9cf9d182dbb02d710c0e5be968c139bfe5660a))

## [4.2.1](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.2.0...4.2.1) (2022-12-06)


Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ You can also run this step directly with [Bitrise CLI](https://github.com/bitris
| `cache_env_var_lookup_keys` | A list of `\|` separated values with env variable keys to lookup to determine whether the build should be cached or not | | |
| `cache_file_lookup_paths` | A list of `\|` separated value paths (relative to the root of the repo or absolute) to lookup in order to determine whether the build should be cached or not | | |
| `disable_metro_cache` | Setting this field to yes will disable the React Native Metro cache feature | | `$NITRO_DISABLE_METRO_CACHE` |
| `aws_s3_access_key_id` | Access Key Id for S3 bucket build caching | | `$NITRO_AWS_S3_ACCESS_KEY_ID` |
| `aws_s3_secret_access_key` | Secret Access Key for S3 bucket build caching | | `$NITRO_AWS_S3_SECRET_ACCESS_KEY` |
| `aws_s3_region` | AWS Region where S3 bucket for build caching is located | | `$NITRO_AWS_S3_REGION` |
| `aws_s3_bucket` | Bucket name for S3 bucket build caching | | `$NITRO_AWS_S3_BUCKET` |
| `pre_install_command` | Run command prior to install project dependencies (e.g. `rm -rf ./some-folder`) | | |
| `pre_build_command` | Run command prior to start building the app (e.g. `yarn tsc && yarn test`) | | |
| `post_build_command` | Run command once build successfully finished (e.g. `yarn publish`) | | |
Expand Down
74 changes: 37 additions & 37 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,49 +38,49 @@ workflows:
- command: semantic-release
test:
steps:
- change-workdir:
title: Switch working dir to test / _tmp dir
description: |-
To prevent step testing issues, like referencing relative
files with just './some-file' in the step's code, which would
work for testing the step from this directory directly
but would break if the step is included in another `bitrise.yml`.
run_if: true
inputs:
- path: ./_tmp
- is_create_path: true
- path::./:
title: Step Test
is_skippable: true
description: |-
Run Nitro with `fail_safe=true` to prevent build to fail. Next step validate NITRO_BUILD_STATUS should be
run_if: true
inputs:
- fail_safe: 'yes'
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
- change-workdir:
title: Switch working dir to test / _tmp dir
description: |-
To prevent step testing issues, like referencing relative
files with just './some-file' in the step's code, which would
work for testing the step from this directory directly
but would break if the step is included in another `bitrise.yml`.
run_if: "true"
inputs:
- path: ./_tmp
- is_create_path: true
- path::./:
title: Step Test
is_skippable: true
description: |-
Run Nitro with `fail_safe=true` to prevent build to fail. Next step validate NITRO_BUILD_STATUS should be
run_if: "true"
inputs:
- fail_safe: "yes"
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
if [[ "$NITRO_BUILD_STATUS" == "failed" ]]; then
echo "NITRO_BUILD_STATUS is 'failed', as expected"
exit 0
else
echo "NITRO_BUILD_STATUS is NOT 'failed', this is NOT expected."
exit 1
fi
if [[ "$NITRO_BUILD_STATUS" == "failed" ]]; then
echo "NITRO_BUILD_STATUS is 'failed', as expected"
exit 0
else
echo "NITRO_BUILD_STATUS is NOT 'failed', this is NOT expected."
exit 1
fi
# ----------------------------------------------------------------
# --- workflows to Share this step into a Step Library
audit-this-step:
steps:
- script:
inputs:
- content: |-
#!/bin/bash
set -ex
stepman audit --step-yml ./step.yml
- script:
inputs:
- content: |-
#!/bin/bash
set -ex
stepman audit --step-yml ./step.yml
trigger_map:
- push_branch: main
workflow: release
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bitrise-step-nitro-ios",
"version": "4.2.1",
"version": "4.3.0-beta.1",
"repository": "git@github.com:nitro-build/bitrise-step-nitro-ios.git",
"author": "Juan Pablo Garcia <juanpablogarcia@gmail.com>",
"license": "MIT",
Expand Down
20 changes: 18 additions & 2 deletions step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,22 @@ if [[ "${disable_metro_cache}" == "true" || "${disable_metro_cache}" == "yes" ]]
args+=("--disable-metro-cache")
fi

if [[ -n ${aws_s3_access_key_id} ]]; then
args+=("--aws-s3-access-key-id" "$aws_s3_access_key_id")
fi

if [[ -n ${aws_s3_secret_access_key} ]]; then
args+=("--aws-s3-secret-access-key" "$aws_s3_secret_access_key")
fi

if [[ -n ${aws_s3_region} ]]; then
args+=("--aws-s3-region" "$aws_s3_region")
fi

if [[ -n ${aws_s3_bucket} ]]; then
args+=("--aws-s3-bucket" "$aws_s3_bucket")
fi

# -----
# Hooks
# -----
Expand All @@ -154,9 +170,9 @@ if [[ -n ${post_build_command} ]]; then
args+=("--post-build-command" "${post_build_command}")
fi

# -----
# --------
# Advanced
# -----
# --------

if [[ -n ${output_directory} ]]; then
args+=("--output-directory" "${output_directory}")
Expand Down
26 changes: 25 additions & 1 deletion step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,35 @@ inputs:
is_expand: true
- disable_metro_cache: "$NITRO_DISABLE_METRO_CACHE"
opts:
category: "Advanced"
category: "Caching"
title: "Disable Metro bundler cache"
summary: "Setting this field to `yes` will disable the React Native Metro cache feature"
description: "Setting this field to yes will disable the React Native Metro cache feature"
is_expand: true
- aws_s3_access_key_id: "$NITRO_AWS_S3_ACCESS_KEY_ID"
opts:
category: "Caching"
title: "AWS S3 access key ID"
summary: "AWS access key ID for S3 bucket build caching"
is_expand: true
- aws_s3_secret_access_key: "$NITRO_AWS_S3_SECRET_ACCESS_KEY"
opts:
category: "Caching"
title: "AWS S3 secret access key"
summary: "AWS secret access key for S3 bucket build caching"
is_expand: true
- aws_s3_region: "$NITRO_AWS_S3_REGION"
opts:
category: "Caching"
title: "AWS S3 region"
summary: "AWS region where S3 bucket for build caching is located"
is_expand: true
- aws_s3_bucket: "$NITRO_AWS_S3_BUCKET"
opts:
category: "Caching"
title: "AWS S3 bucket name"
summary: "AWS bucket name for S3 bucket build caching"
is_expand: true

# Hooks
- pre_install_command:
Expand Down

0 comments on commit 7d3593c

Please sign in to comment.