diff --git a/Jenkinsmyown b/Jenkinsmyown new file mode 100644 index 00000000..d8bcbb19 --- /dev/null +++ b/Jenkinsmyown @@ -0,0 +1,46 @@ +pipeline { + agent any + + stages { + stage('compile') { + steps { + git url: 'https://github.com/TM1234/samplejavaapp.git' + sh script: '/opt/apache-maven-3.6.3/bin/mvn compile' + } + } + stage('codereview-pmd') { + steps { + sh script: '/opt/apache-maven-3.6.3/bin/mvn -P metrics pmd:pmd' + } + post { + success { + pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/pmd.xml', unHealthy: '' + } + } + } + stage('unit-test') { + steps { + sh script: '/opt/apache-maven-3.6.3/bin/mvn test' + } + post { + success { + junit 'target/surefire-reports/*.xml' + } + } + } + + stage('package') { + steps { + sh script: '/opt/apache-maven-3.6.3/bin/mvn clean package' + } + } + + stage('ansible-ymldeploy') { + steps { + sh 'ansible-playbook -i /home/siusmi test.yml' + } + } + } + + +} diff --git a/abc.txt b/abc.txt new file mode 100644 index 00000000..d31449e6 --- /dev/null +++ b/abc.txt @@ -0,0 +1,2 @@ +IHELLOOOOOOOOOOOOO + diff --git a/jenkinsfile-linux b/jenkinsfile-linux index ca5e0dfe..5bb1a560 100644 --- a/jenkinsfile-linux +++ b/jenkinsfile-linux @@ -4,7 +4,7 @@ pipeline { stages { stage('compile') { steps { - git url: 'https://github.com/lerndevops/samplejavaapp.git' + git url: 'https://github.com/TM1234/samplejavaapp.git' sh script: '/opt/apache-maven-3.6.3/bin/mvn compile' } } diff --git a/myinv b/myinv new file mode 100644 index 00000000..08aceb30 --- /dev/null +++ b/myinv @@ -0,0 +1,2 @@ +18.225.5.147 ansible_ssh_user=devops ansible_ssh_pass=jdokuans + diff --git a/sampleapp.war b/sampleapp.war new file mode 100755 index 00000000..ec40d5e3 Binary files /dev/null and b/sampleapp.war differ diff --git a/test.yml b/test.yml new file mode 100644 index 00000000..6f155de3 --- /dev/null +++ b/test.yml @@ -0,0 +1,19 @@ +--- +- hosts: all +# become: yes + tasks: +#### Downloading script from github + - name: download script from github + become: yes + get_url: + url: https://github.com/TM1234/samplejavaapp/raw/master/sampleapp.war + dest: /opt/samplejavawar7 + mode: 0755 + + + + + + #### - name: download script from github + ###shell: | + ### curl -o /tmp/samplejavanew5.war -H "Authorization: Bearer 29136f9bc571207d00839a5580e48bbd20bf73fb" https://github.com/TM1234/samplejavaapp/raw/master/sampleapp.war