Skip to content

Instantly share code, notes, and snippets.

View foxutech's full-sized avatar

FoxuTech foxutech

View GitHub Profile
---
- hosts: newnode
remote_user: root
become: yes
become_method: sudo
tasks:
- command: bash -c "uname -r | grep ^4."
register: kernelversion
ignore_errors: yes
# upgrade kernel
- name: upgrade kernel step 1
command: rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
- name: upgrade kernel step 2
command: rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
ignore_errors: yes
- name: upgrade kernel step 3
command: yum --enablerepo=elrepo-kernel install -y kernel-lt
node {
stage 'checkout'
git 'https://gitlab.com/motoskia/hello-world.git'
stage 'build'
sh 'mvn clean install'
stage('Results - 1') {
FROM centos:centos7
RUN yum -y install net-tools qperf
ENTRYPOINT ["qperf"]
# print result
echo ""
#echo "Upload speed: $up_speed kB/s"
#echo "Download speed: $down_speed kB/s"
up_mbps=$(echo "scale=0; $up_speed/125" |bc)
down_mbps=$(echo "scale=0; $down_speed/125" |bc)
echo ""
echo "Upload speed: $up_mbps mbps"
node ('master'){
checkout([$class: 'GitSCM',
branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'CleanCheckout']],
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: 'git-credentials', url: 'https://github.com/user/repo.git']]
])
steps {
node {
// Mark the code checkout 'stage'....
stage 'checkout'
// Get some code from a GitHub repository
git url: 'https://github.com/test.git'
sh 'git clean -fdx; sleep 4;'
// Get the maven tool.
// ** NOTE: This 'mvn' maven tool must be configured
version: '3'
services:
my-qa.movehq.com:
build:
context: .
args:
- VIRTUAL_HOST=my-qa.movehq.com
- buildno
- gitcommithash
labels:
import net.bull.javamelody.*;
import net.bull.javamelody.internal.model.*;
url = "http://myserver:8080/mywebapp/monitoring";
double cpu = new RemoteCall(url).collectGraphLastValue("cpu");
println "cpu = " + cpu;
double gc = new RemoteCall(url).collectGraphLastValue("gc");
println "gc = " + gc;
java = new RemoteCall(url).collectJavaInformations();
---
- hosts: localhost
gather_facts: True
become: True
tasks:
- name: Download Python 3.3
get_url: dest=/var/local url=http://www.python.org/ftp/python/3.3.5/Python-3.3.5.tar.xz
sudo: yes
- name: Ensure Python 3.3 is extracted