Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 5a78d4e

Browse files
authored
Merge pull request #33 from VSS-SDK/add_ansible_install
instalando ansible
2 parents e603507 + 7ff50e8 commit 5a78d4e

File tree

7 files changed

+63
-73
lines changed

7 files changed

+63
-73
lines changed

configure.sh

+62-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,73 @@
22

33
COMPILE_TYPE=$1
44

5-
source scripts/base.sh
5+
COMPILE_PROTOs() {
6+
protoc -I=. --cpp_out=. protos/state.proto
7+
protoc -I=. --cpp_out=. protos/command.proto
8+
protoc -I=. --cpp_out=. protos/debug.proto
9+
protoc -I=. --cpp_out=. protos/control.proto
10+
11+
mkdir -p src/protos
12+
mkdir -p include/protos
13+
14+
mv protos/*.pb.cc src/protos
15+
mv protos/*.pb.h include/protos
16+
}
17+
18+
CMAKE () {
19+
cmake ..
20+
make
21+
cd ..
22+
}
23+
24+
CMAKE_INSTALL () {
25+
cmake -D RELEASE=ON ..
26+
make install
27+
cd ..
28+
}
29+
30+
CREATE_BUILD_FOLDER() {
31+
rm -R build
32+
mkdir -p build
33+
cd build
34+
}
35+
36+
INIT_SUBMODULES() {
37+
git submodule init;
38+
git submodule update;
39+
}
40+
41+
INSTALL_ANSIBLE() {
42+
{
43+
apt-get update
44+
apt-get install -y python-pip python-dev
45+
} || {
46+
dnf update -y
47+
dnf install -y python-pip python-dev
48+
} || {
49+
yum update
50+
yum install -y python-pip python-dev
51+
}
52+
53+
{
54+
sudo -H pip3 install ansible==2.7.8.0
55+
} || {
56+
pip3 install ansible==2.7.8.0
57+
} || {
58+
sudo -H pip install ansible==2.7.8.0
59+
} || {
60+
pip install ansible==2.7.8.0
61+
}
62+
}
663

764
INSTALL () {
65+
INSTALL_ANSIBLE;
66+
867
ansible-playbook scripts/ansible/instala.yml
968

1069
INIT_SUBMODULES;
70+
COMPILE_PROTOs;
71+
CREATE_BUILD_FOLDER;
1172

1273
if [[ $COMPILE_TYPE == "development" ]];
1374
then

docker/debian9.dockerfile

-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
FROM debian:9
22

3-
# Instala Base
4-
RUN apt-get update
5-
RUN apt-get install -y python-pip python-dev
6-
7-
# Instala Ansible
8-
RUN pip install ansible==2.7.8.0
9-
103
# Copia tudo para o container
114
COPY . /vss-core-debian9
125
WORKDIR /vss-core-debian9
136

147
# Adiciona permissão de execução dos shellscripts
158
RUN chmod +x /vss-core-debian9/configure.sh
169
RUN chmod +x /vss-core-debian9/entrypoint.sh
17-
RUN chmod +x /vss-core-debian9/scripts/protos.sh
18-
RUN chmod +x /vss-core-debian9/scripts/base.sh
1910

2011
# Executa a instalação na criação dos containers
2112
RUN /vss-core-debian9/configure.sh development

docker/ubuntu16.dockerfile

-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
FROM ubuntu:16.04
22

3-
# Instala Base
4-
RUN apt-get update
5-
RUN apt-get install -y python-pip python-dev
6-
7-
# Instala Ansible
8-
RUN pip install ansible==2.7.8.0
9-
103
# Copia tudo para o container
114
COPY . /vss-core-ubuntu16
125
WORKDIR /vss-core-ubuntu16
136

147
# Adiciona permissão de execução dos shellscripts
158
RUN chmod +x /vss-core-ubuntu16/configure.sh
169
RUN chmod +x /vss-core-ubuntu16/entrypoint.sh
17-
RUN chmod +x /vss-core-ubuntu16/scripts/protos.sh
18-
RUN chmod +x /vss-core-ubuntu16/scripts/base.sh
1910

2011
# Executa a instalação na criação dos containers
2112
RUN /vss-core-ubuntu16/configure.sh development

docker/ubuntu18.dockerfile

-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
FROM ubuntu:18.04
22

3-
# Instala Base
4-
RUN apt-get update
5-
RUN apt-get install -y python-pip python-dev
6-
7-
# Instala Ansible
8-
RUN pip install ansible==2.7.8.0
9-
103
# Copia tudo para o container
114
COPY . /vss-core-ubuntu18
125
WORKDIR /vss-core-ubuntu18
136

147
# Adiciona permissão de execução dos shellscripts
158
RUN chmod +x /vss-core-ubuntu18/configure.sh
169
RUN chmod +x /vss-core-ubuntu18/entrypoint.sh
17-
RUN chmod +x /vss-core-ubuntu18/scripts/protos.sh
18-
RUN chmod +x /vss-core-ubuntu18/scripts/base.sh
1910

2011
# Executa a instalação na criação dos containers
2112
RUN /vss-core-ubuntu18/configure.sh development

scripts/ansible/instala.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
- name: Aguarde verificando conexao.
22
connection: local
33
hosts: localhost
4+
become: yes
45
roles:
56
- common
67
#- docker

scripts/base.sh

-26
This file was deleted.

scripts/protos.sh

-19
This file was deleted.

0 commit comments

Comments
 (0)