Skip to content

Commit

Permalink
Allow to drop publish through drop: true option
Browse files Browse the repository at this point in the history
  • Loading branch information
bbinet committed Feb 14, 2018
1 parent 84af7e6 commit af99f8a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions aptly/server/mirrors.sls
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ aptly_{{ mirror_name }}_update:
aptly_drop_publish_{{ pub.snapshot }}_snapshot:
cmd.run:
- name: aptly publish drop {{ pub.distribution }}{% if pub.get('prefix') %} {{ pub.prefix }}{% endif %}
{%- if pub.get('drop') %}
- onlyif: aptly publish show {{ pub.distribution }}{% if pub.get('prefix') %} {{ pub.prefix }}{% endif %}
{%- else %}
- onlyif: aptly publish show {{ pub.distribution }}{% if pub.get('prefix') %} {{ pub.prefix }}{% endif %} | grep snapshot | grep -q -v {{ pub.snapshot }}
{%- endif %}
{%- if server.source.engine != "docker" %}
- user: {{ server.user.name }}
{%- endif %}
Expand All @@ -166,17 +170,19 @@ aptly_drop_publish_{{ pub.snapshot }}_snapshot:
- file: aptly_wrapper
{%- endif %}
{%- if not pub.get('drop') %}
aptly_publish_{{ pub.snapshot }}_snapshot:
cmd.run:
- name: aptly publish snapshot -batch=true -gpg-key='{{ server.gpg.keypair_id }}' -passphrase='{{ server.gpg.passphrase }}' -distribution={{ pub.distribution }}{% if pub.get('component') %} -component={{ pub.component }}{% endif %} {{ pub.snapshot }}{% if pub.get('prefix') %} {{ pub.prefix }}{% endif %}
- unless: aptly publish show {{ pub.distribution }}{% if pub.get('prefix') %} {{ pub.prefix }}{% endif %}
{%- if server.source.engine != "docker" %}
{%- if server.source.engine != "docker" %}
- user: {{ server.user.name }}
{%- endif %}
{%- endif %}
- require:
- cmd: aptly_drop_publish_{{ pub.snapshot }}_snapshot
{%- if server.source.engine == "docker" %}
{%- if server.source.engine == "docker" %}
- file: aptly_wrapper
{%- endif %}
{%- endif %}
{%- else %}
Expand Down

0 comments on commit af99f8a

Please sign in to comment.