There are multiple ways of downloading or replacing project resources. We’ll go through the following examples:
- using the
ZIP resource archive downloader
step for downloading and extracting a ZIP file - using the
File Downloader
step to download a single file - using a
Script
Step
Using the ZIP resource archive downloader
Step ⚓
If you have your resources on your server in a zip archive, it’s very simple to download it:
- Add the
ZIP resource archive downloader
Step to your Workflow. - Specify the URL of the ZIP and the destination where the zip’s content should be uncompressed.
The source code of your app will be (by default) downloaded into the folder
defined in the $BITRISE_SOURCE_DIR
environment variable.
You can also place the content of your ZIP archive into a specific folder within your app’s source code directory. Just define the destination folder of the ZIP resource archive downloader
Step like this: ${BITRISE_SOURCE_DIR}/folder_name
or .folder_name
.
Using the File Downloader
Step ⚓
If you only want to download a single file, use the File Downloader
Step.
- Add the
File Downloader
Step to your Workflow. -
Specify the URL of the file and the destination where the file should be downloaded to.
- file-downloader: inputs: - source: $BITRISEIO_my_file_id_URL - destination: "$BITRISE_SOURCE_DIR/path/to/store/the/file"
Using a Script Step ⚓
If you want to control the whole download process, you can use the Script
step and write your own download code. For example:
#!/bin/bash
set -ex
# Download your resource
curl -fo "download/path" "https://url/of/your/resource"
# Uncompress it
unzip -u "download/path" -d "uncompress/target/path"
If you’d need an additional tool to download or uncompress the resources file, please see the Install Any Additional Tool guide.