Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release snap only when its files are modified #36

Closed
abitrolly opened this issue May 29, 2020 · 3 comments
Closed

Release snap only when its files are modified #36

abitrolly opened this issue May 29, 2020 · 3 comments

Comments

@abitrolly
Copy link
Member

Right now every commit releases new snap at https://snapcraft.io/yakshaveinc That creates unnecessary flow of update downloads. The solution is to build and deploy only when modifications touch files related to specific snap.

The should help

CHANGED_FILES=($(git diff --name-only $TRAVIS_COMMIT_RANGE))

https://stackoverflow.com/questions/38549616/travis-determine-which-files-changed

@abitrolly abitrolly changed the title Release only when files that are modified Release only when specific package files are modified May 29, 2020
@abitrolly abitrolly changed the title Release only when specific package files are modified Release snap only when its files are modified Aug 1, 2020
@abitrolly
Copy link
Member Author

There is a problem with this approach. If the previous build fails, or has been skipped, the won't be any releases on subsequent commits. For example:

  1. The commit modifies both top level .travis.yml and snap/snapcraft.yaml
  2. The build fails because of error in .travis.yml
  3. The next commit fixes .travis.yml, but rebuild of snap is not triggered, because snap/snapcraft.yaml was not touched

Another solution to the problem of unnecessary flow of updates is to build snaps always, in reproducible way, and upload only if the built snap changes.

@abitrolly
Copy link
Member Author

See #39.

@abitrolly
Copy link
Member Author

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

No branches or pull requests

1 participant