Skip to content

Commit

Permalink
Merge pull request #238 from wazuh/feature-235-dockerfile-improvement
Browse files Browse the repository at this point in the history
Improvements for Jenkins build's dockerfile
  • Loading branch information
Manuel J. Bernal authored Nov 6, 2019
2 parents c4a2f03 + 62af888 commit 8b90394
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/test--mitre.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
| Name | About | Title | Labels | Assigness |
| --- | --- | --- | --- | --- |
| Test: Mitre | Test suite for Mitre | '' | '' | '' |

# Mitre

| Version | Revision |
Expand Down
5 changes: 5 additions & 0 deletions ansible/wazuh-ansible/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ platforms:
- nofile:262144:262144
privileged: true
memory_reservation: 2048m
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
config_options:
Expand Down
10 changes: 10 additions & 0 deletions ansible/wazuh-ansible/molecule/elasticsearch-xpack/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,23 @@ platforms:
- nofile:262144:262144
privileged: true
memory_reservation: 2048m
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: elasticsearch_${MOL_PLATFORM:-centos7}-2
image: ${MOL_IMAGE:-milcom/centos7-systemd}
command: /sbin/init
ulimits:
- nofile:262144:262144
privileged: true
memory_reservation: 2048m
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
config_options:
Expand Down
5 changes: 5 additions & 0 deletions ansible/wazuh-ansible/molecule/elasticsearch/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ platforms:
- nofile:262144:262144
privileged: true
memory_reservation: 2048m
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
config_options:
Expand Down
5 changes: 5 additions & 0 deletions ansible/wazuh-ansible/molecule/kibana/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ platforms:
- nofile:262144:262144
privileged: true
memory_reservation: 1024m
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
config_options:
Expand Down
5 changes: 5 additions & 0 deletions ansible/wazuh-ansible/molecule/wazuh-agent/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ platforms:
- name: wazuh
groups:
- agent
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
#- name: wazuh_agent_xenial
# image: solita/ubuntu-systemd:xenial
# privileged: true
Expand Down
5 changes: 5 additions & 0 deletions ansible/wazuh-ansible/molecule/worker/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ platforms:
- nofile:262144:262144
privileged: true
memory_reservation: 2048m
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
config_options:
Expand Down
26 changes: 26 additions & 0 deletions kitchen/wazuh-chef/manager/files/1-build-model/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ruby

RUN apt-get update && apt install docker.io git curl wget -y

RUN apt-get update

RUN gem install kitchen-docker && \
gem install rbnacl && \
gem install rbnacl-libsodium && \
gem install bcrypt_pbkdf && \
gem install berkshelf && \
gem install httpclient

RUN cd $HOME && \
git clone https://github.com/wazuh/wazuh-qa.git && \
cd $HOME/wazuh-qa && \
git checkout devel && \
cd $HOME/wazuh-qa/kitchen/wazuh-chef/manager/files/ && \
bundle install

RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python get-pip.py

RUN pip install pytest && pip install testinfra && pip install paramiko

# Standard SSH port
EXPOSE 22
35 changes: 35 additions & 0 deletions kitchen/wazuh-chef/manager/files/entrypoint/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM ruby

CMD tail -f /dev/null

COPY entrypoint.sh /usr/local/bin/

RUN chmod 777 /usr/local/bin/entrypoint.sh \
&& ln -s /usr/local/bin/entrypoint.sh /

ENTRYPOINT ["entrypoint.sh"]

RUN apt-get update && apt install docker.io git curl wget -y

RUN apt-get update

RUN gem install kitchen-docker && \
gem install rbnacl && \
gem install rbnacl-libsodium && \
gem install bcrypt_pbkdf && \
gem install berkshelf && \
gem install httpclient

RUN cd $HOME && \
git clone https://github.com/wazuh/wazuh-qa.git && \
cd $HOME/wazuh-qa && \
git checkout devel && \
cd $HOME/wazuh-qa/kitchen/wazuh-chef/manager/files/ && \
bundle install

RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python get-pip.py

RUN pip install pytest && pip install testinfra && pip install paramiko

# Standard SSH port
EXPOSE 22
39 changes: 39 additions & 0 deletions kitchen/wazuh-chef/manager/files/entrypoint/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
set -e

CHEF_SOURCE_BRANCH=$1
CHEF_TARGET_BRANCH=$2
QA_BRANCH=$3


cd $HOME/wazuh-qa/ && \
git pull --all && \
git checkout $QA_BRANCH && \
git pull

cd $HOME && \
git clone https://github.com/wazuh/wazuh-chef.git && \
cd $HOME/wazuh-chef/ && \
git checkout $CHEF_SOURCE_BRANCH && \
git pull && \
git checkout $CHEF_TARGET_BRANCH && \
git pull && \
git checkout $CHEF_SOURCE_BRANCH && \
git merge $CHEF_SOURCE_BRANCH

cp -rf $HOME/wazuh-qa/kitchen/wazuh-chef/manager/files/* $HOME/wazuh-chef/cookbooks/wazuh_manager/
cp -rf $HOME/wazuh-qa/kitchen/wazuh-chef/manager/test/* $HOME/wazuh-chef/cookbooks/wazuh_manager/test/
cp -rf $HOME/wazuh-qa/kitchen/wazuh-chef/manager/test_environment/* $HOME/wazuh-chef/cookbooks/wazuh_manager/test/environments/
cp -rf $HOME/wazuh-qa/kitchen/wazuh-chef/agent/* $HOME/wazuh-chef/cookbooks/wazuh_agent/test/environments/


cd $HOME/wazuh-chef/cookbooks/wazuh_manager/ && \
mkdir .kitchen

cd $HOME/wazuh-chef/cookbooks/wazuh_manager/ && \
ls -ltrh
chmod +x run.sh && \
chmod +x clean.sh && \
rm .kitchen.yml

tail -f /dev/null

0 comments on commit 8b90394

Please sign in to comment.