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/pages_en/usage/build/stapel/instructions.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -504,6 +504,16 @@ shell:
504
504
505
505
The _git mapping configuration_ in the above `werf.yaml` instructs werf to transfer the contents of the `/src` directory of the local Git repository to the `/app` directory of the image. During the first build, files will be cached at the _gitArchive_ stage, and assembly instructions for _install_ and _beforeSetup_ will be executed. During the builds triggered by the subsequent commits which leave the contents of the `/src` directory unchanged, werf will not run the assembly instructions. Changes in the `/src` directory due to some commit will also result in changes in the checksums of the files matching the mask. This will cause werf to apply the git patch and rebuild any existing stages starting with _beforeSetup_, namely _beforeSetup_ and _setup_. The git patch will be applied once during the _beforeSetup_ stage.
506
506
507
+
### Disabling source updates (skipping gitCache and gitLatestPatch stages)
508
+
509
+
The `disableGitAfterPatch` directive allows you to lock the source code in the image during the artifact build stage and prevent it from being updated in subsequent builds.
510
+
511
+
This approach is useful in scenarios where you need to use the actual set of source files during the build stage, but only changes to specific files should restart the build process.
512
+
513
+
Therefore:
514
+
- If `git.stageDependencies` is used, the rebuild, and execution of commands with the current source files, will occur when relevant changes are detected.
515
+
- If `git.stageDependencies` is not used, there will be no rebuilds.
516
+
507
517
## Dependency on the CacheVersion
508
518
509
519
There are situations when a user wants to rebuild all _user stages_ or just one of them. They can do so by changing `cacheVersion` or `<user stage name>CacheVersion` parameters.
Copy file name to clipboardExpand all lines: docs/pages_ru/usage/build/stapel/instructions.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -533,6 +533,16 @@ shell:
533
533
534
534
Сборка следующего коммита, в котором будут только изменения файлов за пределами каталога `/src`, не приведет к выполнению инструкций каких-либо стадий. Если коммит будет содержать изменение внутри каталога `/src`, контрольные суммы файлов подпадающих под маску изменятся, werf применит Git-патч и пересоберёт все пользовательские стадии, начиная со стадии _beforeSetup_, а именно — _beforeSetup_ и _setup_. Применение Git-патча будет выполнено один раз на стадии _beforeSetup_.
535
535
536
+
### Отключение обновления исходников (стадии gitCache и gitLatestPatch)
537
+
538
+
Параметр `disableGitAfterPatch` позволяет зафиксировать исходный код в образе на этапе сборки артефакта и предотвратить его обновление при последующих сборках.
539
+
540
+
Этот подход полезен в случаях, когда необходимо использовать актуальный набор исходных файлов на этапе сборки, но изменения только определенных файлов должны перезапускать процесс сборки.
541
+
542
+
Таким образом:
543
+
- если использовать `git.stageDepedencies`, то пересборка, выполнение команд с актуальными исходниками, будет выполняться при соответствующих изменениях;
544
+
- если не использовать `git.stageDepedencies`, то пересборок не будет.
545
+
536
546
## Зависимость от значения CacheVersion
537
547
538
548
Существуют ситуации, когда необходимо принудительно пересобрать все или какую-то конкретную _пользовательскую стадию_. Этого можно достичь, изменяя параметры `cacheVersion` или `<user stage name>CacheVersion`.
0 commit comments