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

[Draft] Add check for local changes in obs-api package using rpm #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions deploy_without_migration.yml
@@ -1,10 +1,13 @@
---
- name: Deploy obs-api package
hosts: obs
vars:
overwrite_local_changes: false

pre_tasks:
- include_tasks: ./includes/pending-migration.yml
- include_tasks: ./includes/deployment-block.yml
- include_tasks: ./includes/check-local-changes.yml
- name: zypper unlock
block:
- include_tasks: ./includes/zypper-unlock.yml
Expand Down
9 changes: 9 additions & 0 deletions includes/check-local-changes.yml
@@ -0,0 +1,9 @@
# requires overwrite_local_changes (bool, dafault to false) to be set
---
- name: Verify local changes
shell: "rpm -V obs-api"
changed_when: false
ignore_errors: false
become: true
when:
- not overwrite_local_changes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand it correctly, this flag is not preventing overwrites but preventing the execution of the task, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can improve the naming a bit, if this, in fact, is not overwriting the local changes :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about "skip_local_rpm_check"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guxtavo Do you need some help with this?