Skip to content

Instantly share code, notes, and snippets.

@digitalsadhu
Last active June 5, 2020 00:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitalsadhu/612257cf4d5608cd57f12605042de8f6 to your computer and use it in GitHub Desktop.
Save digitalsadhu/612257cf4d5608cd57f12605042de8f6 to your computer and use it in GitHub Desktop.

Publishing from CI, 2 approaches

Approach 1. [current approach] (where the cli controls the version)

  • eik package
    • calculates hashes of a local build and compares with what is available on the server
      • if hashes are the same, abort
    • calculates the next version number to publish
      • for a patch 1.0.1 goes to 1.0.2
      • for a minor 1.0.1 goes to 1.1.0
    • publish returns new version and sha file hashes
    • version field is updated in .eikrc (to be changed to assets.json)
  • app reads version from .eikrc (to be assets.json) and builds URLs

a deploy script for CI looks something like:

eik login -k change_me -s https://assets.finn.no
eik package
git add assets.json
git commit -m "update assets version [skip ci]"
git push origin master

Approach 2. (where user controls the version, same as npm)

  • A separate command/script is written (eik version??)
    • calculates hashes of a local build and compares with what is available on the server
      • if hashes are the same, abort
    • calculates the next version number to publish
      • for a patch 1.0.1 goes to 1.0.2
      • for a minor 1.0.1 goes to 1.1.0
    • writes the new version to assets.json version field
  • eik package
    • reads version from assets.json file
    • creates a bundle and publishes
    • publish returns sha file hashes
    • file hashes are updated in assets.json file
  • commit assets.json back to github
  • app reads version from .eikrc (to be assets.json) and builds URLs

a deploy script for CI might look something like:

eik login -k change_me -s https://assets.finn.no
eik version patch
eik package
git add assets.json
git commit -m "update assets version [skip ci]"
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment