Closed amwolff closed 2 months ago
Salt can't checkout the assets from github? I assume it's going to be pulling down the binaries from there so it seems like it should be able to handle a few more files pretty easily.
yeah, I suppose it's optional. I'll lower the priority of this.
Salt can't checkout the assets from github? I assume it's going to be pulling down the binaries from there so it seems like it should be able to handle a few more files pretty easily.
I’ve tried this on my own setup with systemd, it feels real hacky and not as elegant as the binary having all the dependencies included. I also had some reliability issues trying to get the revision archive on GitHub for a specific release, and then make sure the right one is used if it swaps out an existing one. IMO better to bundle, and a build artifact should have everything it needs included and not require additional files for it to operate correctly.
Here was the code I had problems with. Maybe there's other ways to do it, of course.
{% set release = salt['pillar.get']('linksharing:release', '') %}
{% set revision = release.split('-')[0] %}
# todo: this isn't so nice. we should look at bundling the static files into the binary.
# todo: file.copy didn't seem to work copying a directory from the git checkout. For now, this creates a new checkout
# and updates the symlink when the source changes. Old directories need to be cleaned up.
{%- if revision != '' %}
linksharing-repo:
git.detached:
- name: https://github.com/storj/edge.git
- rev: {{ revision }}
- target: {{ data_dir }}/edge-{{ revision }}.git
- user: {{ user }}
file.symlink:
- name: {{ data_dir }}/web
- target: {{ data_dir}}/edge-{{ revision }}.git/pkg/linksharing/web
- force: True
- user: {{ user }}
- group: {{ user }}
- mode: '0700'
- require:
- file: linksharing-data_dir
- git: linksharing-repo
{%- endif %}
zip up the assets along with the release binary? The bundling would be nice if it's not more effort, having software delivered as multiple files feels pretty standard to me.
Change pkg/linksharing/sharing: embed web assets mentions this issue.
I've just pushed a Gerrit change that embeds the web assets in the linksharing binary. Any assets in these folders will be included once a build is performed:
pkg/linksharing/sharing/internal/assets/templates
pkg/linksharing/sharing/internal/assets/static
@jewharton This change looks great. Well done!
Goal
Link Sharing Service static assets need to be bundled into the binary to streamline deployment and ensure their availability within the application.
What needs to be done?
embed.FS
to bundle static assets into the binaryAC
embed.FS