Skip to content

Commit

Permalink
Specify octal literal for permission flags of workspace directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanjli committed Apr 27, 2023
1 parent 6851f98 commit ff800b8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## 0.1.2 - 2023-04-26

### Fixed

- Set correct file permission flags when making the forklift workspace if it doesn't already exist

## 0.1.1 - 2023-04-26

### Added
Expand Down
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,28 @@ This repository provides `forklift`, a Git-based command-line tool for installin

## Usage

First, you will need to clone a Pallet environment to your local environment. For example, you can clone the latest unstable version (on the `edge` branch) of the [`github.com/PlanktoScope/pallets-env`](https://github.com/PlanktoScope/pallets-env) environment using the command:
First, you will need to download forklift, which is available as a single self-contained executable file. You should visit this repository's [releases page](https://github.com/PlanktoScope/forklift/releases/latest) and download an archive file for your platform and CPU architecture; for example, on a Raspberry Pi 4, you should download the archive named `forklift_{version number}_linux_arm.tar.gz` (where the version number should be substituted). You can extract the forklift binary from the archive using a command like:
```
tar -xzf forklift_{version number}_{os}_{cpu architecture}.tar.gz forklift
```

Then you may need to move the forklift binary into a directory in your system path, or you can just run the forklift binary in your current directory (in which case you should replace `forklift` with `./forklift` in the commands listed below).

Once you have forklift, you will need to clone a Pallet environment to your local environment. For example, you can clone the latest unstable version (on the `edge` branch) of the [`github.com/PlanktoScope/pallets-env`](https://github.com/PlanktoScope/pallets-env) environment using the command:
```
forklift env clone github.com/PlanktoScope/pallets-env@edge
```

Then you will need to download the Pallet repositories specified by your local environment into your local cache, so that you can deploy packages provided by those repositories. You can do download the necessary repositories using the command:
Then you will need to download the Pallet repositories specified by your local environment into your local cache, so that you can deploy packages provided by those repositories. You can download the necessary repositories using the command:
```
forklift env cache
```

Then you will need to apply the package deployments as configured by your local environment, into your Docker Swarm. You can apply the deployments using the command:
```
forklift env deploy
```

## Licensing

Except where otherwise indicated, source code provided here is covered by the following information:
Expand Down
6 changes: 4 additions & 2 deletions cmd/forklift/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ func main() {
var defaultWorkspaceBase, _ = os.UserHomeDir()

var app = &cli.App{
Name: "forklift",
Version: "v0.1.0",
Name: "forklift",
// TODO: see if there's a way to get the version from a build tag, so that we don't have to update
// this manually
Version: "v0.1.2",
Usage: "Manages Pallet repositories and package deployments",
Commands: []*cli.Command{
envCmd,
Expand Down
2 changes: 1 addition & 1 deletion internal/app/forklift/workspace/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func Exists(path string) bool {
}

func EnsureExists(path string) error {
const perm = 755 // owner rwx, group rx, public rx
const perm = 0o755 // owner rwx, group rx, public rx
return os.MkdirAll(path, perm)
}

Expand Down

0 comments on commit ff800b8

Please sign in to comment.