You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/advanced_usage.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,17 +91,17 @@ But we have one downside - run `npm install` may take some time and we do not wa
91
91
92
92
Checksums allow you to know when some of the files have changed and made a decision based on that.
93
93
94
-
When you add `checksum` directive to a command - `lets` will calculate checksum from all of the files listed in `checksum` and put `LETS_CHECKSUM` env variable to command env.
94
+
When you add `checksum.files` directive to a command - `lets` will calculate checksum from all of the listed files and put `LETS_CHECKSUM` env variable to command env.
95
95
96
96
`LETS_CHECKSUM`will have a checksum value.
97
97
98
98
We then can store this checksum somewhere in the file and check that stored checksum with a checksum from env.
99
99
100
-
Fortunately, `lets` have an option for that - `persist_checksum`.
100
+
Fortunately, `lets` have an option for that - `checksum.persist`.
101
101
102
-
If `persist_cheksum` used with `checksum` `lets` will store new checksum to `.lets` dir and each time you run a command `lets` will check if stored checksum changed from the one from env.
102
+
If `checksum.persist` is used with `checksum.files`, `lets` will store new checksum to `.lets` dir and each time you run a command `lets` will check if stored checksum changed from the one from env.
103
103
104
-
While using `persist_checksum`, `lets` will add new env variable to command env - `LETS_CHECKUM_CHANGED`.
104
+
While using `checksum.persist`, `lets` will add new env variable to command env - `LETS_CHECKSUM_CHANGED`.
105
105
106
106
You can learn more about checksum in [Checksum section](config.md#checksum)
`checksum.files`and `checksum.sh` are mutually exclusive.
845
+
833
846
Example:
834
847
835
848
```yaml
836
849
shell: bash
837
850
commands:
838
851
app-build:
839
852
checksum:
840
-
- requirements-*.txt
853
+
files:
854
+
- requirements-*.txt
841
855
cmd: |
842
856
docker pull myrepo/app:${LETS_CHECKSUM}
843
857
docker run --rm myrepo/app${LETS_CHECKSUM} python -m app
844
858
```
845
859
846
860
847
-
### `persist_checksum`
861
+
### `checksum.persist`
848
862
849
-
`key: persist_checksum`
863
+
`key: checksum.persist`
850
864
851
865
`type: bool`
852
866
853
867
This feature is useful when you want to know that something has changed between two executions of a command.
854
868
855
-
`persist_checksum`can be used only if `checksum` declared for command.
869
+
`checksum.persist`can be used only if `checksum.files` or `checksum.sh` declared for command.
856
870
857
871
If set to `true`, each run all calculated checksums will be stored to disk.
858
872
@@ -869,12 +883,13 @@ Example:
869
883
```yaml
870
884
commands:
871
885
build:
872
-
persist_checksum: true
873
886
checksum:
874
-
deps:
875
-
- package.json
876
-
doc:
877
-
- Readme.md
887
+
persist: true
888
+
files:
889
+
deps:
890
+
- package.json
891
+
doc:
892
+
- Readme.md
878
893
```
879
894
880
895
Resulting env will be:
@@ -887,6 +902,8 @@ Resulting env will be:
887
902
* `LETS_CHECKSUM_DOC_CHANGED` - is checksum of doc files changed
888
903
* `LETS_CHECKSUM_CHANGED` - is checksum of all checksums (deps and doc) changed
889
904
905
+
`checksum`as a direct list/map and command-level `persist_checksum` are deprecated compatibility syntax. Use `lets self fix` to migrate local configs to `checksum.files` and `checksum.persist`.
0 commit comments