split init
This commit is contained in:
parent
69348d5f60
commit
497c5fa2bc
@ -5,134 +5,19 @@
|
|||||||
echo "========== init de workflow par Tykayn ======="
|
echo "========== init de workflow par Tykayn ======="
|
||||||
source ~/Nextcloud/ressources/workflow_nextcloud/public_workflow/workflow_variables.sh
|
source ~/Nextcloud/ressources/workflow_nextcloud/public_workflow/workflow_variables.sh
|
||||||
|
|
||||||
bash $WORKFLOW_PATH_PUBLIC/initialisation/partials/check_foler_integrity.sh
|
bash "$WORKFLOW_PATH_PUBLIC/initialisation/partials/check_foler_integrity.sh"
|
||||||
bash $WORKFLOW_PATH_PUBLIC/initialisation/partials/git_config_glob.sh
|
bash "$WORKFLOW_PATH_PUBLIC/initialisation/partials/git_config_glob.sh"
|
||||||
|
bash "$WORKFLOW_PATH_PUBLIC/initialisation/partials/ansible.sh"
|
||||||
if ! hash ansible > /dev/null; then
|
bash "$WORKFLOW_PATH_PUBLIC/initialisation/partials/dev_tools.sh"
|
||||||
echo "* installation de Ansible"
|
bash "$WORKFLOW_PATH_PUBLIC/initialisation/partials/java-josm.sh"
|
||||||
sudo apt install ansible python3-pip
|
|
||||||
fi
|
|
||||||
####### lancement des playbooks ansible pour initialisation
|
|
||||||
ansible-galaxy install coglinev3.veracrypt
|
|
||||||
|
|
||||||
echo "vérification et installation des paquets requis"
|
|
||||||
sudo ansible-playbook "$WORKFLOW_PATH_PUBLIC/automatisation/ansible/tk_softwares.yml"
|
|
||||||
|
|
||||||
|
|
||||||
ansible-playbook "$WORKFLOW_PATH_PUBLIC/automatisation/ansible/pip_modules.yml"
|
|
||||||
sudo ansible-playbook "$WORKFLOW_PATH_PUBLIC/automatisation/ansible/snaps.yml"
|
|
||||||
ansible-playbook "$WORKFLOW_PATH_PUBLIC/automatisation/ansible/node_packages.yml"
|
|
||||||
|
|
||||||
ansible-playbook "$WORKFLOW_PATH_PUBLIC/automatisation/ansible/cronjob_workflow.yml"
|
|
||||||
sudo ansible-playbook "$WORKFLOW_PATH_PUBLIC/automatisation/ansible/cronjob_workflow_root.yml"
|
|
||||||
|
|
||||||
sudo apt autoremove -y
|
|
||||||
|
|
||||||
############ install developping tools
|
|
||||||
|
|
||||||
|
|
||||||
# nvm node version manager
|
|
||||||
if ! hash nvm > /dev/null; then
|
|
||||||
echo "installation de nvm"
|
|
||||||
|
|
||||||
cd tmp
|
|
||||||
echo "install nvm"
|
|
||||||
|
|
||||||
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
nvm install $node_version_expected
|
|
||||||
nvm alias default $node_version_expected
|
|
||||||
nvm alias global $node_version_expected
|
|
||||||
|
|
||||||
# yarn
|
|
||||||
corepack enable
|
|
||||||
npm i -g pnpm
|
|
||||||
|
|
||||||
echo "nvm installé, version des outils js:"
|
|
||||||
nvm --version
|
|
||||||
node --version
|
|
||||||
yarn --version
|
|
||||||
|
|
||||||
echo "install des outils en php"
|
|
||||||
|
|
||||||
# composer php
|
|
||||||
# symfony cli tool
|
|
||||||
# créer le dossier de scripts
|
|
||||||
if ! hash symfony ; then
|
|
||||||
wget https://get.symfony.com/cli/installer -O - | bash
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! hash composer ; then
|
|
||||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
|
||||||
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
|
|
||||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
|
||||||
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
|
|
||||||
|
|
||||||
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
|
|
||||||
then
|
|
||||||
>&2 echo 'ERROR: Invalid installer checksum'
|
|
||||||
rm composer-setup.php
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
php composer-setup.php --quiet
|
|
||||||
RESULT=$?
|
|
||||||
rm composer-setup.php
|
|
||||||
|
|
||||||
sudo mv composer.phar /usr/local/bin/composer
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
############## java pour josm
|
|
||||||
if ! hash java ; then
|
|
||||||
sudo apt install java -y
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! hash javaws; then
|
|
||||||
cd tmp
|
|
||||||
wget https://github.com/karakun/OpenWebStart/releases/download/v1.7.0/OpenWebStart_linux_1_7_0.deb
|
|
||||||
sudo dpkg -i OpenWebStart_linux_1_7_0.deb
|
|
||||||
rm -rf OpenWebStart_linux_1_7_0.deb
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! hash josm ; then
|
|
||||||
mkdir -p ~/areas/www/misc/josm
|
|
||||||
cd ~/areas/www/misc/josm
|
|
||||||
|
|
||||||
wget https://josm.openstreetmap.de/download/josm.jnlp
|
|
||||||
|
|
||||||
sudo apt install josm -y
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# bash $WORKFLOW_PATH_PUBLIC/update_git_projects.sh
|
# bash $WORKFLOW_PATH_PUBLIC/update_git_projects.sh
|
||||||
|
|
||||||
echo "ajouter dans la crontab utilisateur le script cronjob_nextcloud.sh"
|
|
||||||
echo "# toutes les 5 minutes
|
|
||||||
#*/5 * * * * bash $WORKFLOW_PATH_PUBLIC/cronjob_nextcloud.sh
|
|
||||||
|
|
||||||
# vérifiez avec la commande
|
|
||||||
crontab -e
|
|
||||||
"
|
|
||||||
# copier quelques fichiers de config dans la home
|
# copier quelques fichiers de config dans la home
|
||||||
|
|
||||||
cp "$WORKFLOW_PATH"/install/.zshrc ~/
|
cp "$WORKFLOW_PATH/install/.zshrc" "~/"
|
||||||
cp "$WORKFLOW_PATH"/install/.bash_aliases ~/
|
cp "$WORKFLOW_PATH/install/.bash_aliases" "~/"
|
||||||
cp "$WORKFLOW_PATH"/install/.bashrc ~/
|
cp "$WORKFLOW_PATH/install/.bashrc" "~/"
|
||||||
|
|
||||||
if ! -d ~/.oh-my-zsh; then
|
|
||||||
echo "installer oh my zsh"
|
|
||||||
cd
|
|
||||||
sudo apt install zsh
|
|
||||||
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bash "$WORKFLOW_PATH"/files_management/install.sh
|
bash "$WORKFLOW_PATH"/files_management/install.sh
|
||||||
bash "$WORKFLOW_PATH"/install/git_config_glob.sh
|
bash "$WORKFLOW_PATH"/install/git_config_glob.sh
|
||||||
@ -140,3 +25,4 @@ bash "$WORKFLOW_PATH"/refresh_from_current_assets.sh
|
|||||||
|
|
||||||
sudo apt update -y
|
sudo apt update -y
|
||||||
sudo apt upgrade -y
|
sudo apt upgrade -y
|
||||||
|
sudo apt autoremove -y
|
||||||
|
28
initialization/partials/ansible.sh
Normal file
28
initialization/partials/ansible.sh
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
echo " ------ install ansible playbooks ------"
|
||||||
|
|
||||||
|
if ! hash ansible > /dev/null; then
|
||||||
|
echo "* installation de Ansible"
|
||||||
|
sudo apt install ansible python3-pip
|
||||||
|
fi
|
||||||
|
####### lancement des playbooks ansible pour initialisation
|
||||||
|
ansible-galaxy install coglinev3.veracrypt
|
||||||
|
|
||||||
|
echo "vérification et installation des paquets requis"
|
||||||
|
sudo ansible-playbook "$WORKFLOW_PATH_PUBLIC/automatisation/ansible/tk_softwares.yml"
|
||||||
|
|
||||||
|
|
||||||
|
ansible-playbook "$WORKFLOW_PATH_PUBLIC/automatisation/ansible/pip_modules.yml"
|
||||||
|
sudo ansible-playbook "$WORKFLOW_PATH_PUBLIC/automatisation/ansible/snaps.yml"
|
||||||
|
ansible-playbook "$WORKFLOW_PATH_PUBLIC/automatisation/ansible/node_packages.yml"
|
||||||
|
|
||||||
|
ansible-playbook "$WORKFLOW_PATH_PUBLIC/automatisation/ansible/cronjob_workflow.yml"
|
||||||
|
sudo ansible-playbook "$WORKFLOW_PATH_PUBLIC/automatisation/ansible/cronjob_workflow_root.yml"
|
||||||
|
|
||||||
|
|
||||||
|
#echo "ajouter dans la crontab utilisateur le script cronjob_nextcloud.sh"
|
||||||
|
#echo "# toutes les 5 minutes
|
||||||
|
## */5 * * * * bash $WORKFLOW_PATH_PUBLIC/cronjob_nextcloud.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
62
initialization/partials/dev_tools.sh
Normal file
62
initialization/partials/dev_tools.sh
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
echo " ------ install developing tools ------"
|
||||||
|
|
||||||
|
|
||||||
|
############ install developping tools
|
||||||
|
|
||||||
|
|
||||||
|
# nvm node version manager
|
||||||
|
if ! hash nvm > /dev/null; then
|
||||||
|
echo "installation de nvm"
|
||||||
|
|
||||||
|
cd tmp
|
||||||
|
echo "install nvm"
|
||||||
|
|
||||||
|
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
nvm install $node_version_expected
|
||||||
|
nvm alias default $node_version_expected
|
||||||
|
nvm alias global $node_version_expected
|
||||||
|
|
||||||
|
# yarn
|
||||||
|
corepack enable
|
||||||
|
npm i -g pnpm
|
||||||
|
|
||||||
|
echo "nvm installé, version des outils js:"
|
||||||
|
nvm --version
|
||||||
|
node --version
|
||||||
|
yarn --version
|
||||||
|
|
||||||
|
|
||||||
|
echo "install des outils en php"
|
||||||
|
|
||||||
|
# composer php
|
||||||
|
# symfony cli tool
|
||||||
|
# créer le dossier de scripts
|
||||||
|
if ! hash symfony ; then
|
||||||
|
wget https://get.symfony.com/cli/installer -O - | bash
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! hash composer ; then
|
||||||
|
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||||
|
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
|
||||||
|
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||||
|
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
|
||||||
|
|
||||||
|
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
|
||||||
|
then
|
||||||
|
>&2 echo 'ERROR: Invalid installer checksum'
|
||||||
|
rm composer-setup.php
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
php composer-setup.php --quiet
|
||||||
|
RESULT=$?
|
||||||
|
rm composer-setup.php
|
||||||
|
|
||||||
|
sudo mv composer.phar /usr/local/bin/composer
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
26
initialization/partials/java-josm.sh
Normal file
26
initialization/partials/java-josm.sh
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
echo " ------ install java and josm ------"
|
||||||
|
|
||||||
|
############## java pour josm
|
||||||
|
if ! hash java ; then
|
||||||
|
sudo apt install java -y
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! hash javaws; then
|
||||||
|
cd tmp
|
||||||
|
wget https://github.com/karakun/OpenWebStart/releases/download/v1.7.0/OpenWebStart_linux_1_7_0.deb
|
||||||
|
sudo dpkg -i OpenWebStart_linux_1_7_0.deb
|
||||||
|
rm -rf OpenWebStart_linux_1_7_0.deb
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! hash josm ; then
|
||||||
|
mkdir -p ~/areas/www/misc/josm
|
||||||
|
cd ~/areas/www/misc/josm
|
||||||
|
|
||||||
|
wget https://josm.openstreetmap.de/download/josm.jnlp
|
||||||
|
|
||||||
|
sudo apt install josm -y
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
8
initialization/partials/zsh.sh
Normal file
8
initialization/partials/zsh.sh
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
echo " ------ install oh my zsh ------"
|
||||||
|
if ! -d ~/.oh-my-zsh; then
|
||||||
|
echo "installer oh my zsh"
|
||||||
|
cd
|
||||||
|
sudo apt install zsh
|
||||||
|
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user