Skip to content

Commit

Permalink
#574 script modified with CR end of line
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Marie Renouard committed Nov 23, 2021
1 parent cb74b19 commit 1c68fe1
Show file tree
Hide file tree
Showing 17 changed files with 567 additions and 567 deletions.
38 changes: 19 additions & 19 deletions .perltidy
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
--backup-and-modify-in-place
--backup-file-extension=beforeTidy
--block-brace-tightness=2
--brace-tightness=2
--closing-token-indentation=1
--continuation-indentation=4
--indent-columns=4
--maximum-line-length=134
--cuddled-else
--opening-sub-brace-on-new-line
--noopening-brace-on-new-line
--nooutdent-labels
--paren-tightness=2
--square-bracket-tightness=2
--vertical-tightness=0
--vertical-tightness-closing=0
--break-at-old-comma-breakpoints
--entab-leading-whitespace=4
--tabs
--backup-and-modify-in-place
--backup-file-extension=beforeTidy
--block-brace-tightness=2
--brace-tightness=2
--closing-token-indentation=1
--continuation-indentation=4
--indent-columns=4
--maximum-line-length=134
--cuddled-else
--opening-sub-brace-on-new-line
--noopening-brace-on-new-line
--nooutdent-labels
--paren-tightness=2
--square-bracket-tightness=2
--vertical-tightness=0
--vertical-tightness-closing=0
--break-at-old-comma-breakpoints
--entab-leading-whitespace=4
--tabs
108 changes: 54 additions & 54 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
language: perl
perl:
- "5.24"

os: linux
dist: focal

services:
- docker

env:
- DB=mariadb:5.5
- DB=mariadb:10.2
- DB=mariadb:10.3
- DB=mariadb:10.4
- DB=mariadb:10.5
- DB=mysql:5.5
- DB=mysql:5.7
- DB=mysql:8.0
- DB=percona:5.6
- DB=percona:5.7
- DB=percona:8.0

install:
- cpanm --quiet --notest Data::Dumper
- cpanm --quiet --notest JSON
- cpanm --quiet --notest Perl::Critic
- cpanm --quiet --notest Text::Template

before_script:
- mysql --version
- mysqladmin --version
- docker run -it --name=mysqltestinstance -d -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -p 3306:3306 ${DB}
- echo -e "[client]\nuser=root\npassword=\"\"\nhost=127.0.0.1" > ~/.my.cnf
- chmod 600 ~/.my.cnf
- git clone https://github.com/datacharmer/test_db.git
- cd test_db
- count=10
- while ! mysql -e 'select version()' && [ $count -gt 0 ]; do echo $count seconds to go; sleep 1; count=$(( $count - 1 )); done
- if [[ $DB =~ .*:8.0 ]] ; then
for file in public_key.pem ca.pem server-cert.pem client-key.pem client-cert.pem ; do
docker cp mysqltestinstance:/var/lib/mysql/$file "${HOME}" ;
done ;
fi
- "cat employees.sql | grep -v 'storage_engine' | mysql"
- cd ..

script:
- ./mysqltuner.pl --verbose --tbstat 2>stderr.txt | tee -a "stdout.txt"

after_script:
- docker stop mysqltestinstance
- echo "Standard Output: $(cat stdout.txt)"
- echo "Standard Error : $(cat stderr.txt)"
language: perl
perl:
- "5.24"

os: linux
dist: focal

services:
- docker

env:
- DB=mariadb:5.5
- DB=mariadb:10.2
- DB=mariadb:10.3
- DB=mariadb:10.4
- DB=mariadb:10.5
- DB=mysql:5.5
- DB=mysql:5.7
- DB=mysql:8.0
- DB=percona:5.6
- DB=percona:5.7
- DB=percona:8.0

install:
- cpanm --quiet --notest Data::Dumper
- cpanm --quiet --notest JSON
- cpanm --quiet --notest Perl::Critic
- cpanm --quiet --notest Text::Template

before_script:
- mysql --version
- mysqladmin --version
- docker run -it --name=mysqltestinstance -d -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -p 3306:3306 ${DB}
- echo -e "[client]\nuser=root\npassword=\"\"\nhost=127.0.0.1" > ~/.my.cnf
- chmod 600 ~/.my.cnf
- git clone https://github.com/datacharmer/test_db.git
- cd test_db
- count=10
- while ! mysql -e 'select version()' && [ $count -gt 0 ]; do echo $count seconds to go; sleep 1; count=$(( $count - 1 )); done
- if [[ $DB =~ .*:8.0 ]] ; then
for file in public_key.pem ca.pem server-cert.pem client-key.pem client-cert.pem ; do
docker cp mysqltestinstance:/var/lib/mysql/$file "${HOME}" ;
done ;
fi
- "cat employees.sql | grep -v 'storage_engine' | mysql"
- cd ..

script:
- ./mysqltuner.pl --verbose --tbstat 2>stderr.txt | tee -a "stdout.txt"

