Skip to content

Commit 441e946

Browse files
committed
updated readme
1 parent b6720bb commit 441e946

File tree

3 files changed

+92
-79
lines changed

3 files changed

+92
-79
lines changed

README.md

+92-79
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,97 @@ Hash-pining for your OSS dependencies
55

66
Pinny currently supports pinning Dockerfiles and Github Actions workflows.
77

8-
## Installation
8+
<hr />
9+
* Contents
10+
* [Example](#example)
11+
* [Pinning Github Actions workflows](#pinning-github-actions-workflows)
12+
* [Pinning Dockerfiles](#pinning-dockerfiles)
13+
* [Usage](#usage)
14+
* [Github Actions](#github-actions)
15+
* [Dockerfiles](#dockerfiles)
16+
* [Installation](#installation)
17+
* [Docker image](#docker-image)
18+
* [Precompiled binary](#precompiled-binary)
19+
20+
## Example:
21+
* #### Pinning Github Actions workflows
22+
![actions-pin-before-after.png](assets/imgs/actions-pin-before-after.png)
23+
* ##### Sample run on the Github workflows of Akto Github repository
24+
![actions-pin.gif](assets/gifs/actions-pin.gif)
25+
26+
* #### Pinning Dockerfiles
27+
![docker-pin-before-after.png](assets/imgs/docker-pin-before-after.png)
28+
* ##### Sample run on the Dockerfile of Metabase Github repository
29+
![docker-pin.gif](assets/gifs/docker-pin.gif)
30+
31+
## Usage:
32+
* #### Github Actions
33+
To pin your Github Actions workflows, run the following command in your repository root. This will transform all the workflows in your repository to use pinned versions of the actions.
34+
```bash
35+
pinny actions pin
36+
```
37+
or if you are being rate limited by Github's API
38+
```bash
39+
GITHUB_TOKEN=<your_token> pinny actions pin
40+
```
41+
You can use the `--dry-run` flag to see what changes will be made before actually making them.
42+
43+
To learn more
44+
```bash
45+
pinny actions --help
46+
```
47+
48+
* #### Dockerfiles
49+
Pinny supports two workflows for pinning of dockerfiles.
50+
1. ##### Pinning your files locally before you commit them
51+
To pin your Dockerfile, run the following command in your repository root. This will look for file named `Dockerfile` in your repository root and will create a new file named `Dockerfile.pinned` with pinned versions of all the base images.
52+
```bash
53+
pinny docker pin
54+
```
55+
Use `--inplace` or `-i` flag to overwrite the original Dockerfile instead of creating a new file.
56+
```bash
57+
pinny docker pin --inplace
58+
```
59+
Use `--file` or `-f` flag to specify a different file name.
60+
```bash
61+
pinny docker pin --file Dockerfile.dev
62+
```
63+
64+
1. ##### Generate and commit a lock file and pin your dockerfiles in CI
65+
* ###### Generate a lock file
66+
To generate a lock file, run the following command in your repository root. This will look for file named `Dockerfile` in your repository root and will create a file named `pinny-lock.json` with pinned versions of all the base images.
67+
```bash
68+
pinny docker lock
69+
```
70+
Use `--file` or `-f` flag to specify a different file name.
71+
```bash
72+
pinny docker lock --file Dockerfile.dev
73+
```
74+
75+
To learn more
76+
```bash
77+
pinny docker lock --help
78+
```
79+
* ###### Tranform your dockerfiles in CI
80+
Once you have committed the lock file, you can use the following command in your CI to transform your dockerfiles to use pinned versions of the base images.
81+
```bash
82+
pinny docker transform
83+
```
84+
Use `--file` or `-f` flag to specify a different file name.
85+
```bash
86+
pinny docker transform --file Dockerfile.dev
87+
```
88+
Use `--inplace` or `-i` flag to overwrite the original Dockerfile instead of creating a new file.
89+
```bash
90+
pinny docker transform --inplace
91+
```
92+
`This command requires you have a file named pinny-lock.json.`<br/>
93+
To learn more
94+
```bash
95+
pinny docker tranform --help
96+
```
97+
98+
## Installation:
999
* #### Docker image
10100
Get the version from the releases section and run the following command(Replace 0.0.6 with the version you want to use)
11101
```bash
@@ -30,81 +120,4 @@ Pinny currently supports pinning Dockerfiles and Github Actions workflows.
30120
On MacOS, if you get an error like `Cannot Verify That This App is Free from Malware` Or `This app is from an unidentified developer`, you can run the following command to allow the binary to run
31121
```bash
32122
sudo xattr -d com.apple.quarantine /usr/local/bin/pinny
33-
```
34-
35-
## Usage
36-
### Github Actions
37-
To pin your Github Actions workflows, run the following command in your repository root. This will transform all the workflows in your repository to use pinned versions of the actions.
38-
```bash
39-
pinny actions pin
40-
```
41-
or if you are being rate limited by Github's API
42-
```bash
43-
GITHUB_TOKEN=<your_token> pinny actions pin
44-
```
45-
You can use the `--dry-run` flag to see what changes will be made before actually making them.
46-
47-
To learn more
48-
```bash
49-
pinny actions --help
50-
```
51-
52-
### Dockerfiles
53-
Pinny supports two workflows forpinning of dockerfiles.
54-
55-
#### 1. Pinning your files locally before you commit them
56-
To pin your Dockerfile, run the following command in your repository root. This will look for file named `Dockerfile` in your repository root and will create a new file named `Dockerfile.pinned` with pinned versions of all the base images.
57-
```bash
58-
pinny docker pin
59-
```
60-
Use `--inplace` or `-i` flag to overwrite the original Dockerfile instead of creating a new file.
61-
```bash
62-
pinny docker pin --inplace
63-
```
64-
Use `--file` or `-f` flag to specify a different file name.
65-
```bash
66-
pinny docker pin --file Dockerfile.dev
67-
```
68-
69-
#### 2. Generate and commit a lock file and pin your dockerfiles in CI
70-
##### Generate a lock file
71-
To generate a lock file, run the following command in your repository root. This will look for file named `Dockerfile` in your repository root and will create a file named `pinny-lock.json` with pinned versions of all the base images.
72-
```bash
73-
pinny docker lock
74-
```
75-
Use `--file` or `-f` flag to specify a different file name.
76-
```bash
77-
pinny docker lock --file Dockerfile.dev
78-
```
79-
To learn more
80-
```bash
81-
pinny docker lock --help
82-
```
83-
##### Tranform your dockerfiles in CI
84-
Once you have committed the lock file, you can use the following command in your CI to transform your dockerfiles to use pinned versions of the base images.
85-
```bash
86-
pinny docker transform
87-
```
88-
Use `--file` or `-f` flag to specify a different file name.
89-
```bash
90-
pinny docker transform --file Dockerfile.dev
91-
```
92-
Use `--inplace` or `-i` flag to overwrite the original Dockerfile instead of creating a new file.
93-
```bash
94-
pinny docker transform --inplace
95-
```
96-
This command requires you have a file named pinny-lock.json.
97-
98-
To learn more
99-
```bash
100-
pinny docker tranform --help
101-
```
102-
103-
## Example:
104-
### Pinning Github Actions workflows
105-
![actions-pin-before-after-png](assets/imgs/actions-pin-before-after.png)
106-
107-
### Pinning Dockerfiles
108-
![docker-pin-before-after-png](assets/imgs/docker-pin-before-after.png)
109-
##### Sample run on the Dockerfile of Metabase Github repository
110-
![asciicast](assets/gifs/docker-pin.gif)
123+
```

assets/gifs/actions-pin.gif

427 KB
Loading

assets/gifs/docker-pin.gif

8.21 KB
Loading

0 commit comments

Comments
 (0)