Skip to main content

Create your first project

This tutorial walks through creating a project, adding a repository to it, and using the CLI to push a file and pull it back.

What you will accomplish​

By the end of this tutorial you will have:

  • A project in your account
  • A repository inside that project
  • A file pushed to the repository and pulled back successfully

Before you begin​

What you push is billed as account storage, and pulling files to your own machine as egress; see How billing works.

Steps​

1. Create a project​

swale project create my-first-project

A project holds your repositories, workflows and project secrets.

2. Create a repository​

swale repo create --project-name my-first-project --repository-name my-repo

A repository keeps files across runs, as named snapshots called tags.

3. Push a file​

Create a small test file in a local directory:

mkdir /tmp/my-data
echo "hello world" > /tmp/my-data/test.txt

Push the directory to the repository:

swale push my-first-project/my-repo:latest --path /tmp/my-data

my-first-project/my-repo:latest names the project, the repository and the tag. The tag defaults to latest if you omit :tag. The command ends with a line saying how many files the tag now holds.

4. Pull the file back​

Pull the repository contents to a different local directory to confirm the round-trip:

swale pull my-first-project/my-repo:latest --path /tmp/my-pulled-data
cat /tmp/my-pulled-data/test.txt

You should see hello world printed to the terminal.

Next steps​