after_script:
- docker stop mysqltestinstance
- echo "Standard Output: $(cat stdout.txt)"
- echo "Standard Error : $(cat stderr.txt)"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ MySQLTuner needs you:
* Please join us on issue track at [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues).
* Contribution guide is available following [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md)
* Star **MySQLTuner project** at [MySQLTuner Git Hub Project](https://github.com/major/MySQLTuner-perl)
* Paid support for Releem available here: [Releem App](https://app.releem.com/)
* Paid support for Releem available here: [Releem App](https://releem.com/)

## Stargazers over time

Expand Down
142 changes: 71 additions & 71 deletions Vagrant/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
config.vm.box = "generic/fedora30"
config.vm.network "private_network", ip: "192.168.50.10", virtualbox__intnet: false

if Vagrant.has_plugin? "vagrant-vbguest"
config.vbguest.no_install = true
config.vbguest.auto_update = false
config.vbguest.no_remote = true
end
config.hostmanager.enabled = true
config.hostmanager.manage_host = false
config.hostmanager.manage_guest = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = true

config.vm.network "public_network"
config.vm.hostname = 'fedora-generic'
config.hostmanager.aliases = %w(fedora-generic.localdomain fedora-generic.local fcg.local)

config.vm.synced_folder ".", "/data"

config.vm.provider "virtualbox" do |vb|
vb.name="fedora-generic"
vb.gui = false
vb.memory = "3036"
vb.cpus = 4
end

config.vm.provision "shell", inline: <<-SHELL
echo "secret" | sudo passwd --stdin root
echo "secret" | sudo passwd --stdin vagrant
sudo cp -pr ~vagrant/.ssh /root
sudo chown -R root.root /root/.ssh
sudo dnf -y update
sudo dnf -y install telnet vim-enhanced net-tools git python python2-pip python34-PyYAML moreutils net-tools python-psutil perl-WWW-Mechanize-GZip perl-App-cpanminus perl-List-MoreUtils vim-enhanced unzip zip jq youtube-dl ffmpeg make mariadb psmisc PyYAML tofrodos python3 chromedriver wget
sudo dnf -y install python34-pip moreutils net-tools python-psutil perl-WWW-Mechanize-GZip perl-App-cpanminus perl-List-MoreUtils vim-enhanced unzip zip jq youtube-dl ffmpeg make mariadb psmisc PyYAML tofrodos python3 wget python-beautifulsoup4 npm rclone golang yum-utils device-mapper-persistent-data lvm2 docker
echo "alias h='function hdi(){ howdoi \$* -c -n 5; }; hdi'" >> /tmp/util.sh
echo "alias s=sudo" >> /tmp/util.sh
echo "alias h=history" >> /tmp/util.sh
echo "alias hserver='python -m http.server 8000'" >> /tmp/util.sh
sudo cp /tmp/util.sh /etc/profile.d
cat /tmp/util.sh
sudo dnf install -y yum-utils device-mapper-persistent-data lvm2
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager \
--add-repo \
https://download.docker.com/linux/fedora/docker-ce.repo
sudo dnf -y install docker-ce docker-ce-cli containerd.io
dnf list docker-ce --showduplicates | sort -r
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -aG docker vagrant
sudo systemctl daemon-reload
true
##########################################
# Install container
sudo systemctl restart docker
SHELL
config.vm.provision :hostmanager
end
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
config.vm.box = "generic/fedora30"
config.vm.network "private_network", ip: "192.168.50.10", virtualbox__intnet: false

if Vagrant.has_plugin? "vagrant-vbguest"
config.vbguest.no_install = true
config.vbguest.auto_update = false
config.vbguest.no_remote = true
end
config.hostmanager.enabled = true
config.hostmanager.manage_host = false
config.hostmanager.manage_guest = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = true

config.vm.network "public_network"
config.vm.hostname = 'fedora-generic'
config.hostmanager.aliases = %w(fedora-generic.localdomain fedora-generic.local fcg.local)

config.vm.synced_folder ".", "/data"

config.vm.provider "virtualbox" do |vb|
vb.name="fedora-generic"
vb.gui = false
vb.memory = "3036"
vb.cpus = 4
end

config.vm.provision "shell", inline: <<-SHELL
echo "secret" | sudo passwd --stdin root
echo "secret" | sudo passwd --stdin vagrant
sudo cp -pr ~vagrant/.ssh /root
sudo chown -R root.root /root/.ssh
sudo dnf -y update
sudo dnf -y install telnet vim-enhanced net-tools git python python2-pip python34-PyYAML moreutils net-tools python-psutil perl-WWW-Mechanize-GZip perl-App-cpanminus perl-List-MoreUtils vim-enhanced unzip zip jq youtube-dl ffmpeg make mariadb psmisc PyYAML tofrodos python3 chromedriver wget
sudo dnf -y install python34-pip moreutils net-tools python-psutil perl-WWW-Mechanize-GZip perl-App-cpanminus perl-List-MoreUtils vim-enhanced unzip zip jq youtube-dl ffmpeg make mariadb psmisc PyYAML tofrodos python3 wget python-beautifulsoup4 npm rclone golang yum-utils device-mapper-persistent-data lvm2 docker
echo "alias h='function hdi(){ howdoi \$* -c -n 5; }; hdi'" >> /tmp/util.sh
echo "alias s=sudo" >> /tmp/util.sh
echo "alias h=history" >> /tmp/util.sh
echo "alias hserver='python -m http.server 8000'" >> /tmp/util.sh
sudo cp /tmp/util.sh /etc/profile.d
cat /tmp/util.sh
sudo dnf install -y yum-utils device-mapper-persistent-data lvm2
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager \
--add-repo \
https://download.docker.com/linux/fedora/docker-ce.repo
sudo dnf -y install docker-ce docker-ce-cli containerd.io
dnf list docker-ce --showduplicates | sort -r
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -aG docker vagrant
sudo systemctl daemon-reload
true
##########################################
# Install container
sudo systemctl restart docker
SHELL
config.vm.provision :hostmanager
end

18 changes: 9 additions & 9 deletions Vagrant/prepare.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh
VERSION=${1:-"10.4"}
rm -f Vagrantfile
cp Vagrantfile_for_MariaDB${VERSION} Vagrantfile
mkdir data
vagrant plugin install vagrant-hostmanager
vagrant plugin install vagrant-vbguest
vagrant plugin install vagrant-proxyconf
vagrant --provision up
#!/bin/sh
VERSION=${1:-"10.4"}
rm -f Vagrantfile
cp Vagrantfile_for_MariaDB${VERSION} Vagrantfile
mkdir data
vagrant plugin install vagrant-hostmanager
vagrant plugin install vagrant-vbguest
vagrant plugin install vagrant-proxyconf
vagrant --provision up
36 changes: 18 additions & 18 deletions build/build_rpm.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/bin/sh

BUILD_DIR=`dirname $(readlink -f $0)`

VERSION=$(grep -Ei 'my \$tunerversion' $BUILD_DIR/../mysqltuner.pl | grep = | cut -d\" -f2)
cd $BUILD_DIR
sh ./clean.sh

perl -pe "s/%VERSION%/$VERSION/g" mysqltuner.spec.tpl > mysqltuner.spec
mkdir -p $BUILD_DIR/mysqltuner-$VERSION
cp $BUILD_DIR/../mysqltuner.pl mysqltuner.spec $BUILD_DIR/../LICENSE $BUILD_DIR/../basic_passwords.txt $BUILD_DIR/../*.csv $BUILD_DIR/mysqltuner-$VERSION
pod2man $BUILD_DIR/../mysqltuner.pl | gzip > $BUILD_DIR/mysqltuner-$VERSION/mysqltuner.1.gz

tar czf $BUILD_DIR/mysqltuner-${VERSION}.tgz mysqltuner-$VERSION
rpmbuild -ta mysqltuner-${VERSION}.tgz 2>&1 | tee -a ./build.log
set -x
grep --color=never -E '(Wrote|crit)\S*:' $BUILD_DIR/build.log | cut -d: -f2 | xargs -I{} mv {} .
#rm -rf mysqltuner-$VERSION ./build.log
#!/bin/sh

BUILD_DIR=`dirname $(readlink -f $0)`

VERSION=$(grep -Ei 'my \$tunerversion' $BUILD_DIR/../mysqltuner.pl | grep = | cut -d\" -f2)
cd $BUILD_DIR
sh ./clean.sh

perl -pe "s/%VERSION%/$VERSION/g" mysqltuner.spec.tpl > mysqltuner.spec
mkdir -p $BUILD_DIR/mysqltuner-$VERSION
cp $BUILD_DIR/../mysqltuner.pl mysqltuner.spec $BUILD_DIR/../LICENSE $BUILD_DIR/../basic_passwords.txt $BUILD_DIR/../*.csv $BUILD_DIR/mysqltuner-$VERSION
pod2man $BUILD_DIR/../mysqltuner.pl | gzip > $BUILD_DIR/mysqltuner-$VERSION/mysqltuner.1.gz

tar czf $BUILD_DIR/mysqltuner-${VERSION}.tgz mysqltuner-$VERSION
rpmbuild -ta mysqltuner-${VERSION}.tgz 2>&1 | tee -a ./build.log
set -x
grep --color=never -E '(Wrote|crit)\S*:' $BUILD_DIR/build.log | cut -d: -f2 | xargs -I{} mv {} .
#rm -rf mysqltuner-$VERSION ./build.log
6 changes: 3 additions & 3 deletions build/clean.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

rm -rf mysqltuner-* mysqltuner.spec *.log
#!/bin/sh

rm -rf mysqltuner-* mysqltuner.spec *.log
10 changes: 5 additions & 5 deletions build/clearContainer.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh

docker ps | awk '{ print $NF}' |grep -v NAMES | xargs -n 1 docker kill
docker ps -a | awk '{ print $NF}' |grep -v NAMES | xargs -n 1 docker rm
docker ps -a
#!/bin/sh

docker ps | awk '{ print $NF}' |grep -v NAMES | xargs -n 1 docker kill
docker ps -a | awk '{ print $NF}' |grep -v NAMES | xargs -n 1 docker rm
docker ps -a
Loading

0 comments on commit 1c68fe1

Please sign in to comment.