Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should .last_build_id be commited?

Tags:

git

flutter

I was wondering if .last_build_id file should be commited since everytime I'm testing locally it creates a new hash.

like image 648
Theo Melo Avatar asked May 25 '20 00:05

Theo Melo


People also ask

Should I commit the last_build_ID File?

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.

Is it possible to get commit ID in pre-build actions?

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.

How to parse commit hash for build start in Jenkins?

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.

How do I update my Cloud Build code?

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.


2 Answers

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

like image 69
rasengan__ Avatar answered Oct 08 '22 00:10

rasengan__


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.

like image 36
SwissCodeMen Avatar answered Oct 08 '22 02:10

SwissCodeMen