Upload a Local File
Overviewβ
In this tutorial, you'll learn how to upload a file from your computer to Shipyard that can be used in a Fleet. This can be helpful to upload static credential or reference files, such as RSA keys.
By the end of the tutorial, you'll be able to:
- Upload a script to Shipyard.
- Check Logs to verify that your local file was uploaded.
We do not recommend using this process to upload dynamic data files. We recommend that you download data files using our Library Blueprints.
Setupβ
First, download this zip file, named upload_rsa.zip
to your computer without making any changes.
Feel free to peruse this zip file beforehand so you understand the contents and purpose. The zip file contains two files:
upload_rsa.sh
- A bash script that prints a success message and returns a 0 exit code.id_rsa
- The RSA key file to be uploaded into Shipyard.
Stepsβ
Using the sidebar, click + New Fleet. You'll now be on the Fleet builder canvas. Next we'll walk through the process of building the required Vessel to upload the file to Shipyard
Step 1 - Create a Code Vesselβ
- Click Bash under the Code Vessels dropdown.
- Under Vessel Name, enter
Upload RSA File
. - Under the Code dropdown in the File to Run input, type
upload_rsa.sh
. - Click the Upload toggle option.
- Click the Upload File button and select the
upload_rsa.zip
downloaded in the Setup section above.
When you upload files to Shipyard using this method, they will be automatically unzipped. Only a single specified file (in this tutorial, upload_rsa.sh
) can ever be run per Vessel. Future downstream Vessels can run and access the files in the zipped file.
Step 2 - Create a Vessel to Check Shipyard File Systemβ
- Click the Add Vessel button to add a second Vessel.
- Click Bash to add a Bash code Vessel.
- Under Vessel Name, enter
List All Files
. - Under File to Run, enter
list_files.sh
. - Under Code, enter
ls -laR
. - Connect the Upload RSA File and List All Files Vessels.
Step 3 - Name your Fleetβ
- Click the cog for Fleet Settings on the left side of the Fleet Builder.
- Under Fleet Name, enter
Upload RSA File to Shipyard
.
- Click Save & Finish on the bottom right corner of your screen. This will redirect you to a page that lets you know that your Fleet has been created successfully.
- Click Run Your Fleet. This will redirect you to the Fleet Log page.
Step 4 - Check for your Fileβ
- Wait for your Fleet to complete running with a status of Success.
- Click the green rectangle for the List All Files Vessel.
- This takes you to the Vessel Log.
- You are able to see the
id_rsa
file that we wanted to upload from our computer in the Shipyard file system.
You have successfully created a Fleet with a Vessel that can upload a file to use in Shipyard from your local file system.
Use this process in any of your own Fleets by connecting the "Upload Local File Vessel" before another Vessel.