diff --git a/.travis.yml b/.travis.yml index c1f8b8f..2b2ec0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ script: after_success: - | - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" + echo "$DOCKER_PASSWORD" | docker login --username="$DOCKER_USERNAME" --password-stdin export IMAGE=$(docker images | awk '{print $3}' | awk 'NR==2') export REPO=$(echo $TRAVIS_REPO_SLUG | sed 's/\/docker-/\//g') if [[ -n "$TRAVIS_TAG" ]] && [[ "$TRAVIS_TAG" =~ ^$MOLECULE_SCENARIO_NAME ]]; then diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ec06c4..4a467a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,12 @@ ### Major Changes -## 4.8.1-4alvistack1 - 2020-03-04 +## 4.8.1-4alvistack4 - 2020-03-05 ### Major Changes - Revamp with Molecule and `docker commit` + - Consolidate molecule tests into `default` (noop) - Hotfix for systemd ## 4.8.0-3alvistack1 - 2020-01-15 diff --git a/README.md b/README.md index 0ee732f..86f0477 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,9 @@ For evaluations you can use the built-in database that will store its files in t ## Versioning -The `latest` tag matches the most recent version of this repository. Thus using `alvistack/fisheye:latest` or `alvistack/fisheye` will ensure you are running the most up to date version of this image. +The `latest` tag matches the most recent [GitHub Release](https://github.com/alvistack/docker-fisheye/releases) of this repository. Thus using `alvistack/fisheye:latest` or `alvistack/fisheye` will ensure you are running the most up to date stable version of this image. + +Other tags are rolling release rebuild by [Travis](https://travis-ci.org/alvistack/docker-fisheye) in weekly basis. Thus using these tags will ensure you are running the latest packages provided by the base image project. ## License diff --git a/galaxy.yml b/galaxy.yml index 919edb4..66f3f6d 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -18,7 +18,7 @@ namespace: alvistack name: docker-fisheye description: Docker Image Packaging for Atlassian Fisheye -version: MAJOR.MINOR.PATCH +version: VERSION readme: README.md license: Apache-2.0 diff --git a/molecule/4.7/converge.yml b/molecule/4.7/converge.yml deleted file mode 100644 index 464baf2..0000000 --- a/molecule/4.7/converge.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- - -# (c) Wong Hoi Sing Edison -# -# 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. - -- import_playbook: ../../playbooks/converge.yml diff --git a/molecule/4.7/converge.yml b/molecule/4.7/converge.yml new file mode 120000 index 0000000..73cb8da --- /dev/null +++ b/molecule/4.7/converge.yml @@ -0,0 +1 @@ +../default/converge.yml \ No newline at end of file diff --git a/molecule/4.7/create.yml b/molecule/4.7/create.yml deleted file mode 100644 index 35827c1..0000000 --- a/molecule/4.7/create.yml +++ /dev/null @@ -1,73 +0,0 @@ ---- - -# (c) Wong Hoi Sing Edison -# -# 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: localhost - connection: local - gather_facts: false - tasks: - - name: copy template - template: - src: "{{ molecule_scenario_directory }}/{{ item.dockerfile }}" - dest: "{{ molecule_ephemeral_directory }}/Dockerfile-{{ item.name }}" - loop_control: - label: "{{ item.name }}" - loop: "{{ molecule_yml.platforms }}" - when: item.dockerfile is defined - - - name: docker build - docker_image: - name: "{{ molecule_ephemeral_directory | regex_replace('^.*/([^/]*/[^/]*)$', '\\1') }}:{{ item.name }}" - source: "build" - build: - path: "{{ molecule_ephemeral_directory }}" - dockerfile: "{{ molecule_ephemeral_directory }}/Dockerfile-{{ item.name }}" - loop_control: - label: "{{ item.name }}" - loop: "{{ molecule_yml.platforms }}" - when: item.dockerfile is defined - - - name: docker pull - docker_image: - name: "{{ item.image }}" - source: "pull" - loop_control: - label: "{{ item.name }}" - loop: "{{ molecule_yml.platforms }}" - when: item.dockerfile is not defined - - - name: docker tag - docker_image: - name: "{{ item.image }}" - repository: "{{ molecule_ephemeral_directory | regex_replace('^.*/([^/]*/[^/]*)$', '\\1') }}:{{ item.name }}" - source: "local" - force_tag: true - loop: "{{ molecule_yml.platforms }}" - when: item.dockerfile is not defined - - - name: docker run - docker_container: - name: "{{ item.name }}" - image: "{{ molecule_ephemeral_directory | regex_replace('^.*/([^/]*/[^/]*)$', '\\1') }}:{{ item.name }}" - entrypoint: "{{ item.entrypoint | default('') }}" - command: "{{ item.command | default('bash -c \"sleep infinity\"') }}" - privileged: "{{ item.privileged | default(omit) }}" - tty: "{{ item.tty | default(omit) }}" - volumes: "{{ item.volumes | default(omit) }}" - env: "{{ item.env | default(omit) }}" - state: "started" - loop_control: - label: "{{ item.name }}" - loop: "{{ molecule_yml.platforms }}" diff --git a/molecule/4.7/create.yml b/molecule/4.7/create.yml new file mode 120000 index 0000000..e72908c --- /dev/null +++ b/molecule/4.7/create.yml @@ -0,0 +1 @@ +../default/create.yml \ No newline at end of file diff --git a/molecule/4.7/destroy.yml b/molecule/4.7/destroy.yml deleted file mode 100644 index 9674905..0000000 --- a/molecule/4.7/destroy.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- - -# (c) Wong Hoi Sing Edison -# -# 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: localhost - connection: local - gather_facts: false - tasks: - - name: docker rm - docker_container: - name: "{{ item.name }}" - state: "absent" - loop_control: - label: "{{ item.name }}" - loop: "{{ molecule_yml.platforms }}" diff --git a/molecule/4.7/destroy.yml b/molecule/4.7/destroy.yml new file mode 120000 index 0000000..87dffa5 --- /dev/null +++ b/molecule/4.7/destroy.yml @@ -0,0 +1 @@ +../default/destroy.yml \ No newline at end of file diff --git a/molecule/4.7/prepare.yml b/molecule/4.7/prepare.yml deleted file mode 100644 index f5a545f..0000000 --- a/molecule/4.7/prepare.yml +++ /dev/null @@ -1,74 +0,0 @@ ---- - -# (c) Wong Hoi Sing Edison -# -# 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 - become: true - gather_facts: false - tasks: - - name: cp -rfT /etc/skel /root - raw: | - cp -rfT /etc/skel /root - changed_when: false - ignore_errors: true - - - name: setenforce 0 - raw: | - setenforce 0 - changed_when: false - ignore_errors: true - - - name: systemctl stop firewalld.service - raw: | - systemctl stop firewalld.service - changed_when: false - ignore_errors: true - - - name: systemctl stop ufw.service - raw: | - systemctl stop ufw.service - changed_when: false - ignore_errors: true - - - name: redhat-7 | subscription-manager register - raw: | - subscription-manager register \ - --username={{ lookup('env', 'REDHAT_USERNAME') }} \ - --password={{ lookup('env', 'REDHAT_PASSWORD') }} \ - --autosubscribe - changed_when: false - ignore_errors: true - - - name: debian | apt-get install -y ca-certificates curl gcc iproute2 python3 python3-dev sudo - raw: | - apt-get update - apt-get install -y ca-certificates curl gcc iproute2 python3 python3-dev sudo - changed_when: false - ignore_errors: true - - - name: redhat | yum install -y ca-certificates curl gcc iproute python3 python3-devel sudo - raw: | - yum makecache fast - yum install -y ca-certificates curl gcc iproute python3 python3-devel sudo - changed_when: false - ignore_errors: true - - - name: suse | zypper -n install -y ca-certificates curl gcc iproute2 python3 python3-devel sudo - raw: | - zypper -n --gpg-auto-import-keys refresh - zypper -n install -y ca-certificates curl gcc iproute2 python3 python3-devel sudo - changed_when: false - ignore_errors: true diff --git a/molecule/4.7/prepare.yml b/molecule/4.7/prepare.yml new file mode 120000 index 0000000..1c017d9 --- /dev/null +++ b/molecule/4.7/prepare.yml @@ -0,0 +1 @@ +../default/prepare.yml \ No newline at end of file diff --git a/molecule/4.7/verify.yml b/molecule/4.7/verify.yml deleted file mode 100644 index a6b6e68..0000000 --- a/molecule/4.7/verify.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- - -# (c) Wong Hoi Sing Edison -# -# 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: localhost - connection: local - 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 diff --git a/molecule/4.7/verify.yml b/molecule/4.7/verify.yml new file mode 120000 index 0000000..15a7868 --- /dev/null +++ b/molecule/4.7/verify.yml @@ -0,0 +1 @@ +../default/verify.yml \ No newline at end of file diff --git a/molecule/4.8/converge.yml b/molecule/4.8/converge.yml deleted file mode 100644 index 464baf2..0000000 --- a/molecule/4.8/converge.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- - -# (c) Wong Hoi Sing Edison -# -# 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. - -- import_playbook: ../../playbooks/converge.yml diff --git a/molecule/4.8/converge.yml b/molecule/4.8/converge.yml new file mode 120000 index 0000000..73cb8da --- /dev/null +++ b/molecule/4.8/converge.yml @@ -0,0 +1 @@ +../default/converge.yml \ No newline at end of file diff --git a/molecule/4.8/create.yml b/molecule/4.8/create.yml deleted file mode 100644 index 35827c1..0000000 --- a/molecule/4.8/create.yml +++ /dev/null @@ -1,73 +0,0 @@ ---- - -# (c) Wong Hoi Sing Edison -# -# 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: localhost - connection: local - gather_facts: false - tasks: - - name: copy template - template: - src: "{{ molecule_scenario_directory }}/{{ item.dockerfile }}" - dest: "{{ molecule_ephemeral_directory }}/Dockerfile-{{ item.name }}" - loop_control: - label: "{{ item.name }}" - loop: "{{ molecule_yml.platforms }}" - when: item.dockerfile is defined - - - name: docker build - docker_image: - name: "{{ molecule_ephemeral_directory | regex_replace('^.*/([^/]*/[^/]*)$', '\\1') }}:{{ item.name }}" - source: "build" - build: - path: "{{ molecule_ephemeral_directory }}" - dockerfile: "{{ molecule_ephemeral_directory }}/Dockerfile-{{ item.name }}" - loop_control: - label: "{{ item.name }}" - loop: "{{ molecule_yml.platforms }}" - when: item.dockerfile is defined - - - name: docker pull - docker_image: - name: "{{ item.image }}" - source: "pull" - loop_control: - label: "{{ item.name }}" - loop: "{{ molecule_yml.platforms }}" - when: item.dockerfile is not defined - - - name: docker tag - docker_image: - name: "{{ item.image }}" - repository: "{{ molecule_ephemeral_directory | regex_replace('^.*/([^/]*/[^/]*)$', '\\1') }}:{{ item.name }}" - source: "local" - force_tag: true - loop: "{{ molecule_yml.platforms }}" - when: item.dockerfile is not defined - - - name: docker run - docker_container: - name: "{{ item.name }}" - image: "{{ molecule_ephemeral_directory | regex_replace('^.*/([^/]*/[^/]*)$', '\\1') }}:{{ item.name }}" - entrypoint: "{{ item.entrypoint | default('') }}" - command: "{{ item.command | default('bash -c \"sleep infinity\"') }}" - privileged: "{{ item.privileged | default(omit) }}" - tty: "{{ item.tty | default(omit) }}" - volumes: "{{ item.volumes | default(omit) }}" - env: "{{ item.env | default(omit) }}" - state: "started" - loop_control: - label: "{{ item.name }}" - loop: "{{ molecule_yml.platforms }}" diff --git a/molecule/4.8/create.yml b/molecule/4.8/create.yml new file mode 120000 index 0000000..e72908c --- /dev/null +++ b/molecule/4.8/create.yml @@ -0,0 +1 @@ +../default/create.yml \ No newline at end of file diff --git a/molecule/4.8/destroy.yml b/molecule/4.8/destroy.yml deleted file mode 100644 index 9674905..0000000 --- a/molecule/4.8/destroy.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- - -# (c) Wong Hoi Sing Edison -# -# 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: localhost - connection: local - gather_facts: false - tasks: - - name: docker rm - docker_container: - name: "{{ item.name }}" - state: "absent" - loop_control: - label: "{{ item.name }}" - loop: "{{ molecule_yml.platforms }}" diff --git a/molecule/4.8/destroy.yml b/molecule/4.8/destroy.yml new file mode 120000 index 0000000..87dffa5 --- /dev/null +++ b/molecule/4.8/destroy.yml @@ -0,0 +1 @@ +../default/destroy.yml \ No newline at end of file diff --git a/molecule/4.8/prepare.yml b/molecule/4.8/prepare.yml deleted file mode 100644 index f5a545f..0000000 --- a/molecule/4.8/prepare.yml +++ /dev/null @@ -1,74 +0,0 @@ ---- - -# (c) Wong Hoi Sing Edison -# -# 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 - become: true - gather_facts: false - tasks: - - name: cp -rfT /etc/skel /root - raw: | - cp -rfT /etc/skel /root - changed_when: false - ignore_errors: true - - - name: setenforce 0 - raw: | - setenforce 0 - changed_when: false - ignore_errors: true - - - name: systemctl stop firewalld.service - raw: | - systemctl stop firewalld.service - changed_when: false - ignore_errors: true - - - name: systemctl stop ufw.service - raw: | - systemctl stop ufw.service - changed_when: false - ignore_errors: true - - - name: redhat-7 | subscription-manager register - raw: | - subscription-manager register \ - --username={{ lookup('env', 'REDHAT_USERNAME') }} \ - --password={{ lookup('env', 'REDHAT_PASSWORD') }} \ - --autosubscribe - changed_when: false - ignore_errors: true - - - name: debian | apt-get install -y ca-certificates curl gcc iproute2 python3 python3-dev sudo - raw: | - apt-get update - apt-get install -y ca-certificates curl gcc iproute2 python3 python3-dev sudo - changed_when: false - ignore_errors: true - - - name: redhat | yum install -y ca-certificates curl gcc iproute python3 python3-devel sudo - raw: | - yum makecache fast - yum install -y ca-certificates curl gcc iproute python3 python3-devel sudo - changed_when: false - ignore_errors: true - - - name: suse | zypper -n install -y ca-certificates curl gcc iproute2 python3 python3-devel sudo - raw: | - zypper -n --gpg-auto-import-keys refresh - zypper -n install -y ca-certificates curl gcc iproute2 python3 python3-devel sudo - changed_when: false - ignore_errors: true diff --git a/molecule/4.8/prepare.yml b/molecule/4.8/prepare.yml new file mode 120000 index 0000000..1c017d9 --- /dev/null +++ b/molecule/4.8/prepare.yml @@ -0,0 +1 @@ +../default/prepare.yml \ No newline at end of file diff --git a/molecule/4.8/verify.yml b/molecule/4.8/verify.yml deleted file mode 100644 index a6b6e68..0000000 --- a/molecule/4.8/verify.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- - -# (c) Wong Hoi Sing Edison -# -# 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: localhost - connection: local - 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 diff --git a/molecule/4.8/verify.yml b/molecule/4.8/verify.yml new file mode 120000 index 0000000..15a7868 --- /dev/null +++ b/molecule/4.8/verify.yml @@ -0,0 +1 @@ +../default/verify.yml \ No newline at end of file diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml new file mode 100644 index 0000000..464baf2 --- /dev/null +++ b/molecule/default/converge.yml @@ -0,0 +1,17 @@ +--- + +# (c) Wong Hoi Sing Edison +# +# 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. + +- import_playbook: ../../playbooks/converge.yml diff --git a/molecule/default/create.yml b/molecule/default/create.yml new file mode 100644 index 0000000..35827c1 --- /dev/null +++ b/molecule/default/create.yml @@ -0,0 +1,73 @@ +--- + +# (c) Wong Hoi Sing Edison +# +# 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: localhost + connection: local + gather_facts: false + tasks: + - name: copy template + template: + src: "{{ molecule_scenario_directory }}/{{ item.dockerfile }}" + dest: "{{ molecule_ephemeral_directory }}/Dockerfile-{{ item.name }}" + loop_control: + label: "{{ item.name }}" + loop: "{{ molecule_yml.platforms }}" + when: item.dockerfile is defined + + - name: docker build + docker_image: + name: "{{ molecule_ephemeral_directory | regex_replace('^.*/([^/]*/[^/]*)$', '\\1') }}:{{ item.name }}" + source: "build" + build: + path: "{{ molecule_ephemeral_directory }}" + dockerfile: "{{ molecule_ephemeral_directory }}/Dockerfile-{{ item.name }}" + loop_control: + label: "{{ item.name }}" + loop: "{{ molecule_yml.platforms }}" + when: item.dockerfile is defined + + - name: docker pull + docker_image: + name: "{{ item.image }}" + source: "pull" + loop_control: + label: "{{ item.name }}" + loop: "{{ molecule_yml.platforms }}" + when: item.dockerfile is not defined + + - name: docker tag + docker_image: + name: "{{ item.image }}" + repository: "{{ molecule_ephemeral_directory | regex_replace('^.*/([^/]*/[^/]*)$', '\\1') }}:{{ item.name }}" + source: "local" + force_tag: true + loop: "{{ molecule_yml.platforms }}" + when: item.dockerfile is not defined + + - name: docker run + docker_container: + name: "{{ item.name }}" + image: "{{ molecule_ephemeral_directory | regex_replace('^.*/([^/]*/[^/]*)$', '\\1') }}:{{ item.name }}" + entrypoint: "{{ item.entrypoint | default('') }}" + command: "{{ item.command | default('bash -c \"sleep infinity\"') }}" + privileged: "{{ item.privileged | default(omit) }}" + tty: "{{ item.tty | default(omit) }}" + volumes: "{{ item.volumes | default(omit) }}" + env: "{{ item.env | default(omit) }}" + state: "started" + loop_control: + label: "{{ item.name }}" + loop: "{{ molecule_yml.platforms }}" diff --git a/molecule/default/destroy.yml b/molecule/default/destroy.yml new file mode 100644 index 0000000..9674905 --- /dev/null +++ b/molecule/default/destroy.yml @@ -0,0 +1,27 @@ +--- + +# (c) Wong Hoi Sing Edison +# +# 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: localhost + connection: local + gather_facts: false + tasks: + - name: docker rm + docker_container: + name: "{{ item.name }}" + state: "absent" + loop_control: + label: "{{ item.name }}" + loop: "{{ molecule_yml.platforms }}" diff --git a/molecule/default/group_vars/all/00-defaults.yml b/molecule/default/group_vars/all/00-defaults.yml new file mode 120000 index 0000000..0b825fd --- /dev/null +++ b/molecule/default/group_vars/all/00-defaults.yml @@ -0,0 +1 @@ +../../../../inventory/default/group_vars/all/00-defaults.yml \ No newline at end of file diff --git a/molecule/default/group_vars/all/99-molecule.yml b/molecule/default/group_vars/all/99-molecule.yml new file mode 100644 index 0000000..363937a --- /dev/null +++ b/molecule/default/group_vars/all/99-molecule.yml @@ -0,0 +1,17 @@ +--- + +# (c) Wong Hoi Sing Edison +# +# 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. + +fisheye_version: "4.8.1" diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml new file mode 100644 index 0000000..f5a545f --- /dev/null +++ b/molecule/default/prepare.yml @@ -0,0 +1,74 @@ +--- + +# (c) Wong Hoi Sing Edison +# +# 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 + become: true + gather_facts: false + tasks: + - name: cp -rfT /etc/skel /root + raw: | + cp -rfT /etc/skel /root + changed_when: false + ignore_errors: true + + - name: setenforce 0 + raw: | + setenforce 0 + changed_when: false + ignore_errors: true + + - name: systemctl stop firewalld.service + raw: | + systemctl stop firewalld.service + changed_when: false + ignore_errors: true + + - name: systemctl stop ufw.service + raw: | + systemctl stop ufw.service + changed_when: false + ignore_errors: true + + - name: redhat-7 | subscription-manager register + raw: | + subscription-manager register \ + --username={{ lookup('env', 'REDHAT_USERNAME') }} \ + --password={{ lookup('env', 'REDHAT_PASSWORD') }} \ + --autosubscribe + changed_when: false + ignore_errors: true + + - name: debian | apt-get install -y ca-certificates curl gcc iproute2 python3 python3-dev sudo + raw: | + apt-get update + apt-get install -y ca-certificates curl gcc iproute2 python3 python3-dev sudo + changed_when: false + ignore_errors: true + + - name: redhat | yum install -y ca-certificates curl gcc iproute python3 python3-devel sudo + raw: | + yum makecache fast + yum install -y ca-certificates curl gcc iproute python3 python3-devel sudo + changed_when: false + ignore_errors: true + + - name: suse | zypper -n install -y ca-certificates curl gcc iproute2 python3 python3-devel sudo + raw: | + zypper -n --gpg-auto-import-keys refresh + zypper -n install -y ca-certificates curl gcc iproute2 python3 python3-devel sudo + changed_when: false + ignore_errors: true diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml new file mode 100644 index 0000000..a6b6e68 --- /dev/null +++ b/molecule/default/verify.yml @@ -0,0 +1,43 @@ +--- + +# (c) Wong Hoi Sing Edison +# +# 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: localhost + connection: local + 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 diff --git a/roles/bootstrap b/roles/bootstrap index f0b846c..9c69f28 160000 --- a/roles/bootstrap +++ b/roles/bootstrap @@ -1 +1 @@ -Subproject commit f0b846c54957c12f3e31df9bb57c83caec3739ef +Subproject commit 9c69f28bc6b8674039044abd315b497a3c1b5532 diff --git a/roles/cvs b/roles/cvs index fb318bb..1c407d9 160000 --- a/roles/cvs +++ b/roles/cvs @@ -1 +1 @@ -Subproject commit fb318bbd8e596af6f65594385015cacb6acd530a +Subproject commit 1c407d9f3ee168b8a38c8f76e7458709cc196dbb diff --git a/roles/fisheye b/roles/fisheye index 6585a67..76d1b64 160000 --- a/roles/fisheye +++ b/roles/fisheye @@ -1 +1 @@ -Subproject commit 6585a6753c255532e78bf845361ca4c5ac282a26 +Subproject commit 76d1b64836dd49d93b0b9e71927463e56345d68a diff --git a/roles/git b/roles/git index 7dfc065..e9fb239 160000 --- a/roles/git +++ b/roles/git @@ -1 +1 @@ -Subproject commit 7dfc065cf2d4e48a034ea3b83df10abc0e639c1d +Subproject commit e9fb239cffe0b234bb6195ec011fe204adb1e295 diff --git a/roles/gosu b/roles/gosu index a4466de..ce43654 160000 --- a/roles/gosu +++ b/roles/gosu @@ -1 +1 @@ -Subproject commit a4466de88bbe29a9d0cfe3ebf5db4d5771a3a406 +Subproject commit ce436548d1120a3d8e8eaba56f158bbaa2f7a504 diff --git a/roles/locales b/roles/locales index df3a58d..d44ff83 160000 --- a/roles/locales +++ b/roles/locales @@ -1 +1 @@ -Subproject commit df3a58dd2a76a5a93ba6fcfffb2fa853c6d351ba +Subproject commit d44ff83fc5e462509327d7acac116f78ca81eca7 diff --git a/roles/mercurial b/roles/mercurial index dd89354..00c518b 160000 --- a/roles/mercurial +++ b/roles/mercurial @@ -1 +1 @@ -Subproject commit dd8935443dff20ff5443a519d974daf9b2969b51 +Subproject commit 00c518b2cea2adbb48ae7664a16dbd31f3cf59cd diff --git a/roles/openjdk b/roles/openjdk index bcd4da3..1e0498f 160000 --- a/roles/openjdk +++ b/roles/openjdk @@ -1 +1 @@ -Subproject commit bcd4da37f0936ffb0d02bf8140b93c8c16f1c44c +Subproject commit 1e0498fbe60b28164b3e4cfc50a015052d7e8c58 diff --git a/roles/perforce b/roles/perforce index 6ef29d3..67d2d91 160000 --- a/roles/perforce +++ b/roles/perforce @@ -1 +1 @@ -Subproject commit 6ef29d318fd4ab73ecca113795cd655416459e45 +Subproject commit 67d2d914ec0b780a75c51cc5ff0fa36ac93885f6 diff --git a/roles/python b/roles/python index e0689d5..f23fdec 160000 --- a/roles/python +++ b/roles/python @@ -1 +1 @@ -Subproject commit e0689d59f1fac2df3d29ccda9287e6ed0780bb01 +Subproject commit f23fdec6619bc37b1967092650e1d0f344349078 diff --git a/roles/svn b/roles/svn index df765cb..5fd9593 160000 --- a/roles/svn +++ b/roles/svn @@ -1 +1 @@ -Subproject commit df765cbfb8936fa2161f9eb491522d0398396186 +Subproject commit 5fd959311b53a8e6773de5328ee3f5c437c04ddc diff --git a/roles/timezone b/roles/timezone index 4116e82..c30d7bc 160000 --- a/roles/timezone +++ b/roles/timezone @@ -1 +1 @@ -Subproject commit 4116e82efc9130847b42620cf5a9394e85ebc905 +Subproject commit c30d7bc8771f1690368b87e3bb79aad395ae4505 diff --git a/roles/tini b/roles/tini index 9f3047b..f1e37e5 160000 --- a/roles/tini +++ b/roles/tini @@ -1 +1 @@ -Subproject commit 9f3047bd90f979b6dc59a5a1aa61038a48e98631 +Subproject commit f1e37e56a74c0c90195a27177354fc50e2fc8461