-
Notifications
You must be signed in to change notification settings - Fork 46
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
Uses local RPM build for "dev" and "staging" scenarios #587
Changes from all commits
500cddb
abd7e98
e85be7e
69f995c
2a31b21
275b60c
715462c
dfca6d0
58cedea
9dc287a
902fc18
a7f57d1
bce65c8
087c709
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,21 +198,15 @@ dom0-securedrop-launcher-desktop-shortcut: | |
- mode: 755 | ||
|
||
{% import_json "sd/config.json" as d %} | ||
{% if d.environment == "dev" %} | ||
emkll marked this conversation as resolved.
Show resolved
Hide resolved
|
||
dom0-remove-securedrop-workstation-dom0-config: | ||
pkg.removed: | ||
- pkgs: | ||
- securedrop-workstation-dom0-config | ||
|
||
{% else %} | ||
|
||
{% if d.environment != "dev" %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I understand correctly, here we are explicitly excluding dev from installing the RPM to avoid installing the latest from the yum repos should the locally built version be lesser than the ones on the server. if that's the case, it may be worth adding a comment here for future maintainers as it is somewhat counter-intuitive. |
||
# In the dev environment, we've already installed the rpm from | ||
# local sources, so don't also pull in from the yum-test repo. | ||
dom0-install-securedrop-workstation-dom0-config: | ||
pkg.installed: | ||
- pkgs: | ||
- securedrop-workstation-dom0-config | ||
- require: | ||
- file: dom0-workstation-rpm-repo | ||
|
||
{% endif %} | ||
|
||
# Hide suspend/hibernate options in menus in prod systems | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,19 @@ dev_dir="${SECUREDROP_DEV_DIR:-/home/user/securedrop-workstation}" | |
# The dest directory in dom0 is not customizable. | ||
dom0_dev_dir="$HOME/securedrop-workstation" | ||
|
||
# Call out to target AppVM, to build an RPM containing | ||
# the latest Salt config for dom0. The RPM will be included | ||
# in the subsequent tarball, which is fetched to dom0. | ||
function build-dom0-rpm() { | ||
printf "Building RPM on %s ...\n" "${dev_vm}" | ||
qvm-run -q "$dev_vm" "make -C $dev_dir dom0-rpm" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would it make sense here to bump the RPM version to make sure that the version is always higher than anything available? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not aware of any RPM tooling like |
||
} | ||
|
||
# Call out to target AppVM to create a tarball in dom0 | ||
function create-tarball() { | ||
printf "Cloning code from %s:%s ...\n" "${dev_vm}" "${dev_dir}" | ||
qvm-run --pass-io "$dev_vm" \ | ||
"tar -c --exclude-vcs \ | ||
--exclude='*.rpm' \ | ||
-C '$(dirname "$dev_dir")' \ | ||
'$(basename "$dev_dir")'" > /tmp/sd-proj.tar | ||
} | ||
|
@@ -35,5 +42,6 @@ function unpack-tarball() { | |
tar xf /tmp/sd-proj.tar -C "${dom0_dev_dir}" --strip-components=1 | ||
} | ||
|
||
build-dom0-rpm | ||
create-tarball | ||
unpack-tarball |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to the dev environment may have repercussions on these individual makefile targets :
prep-salt
makefile target would copy the local salt file in/srv/salt/
whereas this updatedprep-dev
target will install the dom0 rpm. This means that any changes to the local files in thesecuredrop-workstation
folder in dom0 will not be used.If this is the case, adding a note to this effect in the dev docs could be helpful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's definitely true. Editing the files in e.g. /srv/salt/ still works fine, but I wouldn't recommend either, given how easy it is to lose changes that way. Will clarify in the docs!