I was wondering if .last_build_id
file should be commited since everytime I'm testing locally it creates a new hash.
I was wondering if .last_build_id file should be commited since everytime I'm testing locally it creates a new hash. I do not think it is necessary to commit this. This is kind of like a binary file itself, everytime you make a change and run a program, the file will change. last_build_id should be put into the .gitignore.
However, it is not so easy to push a scheduled job to check the state of another job and obtain commit id in pre-build actions. At least, I do not find anything out of the box. Let's try to create it on our own. First of all, we need to obtain the last successfull build with all additional info.
OK, commit hash can be onbtained. Now, we need to trigger this API call during pre-build actions, parse commit hash and use it for build start. It can be done with Jenkins EnvInject Plugin. Setup it and in build parameter you should enable the option Prepare an environment for the run. Do not forget to enable option Override Build Parameters.
Update the title or HTML in general, or something. Push your updated code and ensure that Cloud Build is running and finishing without errors. In Compute Engine, you should shortly see the instance group updating the machines.
I do not think it is necessary to commit this. This is kind of like a binary file itself, everytime you make a change and run a program, the file will change.
last_build_id
should be put into the .gitignore
.
Best
Have you a .gitignore
-File? If yes, I would prefer to add default gitignore settings for flutter projects in your own gitignore-file.
Here an example how my gitignore looks like for a flotter project (inkl. /ios/Flutter/.last_build_id):
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Web related
lib/generated_plugin_registrant.dart
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
You can also add specific settings (files or folder) and edit the gitignore. But on this website gitignore.io you can generate a gitignore for flutter with the respective content.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With