Posts

 exp 666 sudo wget -O /etc/apt/keyrings/jenkins-keyring.asc \ https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key echo "deb [signed-by=/etc/apt/keyrings/jenkins-keyring.asc]" \ https://pkg.jenkins.io/debian-stable binary/ | sudo tee \ /etc/apt/sources.list.d/jenkins.list > /dev/null sudo systemctl start jenkins HelloMaven-CI https://github.com/devops-ds/your-maven-project.git which mvn #/path/to/your/maven/bin/mvn clean package # Example: /usr/bin/mvn clean package ansible-playbook -i hosts.ini deploy.yml target/*.jar ls -l /var/lib/jenkins/deployment/
 exp 5555555 sudo apt install ansible -y ansible --version gedit hosts.ini [local] localhost ansible_connection=local gedit setup.yml --- - name: Basic Server Setup   hosts: local   become: yes # Use privilege escalation (sudo)   tasks:     - name: Update apt cache       apt:         update_cache: yes     - name: Install curl       apt:         name: curl         state: present sudo ansible-playbook -i hosts.ini setup.yml
 exp 44444 sudo wget -O /etc/apt/keyrings/jenkins-keyring.asc \ https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key echo "deb [signed-by=/etc/apt/keyrings/jenkins-keyring.asc]" \ https://pkg.jenkins.io/debian-stable binary/ | sudo tee \ /etc/apt/sources.list.d/jenkins.list > /dev/null sudo systemctl start jenkins sudo nano/var/lib/jenkins/config.xml https://github.com/devops-ds/your-maven-project.git **/target/surefire-reports/*.xml pipeline {     agent any // Or specify a specific agent label     stages {         stage('Checkout') {             steps {                 // Checkout code from your GitHub repository                 git url: 'https://github.com/devops-ds/your-maven-project.git', branch: 'main' // Replace with your repo URL if different, adjust branch name if needed             ...
 exp 33333333 mvn archetype:generate -DgroupId=com.example -DartifactId=HelloMaven -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false gradle init tree gedit build.gradle /*  * This file was generated by the Gradle 'init' task.  * Modified for Experiment 4 to enable 'gradle run' for an application.  */ plugins {     // Use the application plugin to add support for building and running a Java application     id 'application'     id 'java-library'      id 'maven-publish'  } repositories {     mavenLocal()     maven {         url = uri('https://repo.maven.apache.org/maven2/')     } } dependencies {     // Use JUnit 4 for testing.     testImplementation libs.junit.junit     // Add any other dependencies from your pom.xml here if needed     // Example: implementation 'com.otherlibrary:other-library:1.0' } group = ...
 exp 22222222 cd ~ mkdir HelloGradleGroovy cd HelloGradleGroovy gradle init --type java-application --dsl groovy --overwrite cd ~ tree gedit app/build.gradle plugins {     // Apply the Java plugin for compiling Java code     id 'java'     // Apply the application plugin to add support for building an application     id 'application' } group = 'org.example' version = '1.0' repositories {     // Use Maven Central for resolving dependencies.     mavenCentral() } dependencies {     // Define your dependencies. Use JUnit Jupiter (JUnit 5) for testing.     testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'     testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'     // If using parameterized tests     testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.0' } application {     // Define the main class for the application.     ...
 exp 11111 mkdir ~/ maven_project cd ~/ maven_project mvn archetype:generate -DgroupId=com.example -DartifactId=MyMavenApp -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false cd MyMavenApp sudo snap install tree tree gedit pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0"          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">   <modelVersion>4.0.0</modelVersion>   <groupId>com.example</groupId>   <artifactId>MyMavenApp</artifactId>   <version>1.0-SNAPSHOT</version>   <packaging>jar</packaging>   <properties>     <!-- Java version -->     <maven.compiler.source>17</maven.compiler.source>     <ma...