Skip to content

Commit

Permalink
Merge branch 'release/4.8.2-4alvistack5'
Browse files Browse the repository at this point in the history
  • Loading branch information
hswong3i committed Jun 10, 2020
2 parents 663391e + e84fa27 commit cb0cb30
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 68 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# Docker Image Packaging for Atlassian Fisheye

## 4.8.1-XalvistackY - TBC
## 4.8.2-XalvistackY - TBC

### Major Changes

## 4.8.2-4alvistack5 - 2020-06-10

### Major Changes

- Revamp `create`, `side_effect`, `verify` and `destroy` logic
- Replace `tini` with `catatonit`
- Rename `post_tasks.yml` as `side_effect.yml`
- Upgrade base image to Ubuntu 20.04
Expand Down
24 changes: 24 additions & 0 deletions molecule/default/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,30 @@
become: true
gather_facts: false
tasks:
- name: docker image inspect
docker_image_info:
name: "{{ molecule_ephemeral_directory | regex_replace('^.*/([^/]*/[^/]*)$', '\\1') }}:{{ item.name }}"
loop_control:
label: "{{ item.name }}"
loop: "{{ molecule_yml.platforms }}"
register: result

- name: docker commit
shell: |
set -o pipefail
docker inspect {{ item.name }} && docker commit \
--change 'CMD ["{{ result.results[i].images[0].Config.Cmd | join('", "') }}"]' \
--change 'ENTRYPOINT ["{{ result.results[i].images[0].Config.Entrypoint | join('", "') }}"]' \
{{ item.name }} {{ molecule_ephemeral_directory | regex_replace('^.*/([^/]*/[^/]*)$', '\1') }}:{{ item.name }}-commit
args:
executable: "/bin/bash"
loop_control:
label: "{{ item.name }}"
index_var: i
with_items: "{{ molecule_yml.platforms }}"
changed_when: false
ignore_errors: true

- name: docker rm
docker_container:
name: "{{ item.name }}"
Expand Down
68 changes: 1 addition & 67 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,70 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

- hosts: all
remote_user: root
become: true
gather_facts: false
tasks:
- name: rm -rf /root/.ansible/tmp/*
raw: |
set -ex
rm -rf /root/.ansible/tmp/*
rm -rf /root/.cache/*
rm -rf /tmp/*
changed_when: false
ignore_errors: true

- name: debian | apt-get clean
raw: |
set -ex
apt-get clean
rm -rf /var/lib/apt/lists/*
changed_when: false
ignore_errors: true

- name: redhat | yum clean all
raw: |
set -ex
yum clean all
rm -rf /var/cache/yum/*
changed_when: false
ignore_errors: true

- name: suse | zypper clean --all
raw: |
set -ex
zypper clean --all
rm -rf /var/cache/zypper/*
changed_when: false
ignore_errors: true

- hosts: localhost
connection: local
remote_user: root
become: true
gather_facts: false
tasks:
- name: docker image inspect
docker_image_info:
name: "{{ molecule_ephemeral_directory | regex_replace('^.*/([^/]*/[^/]*)$', '\\1') }}:{{ item.name }}"
loop_control:
label: "{{ item.name }}"
loop: "{{ molecule_yml.platforms }}"
register: result

- name: docker commit
shell: |
set -o pipefail
docker inspect {{ item.name }} && docker commit \
--change 'CMD ["{{ result.results[i].images[0].Config.Cmd | join('", "') }}"]' \
--change 'ENTRYPOINT ["{{ result.results[i].images[0].Config.Entrypoint | join('", "') }}"]' \
{{ item.name }} {{ molecule_ephemeral_directory | regex_replace('^.*/([^/]*/[^/]*)$', '\1') }}:{{ item.name }}-commit
args:
executable: "/bin/bash"
loop_control:
label: "{{ item.name }}"
index_var: i
with_items: "{{ molecule_yml.platforms }}"
changed_when: false
ignore_errors: true
- import_playbook: ../../playbooks/verify.yml
33 changes: 33 additions & 0 deletions playbooks/side_effect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,36 @@
paths:
- "./vars"
ignore_errors: true

- name: rm -rf /root/.ansible/tmp/*
raw: |
set -ex
rm -rf /root/.ansible/tmp/*
rm -rf /root/.cache/*
rm -rf /tmp/*
changed_when: false
ignore_errors: true

- name: debian | apt-get clean
raw: |
set -ex
apt-get clean
rm -rf /var/lib/apt/lists/*
changed_when: false
ignore_errors: true

- name: redhat | yum clean all
raw: |
set -ex
yum clean all
rm -rf /var/cache/yum/*
changed_when: false
ignore_errors: true

- name: suse | zypper clean --all
raw: |
set -ex
zypper clean --all
rm -rf /var/cache/zypper/*
changed_when: false
ignore_errors: true
35 changes: 35 additions & 0 deletions playbooks/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---

# (c) Wong Hoi Sing Edison <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

- hosts: all
remote_user: root
tasks:
- name: include default variables
include_vars: "./vars/main.yml"

- name: include release specific variables
include_vars: "{{ lookup('first_found', _params) }}"
vars:
_params:
files:
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_distribution | lower }}.yml"
- "{{ ansible_os_family | lower }}.yml"
paths:
- "./vars"
ignore_errors: true

0 comments on commit cb0cb30

Please sign in to comment.