Skip to content

Commit

Permalink
apiserver: install dependent libraries upon deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
FooBarWidget committed Aug 21, 2024
1 parent 40a6b8d commit 2a07177
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/apiserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ jobs:
BUNDLE_PATH: vendor/bundle
BUNDLE_WITH: ci

- name: Infer library dependencies
run: bundle exec debendencies . | tee dpkg-dependencies.txt
working-directory: apiserver
env:
BUNDLE_PATH: vendor/bundle
BUNDLE_WITH: ci

- name: Create tarball
run: >
tar
Expand Down
5 changes: 5 additions & 0 deletions ansible/files/apiserver-deployer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ else
rm -rf "${TARGET_DIR}.tmp"
mkdir "${TARGET_DIR}.tmp"
tar --use-compress-program=unzstd -xf "/tmp/$ASSET_NAME" -C "${TARGET_DIR}.tmp"
DPKG_DEPENDENCIES=($(cat "${TARGET_DIR}.tmp/dpkg-dependencies.txt"))
if [[ -z "${DPKG_DEPENDENCIES[*]}" ]]; then
echo "Installing dependencies: ${DPKG_DEPENDENCIES[*]}"
apt satisfy -y --no-install-recommends --no-install-suggests "${DPKG_DEPENDENCIES[@]}"
fi
rm "/tmp/$ASSET_NAME"
mv "${TARGET_DIR}.tmp" "$TARGET_DIR"

Expand Down
1 change: 1 addition & 0 deletions apiserver/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ gem "jwt"

group :ci, optional: true do
gem "rufo"
gem "debendencies"
end
19 changes: 19 additions & 0 deletions apiserver/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@ GEM
remote: https://rubygems.org/
specs:
base64 (0.2.0)
debendencies (1.0.0)
fileutils (~> 1)
json (~> 2)
open3 (>= 0.1, < 2)
optparse (>= 0.4, < 2)
set (~> 1)
stringio (~> 3)
tempfile (>= 0.1, < 2)
tmpdir (>= 0.1, < 2)
fileutils (1.7.2)
json (2.7.2)
jwt (2.8.2)
base64
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
nio4r (2.7.3)
open3 (0.2.1)
optparse (0.5.0)
puma (6.4.2)
nio4r (~> 2.0)
rack (3.1.7)
Expand All @@ -17,18 +30,24 @@ GEM
rack (>= 3.0.0)
ruby2_keywords (0.0.5)
rufo (0.18.0)
set (1.1.0)
sinatra (4.0.0)
mustermann (~> 3.0)
rack (>= 3.0.0, < 4)
rack-protection (= 4.0.0)
rack-session (>= 2.0.0, < 3)
tilt (~> 2.0)
stringio (3.1.1)
tempfile (0.2.1)
tilt (2.4.0)
tmpdir (0.2.0)
fileutils

PLATFORMS
ruby

DEPENDENCIES
debendencies
jwt
puma
rufo
Expand Down

0 comments on commit 2a07177

Please sign in to comment.