Skip to content

service hash changes for every deploy (when fetching from git) #close 379#482

Merged
NicolasMahe merged 1 commit intodevfrom
fix/service-id-change
Sep 21, 2018
Merged

service hash changes for every deploy (when fetching from git) #close 379#482
NicolasMahe merged 1 commit intodevfrom
fix/service-id-change

Conversation

@krhubert
Copy link
Copy Markdown
Contributor

Fix for #379

Comment thread api/deploy_deployer.go

// XXX: remove .git folder from repo.
// It makes docker build iamge id same between repo clones.
if err := os.RemoveAll(filepath.Join(path, ".git")); err != nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can have a slice const at the top to specify folders that needs to be deleted for different version control systems.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only support git right now, discussion about different system etc should be continued in another issue

@antho1404
Copy link
Copy Markdown
Member

For information, the problem really comes from git when git is creating the HEAD, it looks like it create it based on the time of the clone.

We could maybe delete the HEAD or something like that but deleting the git is totally fine.

➜  core git:(fix/service-id-change) ✗ diff -r service-webhook service-webhook2
Binary files service-webhook/.git/index and service-webhook2/.git/index differ
diff -r service-webhook/.git/logs/HEAD service-webhook2/.git/logs/HEAD
1c1
< 0000000000000000000000000000000000000000 a807ebb2a975748f759c76410e95730c97456e0b Anthony ESTEBE <anthony.estebe@gmail.com> 1537452020 +0700	clone: from https://github.com/mesg-foundation/service-webhook
---
> 0000000000000000000000000000000000000000 a807ebb2a975748f759c76410e95730c97456e0b Anthony ESTEBE <anthony.estebe@gmail.com> 1537452038 +0700	clone: from https://github.com/mesg-foundation/service-webhook
diff -r service-webhook/.git/logs/refs/heads/master service-webhook2/.git/logs/refs/heads/master
1c1
< 0000000000000000000000000000000000000000 a807ebb2a975748f759c76410e95730c97456e0b Anthony ESTEBE <anthony.estebe@gmail.com> 1537452020 +0700	clone: from https://github.com/mesg-foundation/service-webhook
---
> 0000000000000000000000000000000000000000 a807ebb2a975748f759c76410e95730c97456e0b Anthony ESTEBE <anthony.estebe@gmail.com> 1537452038 +0700	clone: from https://github.com/mesg-foundation/service-webhook
diff -r service-webhook/.git/logs/refs/remotes/origin/HEAD service-webhook2/.git/logs/refs/remotes/origin/HEAD
1c1
< 0000000000000000000000000000000000000000 a807ebb2a975748f759c76410e95730c97456e0b Anthony ESTEBE <anthony.estebe@gmail.com> 1537452020 +0700	clone: from https://github.com/mesg-foundation/service-webhook
---
> 0000000000000000000000000000000000000000 a807ebb2a975748f759c76410e95730c97456e0b Anthony ESTEBE <anthony.estebe@gmail.com> 1537452038 +0700	clone: from https://github.com/mesg-foundation/service-webhook

@NicolasMahe NicolasMahe merged commit a6887f2 into dev Sep 21, 2018
@NicolasMahe NicolasMahe deleted the fix/service-id-change branch September 21, 2018 08:02
@antho1404 antho1404 mentioned this pull request Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants