diff --git a/MF01-PRA01.md b/MF01-PRA01.md deleted file mode 100644 index 99204e51..00000000 --- a/MF01-PRA01.md +++ /dev/null @@ -1,236 +0,0 @@ -## MF01-PRA01: Publishing and Managing Quarto Documentation - -### CIFO La Violeta - DevOps IFCT0116-24 MF01 - -In this practical exercise, you will enhance your skills in creating, managing, and publishing documentation using Quarto. You will set up a local Quarto website, customize its content, and publish it to **GitHub Pages**. - -### Objectives - -- Create a local **Markdown Quarto website** -- Modify the website by adding call-outs, new pages, basic formatting, and layout -- Implement Website Navigation -- Include Mermaid diagrams -- Configure the `_quarto.yml` file -- Set up a Git repository and link it to a GitHub remote repository -- **Publish** the website to GitHub Pages - -### Project Base - -- **Reference Documentation:** - - [Quarto Markdown: basics](https://albertprofe.dev/markup/markup-quarto-basics.html) - - [Welcome to Quarto®](https://quarto.org/) - - [Creating a Website](https://quarto.org/docs/websites/) - - [Website Navigation](https://quarto.org/docs/websites/website-navigation.html) - - [GitHub Pages]([GitHub Pages – Quarto](https://quarto.org/docs/publishing/github-pages.html)) - - [Page Layout]([Page Layout – Quarto](https://quarto.org/docs/output-formats/page-layout.html)) - - [Markdown Basics]([Markdown Basics – Quarto](https://quarto.org/docs/authoring/markdown-basics.html)) - - [Mermaid, Diagramming and charting tool](https://mermaid.js.org/) - -### Tasks - -#### 1\. Create a Local Markdown Quarto Website - -- Install **Quarto** if you haven't already. Follow the installation instructions on the [Creating a Website](https://quarto.org/docs/websites/). - -- Create a new Quarto project using the command: - - ```bash - quarto create-project my-quarto-site - ``` - -- Navigate to the newly created project directory: - - ```bash - cd my-quarto-site - ``` - -#### 2\. Modify the Website - -- **Add Call-outs:** - - - Use call-outs to highlight important information. For example: - - ```markdown - ::: callout - This is an important note. - ::: - ``` - -- **Create New Pages:** - - - Add new Markdown files to create additional pages. For example, create a `about.md` file and add it to `_quarto.yml`: - - ```markdown - # About - This is the about page. - ``` - -- **Basic Formatting and Layout:** - - - Use Markdown syntax to format your content. For example: - - ```markdown - # Heading - ## Subheading - This is a paragraph with *italic* and **bold** text. - ``` - - - Customize the layout by editing the `_quarto.yml` file. - -#### 3\. Implement Website Navigation - -- Configure the navigation menu by editing the `_quarto.yml` file. For example: - - ```yml - nav: - - Home: index.qmd - - About: about.qmd - - Contact: contact.qmd - ``` - -#### 4\. Include Mermaid Diagrams - -- Install the Mermaid extension for Quarto if you haven't already. Add the following to your `_quarto.yml` file: - - ```yml - extensions: - - mermaid - ``` - -- Include Mermaid diagrams in your Markdown files. For example: - - ```markdown - ``` mermaid - graph LR - A[Client] --> B[Load Balancer] - B --> C[Server1] - B --> D[Server2] - ``` - - ``` - --- - title: Animal example - --- - classDiagram - note "From Duck till Zebra" - Animal <|-- Duck - note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging" - Animal <|-- Fish - Animal <|-- Zebra - Animal : +int age - Animal : +String gender - Animal: +isMammal() - Animal: +mate() - class Duck{ - +String beakColor - +swim() - +quack() - } - class Fish{ - -int sizeInFeet - -canEat() - } - class Zebra{ - +bool is_wild - +run() - } - ``` - -#### 5\. Configure the `_quarto.yml` File - -- Customize the site's metadata, theme, and other settings in the `_quarto.yml` file. For example: - - ```yml - title: "My Quarto Site" - author: "Your Name" - theme: [journals] - ``` - -#### 6\. Set Up a Git Repository and Link to GitHub - -- Initialize a Git repository in your project directory: - - ```bash - git init - ``` - -- Add all files to the repository: - - ```bash - git add . - ``` - -- Commit the changes: - - ```bash - git commit -m "Initial commit" - ``` - -- Create a new repository on GitHub and link it to your local repository: - - ```bash - git remote add origin https://github.com/your-username/your-repo-name.git - git push -u origin main - ``` - -#### 7\. Publish the Website to GitHub Pages - -- Configure GitHub Pages to serve your Quarto site. Go to your repository settings on GitHub, navigate to the "Pages" section, and select the branch you want to use (e.g., `main`). - -- Use the Quarto command to render and deploy your site to GitHub Pages: - - ```bash - quarto publish gh-pages - ``` - -### Example Code Structure - -Here is an example of how your project structure might look: - -```plaintext -my-quarto-site/ -├── _quarto.yml -├── index.qmd -├── about.qmd -├── contact.qmd -├── .gitignore -└── .git/ -``` - -And an example `_quarto.yml` file: - -```yml -title: "My Quarto Site" -author: "Your Name" -theme: [journals] -nav: - - Home: index.qmd - - About: about.qmd - - Contact: contact.qmd -extensions: - - mermaid -``` - -### Submission Guidelines - -- Fork the existing repository (if applicable) or create a new one on GitHub. -- Create a new branch named `MF01-PRA01-YourNameAndSurname` from the latest commit. -- Implement the required changes and tests. -- Commit your changes with clear, descriptive messages. -- Push your branch to your forked repository. -- Create a pull request to the original repository (if applicable) with a summary of your changes and title: `MF01-PRA01-YourNameAndSurname-PublishingQuartoDocumentation` - - Example: F01-PRA01-EmmaMoskovitz-PublishingQuartoDocumentation - -### Evaluation Criteria - -- Correct setup and configuration of the Quarto website -- Proper use of call-outs, new pages, basic formatting, and layout -- Effective implementation of Website Navigation -- Inclusion of Mermaid diagrams -- Correct configuration of the `_quarto.yml` file -- Successful setup of a Git repository and GitHub remote repository -- Successful publication of the website to GitHub Pages -- Code clarity and documentation quality -- Adherence to best practices for Quarto and GitHub Pages - -Remember to focus on creating a well-structured and visually appealing Quarto website that demonstrates good documentation practices. Good luck! \ No newline at end of file diff --git a/MF02-PRA02.md b/MF02-PRA02.md deleted file mode 100644 index 0454c537..00000000 --- a/MF02-PRA02.md +++ /dev/null @@ -1,90 +0,0 @@ -## MF02-PRA02: Automating Quarto Documentation Publishing with GitHub Actions - -### CIFO La Violeta - DevOps IFCT0116-24 MF02 - -In this practical exercise, you will automate the process of committing, deploying, and publishing your Quarto documentation to GitHub Pages using GitHub Actions. This will eliminate the need to manually run the `quarto publish` command locally each time you update your documentation. - -### Objectives - -- Automate the commit and push process using GitHub Actions. -- Set up a GitHub Action workflow to render and publish your Quarto site automatically. - -### Tasks - -#### 1. Complete a Local Publish - -Before setting up automation, ensure you've completed a local publish of your Quarto project. This step is necessary to generate the `_publish.yml` configuration file required by GitHub Actions. - -```bash -quarto publish gh-pages -``` - -#### 2. Create a `publish.yml` GitHub Action - -Add a `publish.yml` file to your project to automate the publishing process. Save this file in `.github/workflows/`. - -```yaml -name: Quarto Publish - -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - build-deploy: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Quarto - uses: quarto-dev/quarto-actions/setup@v2 - - - name: Render and Publish - uses: quarto-dev/quarto-actions/publish@v2 - with: - target: gh-pages - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -``` - -This action will trigger every time you push changes to the `main` branch or manually dispatch the workflow[2][5][6]. - -### Reference Documentation - -- [GitHub Pages - Quarto](https://quarto.org/docs/publishing/github-pages.html) - -### Submission Guidelines - -- Fork the existing repository (if applicable) or create a new one on GitHub. -- Create a new branch named `MF02-PRA02-YourNameAndSurname` from the latest commit. -- Implement the required changes and tests. -- Commit your changes with clear, descriptive messages. -- Push your branch to your forked repository. -- Create a pull request to the original repository (if applicable) with a summary of your changes and title: `MF02-PRA02-YourNameAndSurname-AutomatingQuartoPublishing` - - Example: `MF02-PRA02-EmmaMoskovitz-AutomatingQuartoPublishing` - -### Evaluation Criteria - -- Successful automation of the commit and push process using GitHub Actions. -- Correct setup of the `publish.yml` file. -- Proper execution of the Quarto site rendering and publishing workflow. -- Code clarity and documentation quality. -- Adherence to best practices for GitHub Actions and Quarto. - -By following these steps, you will streamline your documentation workflow, ensuring that updates are automatically published without manual intervention. - -Citations: -[1] https://www.youtube.com/watch?v=5zYrgRylkH0 -[2] https://quarto.org/docs/publishing/github-pages.html -[3] https://github.com/quarto-dev/quarto-actions -[4] https://github.com/quarto-dev/quarto-cli/discussions/7776 -[5] https://quarto.org/docs/publishing/ci.html -[6] https://thedatasavvycorner.com/blogs/03-quarto-github-actions -[7] https://www.youtube.com/watch?v=arzBRW5XIkg -[8] https://github.com/quarto-dev/quarto-actions/blob/main/examples/example-01-basics.md -[9] https://github.com/marketplace/actions/quarto-render \ No newline at end of file diff --git a/MF03-PRA03.md b/MF03-PRA03.md deleted file mode 100644 index 75c303e1..00000000 --- a/MF03-PRA03.md +++ /dev/null @@ -1,93 +0,0 @@ -## MF03-PRA03: Automating Local and Remote Quarto Publishing with Bash - -### CIFO La Violeta - DevOps IFCT0116-24 MF03 - -In this practical exercise, you will create a **bash script to automate both local and remote operations** for publishing Quarto documentation. - -> This script will handle git operations, Quarto publishing, and create a log file for each execution. - -### Objectives - -- Create a **bash script** to automate local git operations and Quarto publishing. -- Implement logging functionality to track script executions. -- Ensure the script is flexible and user-friendly. - -### Tasks - -#### 1. Create the Bash Script - -Create a new file named `publish_quarto.sh` in your project root directory similar to the following content: - -```bash -#!/bin/bash - -# Check if the commit message is provided -if [ -z "$1" ]; then - echo "Please provide a commit message." - exit 1 -fi - -# Commit the changes with the provided message -git add . -git commit -m "$1" - -# Push the changes to the main branch -git push origin main - -# Publish to GitHub Pages using quarto -quarto publish gh-pages --no-render --no-prompt -``` - -#### 2. Add logging output - -Implement logging functionality to track script executions. - -```bash -log_message() { - local message="$1" - local timestamp=$(date +"%Y-%m-%d %H:%M:%S") - echo "[${timestamp}] ${message}" >> log.txt -} -``` - -#### 3. Make the Script Executable - -Run the following command to make the script executable: - -```bash -chmod +x publish_quarto.sh -``` - -#### 4 Use the Script - -To use the script, run it with a commit message as an argument: - -```bash -./publish_quarto.sh "Your commit message here" -``` - -### Reference Documentation - -- [Bash Scripting Tutorial](https://linuxconfig.org/bash-scripting-tutorial-for-beginners) -- [Quarto CLI Documentation](https://quarto.org/) - -### Submission Guidelines - -- Fork the existing repository (if applicable) or create a new one on GitHub. -- Create a new branch named `MF03-PRA03-YourNameAndSurname` from the latest commit. -- Add the `publish_quarto.sh` script to your repository. -- Commit your changes with clear, descriptive messages. -- Push your branch to your forked repository. -- Create a pull request to the original repository (if applicable) with a summary of your changes and title: `MF03-PRA03-YourNameAndSurname-AutomatingQuartoPublishingWithBash` - - Example: `MF03-PRA03-EmmaMoskovitz-AutomatingQuartoPublishingWithBash` -- **Create** a `PRA03_ANSWER` folder to save the answer, docs and images. - -### Evaluation Criteria - -- Correct implementation of the bash script with all required functionalities. -- Proper error handling and logging mechanisms. -- Clear and informative commit messages. -- Adherence to bash scripting best practices. -- Successful automation of local git operations and Quarto publishing. - -By completing this exercise, you will have created a powerful tool to streamline your Quarto documentation workflow, **automating both local and remote operations** while maintaining a log of all actions performed. \ No newline at end of file diff --git a/MF04-PRA04.md b/MF04-PRA04.md deleted file mode 100644 index becac19d..00000000 --- a/MF04-PRA04.md +++ /dev/null @@ -1,227 +0,0 @@ -## MF04-PRA04: Docker Setup and Containerization for Spring Boot and React Applications - -### CIFO La Violeta - DevOps IFCT0116-24 MF04 - -This practical exercise will guide you through setting up Docker, creating containers for **Spring Boot and React applications**, and managing them effectively. - -> The Spring Boot application will serve a REST API for Book objects, which will be consumed by the React frontend using Axios. - -## Objectives - -- Install Docker CLI -- Create a DockerHub account -- Create Dockerfiles for Spring Boot and React applications -- Build and run Docker containers -- Implement a Book API with Spring Boot -- Consume the API with React using Axios - -### Tasks - -#### 1. Install Docker CLI - -To install Docker CLI on Ubuntu: - -```bash -sudo apt-get update -sudo apt-get install docker-ce-cli -``` - -Verify the installation: - -```bash -docker --version -``` - -#### 2. Create a DockerHub Account - -Visit [Docker Hub](https://hub.docker.com/) and sign up for a new account. - -#### 3. Create Dockerfiles - -##### Spring Boot Dockerfile - -Create a file named `Dockerfile` in your Spring Boot project root (examples): - -```dockerfile -FROM openjdk:21-jdk-slim -MAINTAINER yourname -COPY /resources/spring-boot-app.jar app.jar -ENTRYPOINT ["java", "-jar", "/app.jar"] -``` - -##### React Dockerfile - -Create a file named `Dockerfile` in your React project root: - -```dockerfile -FROM node:14 -WORKDIR /app -COPY /resources/react-app/package*.json ./ -RUN npm install -COPY /resources/react-app . -EXPOSE 3000 -CMD ["npm", "start"] -``` - -#### 4. Build and Run Docker Containers - -For Spring Boot: - -```bash -docker build -t spring-boot-app . -docker run -p 8080:8080 spring-boot-app -``` - -For React: - -```bash -docker build -t react-app . -docker run -p 3000:3000 react-app -``` - -#### 5. H2 Database Configuration - -For in-memory H2 (examples): - -```properties -spring.datasource.url=jdbc:h2:mem:testdb -spring.datasource.driverClassName=org.h2.Driver -spring.datasource.username=sa -spring.datasource.password=password -spring.jpa.database-platform=org.hibernate.dialect.H2Dialect -``` - -For local H2 (optional): - -```properties -spring.datasource.url=jdbc:h2:file:/data/demo -spring.datasource.driverClassName=org.h2.Driver -spring.datasource.username=sa -spring.datasource.password=password -spring.jpa.database-platform=org.hibernate.dialect.H2Dialect -``` - -## 6. Implement Book API with Spring Boot - -Create a `Book` entity: - -```java -@Entity -public class Book { - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private Long id; - private String title; - private String author; - private String isbn; - - // Constructors, getters, and setters -} -``` - -Create a `BookRepository`: - -```java -@Repository -public interface BookRepository extends JpaRepository { -} -``` - -Create a `BookController`: - -```java -@RestController -@RequestMapping("/api/books") -public class BookController { - @Autowired - private BookRepository bookRepository; - - @GetMapping - public List getAllBooks() { - return bookRepository.findAll(); - } - - @PostMapping - public Book createBook(@RequestBody Book book) { - return bookRepository.save(book); - } - - // Additional CRUD operations -} -``` - -## 7. Consume API with React using Axios - -Install Axios in your React project: - -```bash -npm install axios -``` - -Create a component to fetch and display books: - -```jsx -import React, { useState, useEffect } from 'react'; -import axios from 'axios'; - -function BookList() { - const [books, setBooks] = useState([]); - - useEffect(() => { - axios.get('http://localhost:8080/api/books') - .then(response => { - setBooks(response.data); - }) - .catch(error => { - console.error("Error fetching books:", error); - }); - }, []); - - return ( -
-

Book List

-
    - {books.map(book => ( -
  • {book.title} by {book.author}
  • - ))} -
-
- ); -} - -export default BookList; -``` - -## Additional Notes - -- Ensure CORS is configured in your Spring Boot application to allow requests from your React app. -- The Spring Boot application will publish a REST API endpoint that the React application will consume using Axios. -- The data exchanged between the backend and frontend will be Book objects, representing the books in your application. -- This setup allows for a clear separation of concerns: the Spring Boot backend handles data persistence and business logic, while the React frontend focuses on presentation and user interaction. - -### Submission Guidelines - -- Fork the repository or create a new one on GitHub. -- Create a branch named `MF04-PRA04-YourNameAndSurname`. -- Implement the required changes and add Dockerfiles. -- Commit with clear messages. -- Push your branch and create a pull request titled `MF04-PRA04-YourNameAndSurname-DockerSetup`. - - Example: `MF04-PRA04-EmmaMoskovitz-AutomatingQuartoPublishingWithBash` -- **Create** a `PRA04_ANSWER` folder to save the answer, docs and images. - -### Evaluation Criteria - -- Successful Docker CLI installation and DockerHub account creation. -- Correct implementation of Dockerfiles for both Spring Boot and React. -- Proper configuration of H2 database. -- Adherence to Docker best practices. -- Clear documentation and commit messages. - -By completing this exercise, you'll gain practical experience in containerizing applications using Docker, an essential skill in modern DevOps practices[1][3][4][5]. - -Citations: -[1] https://medium.com/%40Simplilearn/how-to-install-docker-on-ubuntu-a-step-by-step-guide-updated-simplilearn-14ebf64d4eee -[2] https://stackoverflow.com/questions/38675925/is-it-possible-to-install-only-the-docker-cli-and-not-the-daemon/43594065 -[3] https://docs.docker.com/desktop/setup/install/windows-install/ -[4] https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04 -[5] https://docs.docker.com/engine/install/ \ No newline at end of file diff --git a/MF05-PRA05.md b/MF05-PRA05.md deleted file mode 100644 index 327509b8..00000000 --- a/MF05-PRA05.md +++ /dev/null @@ -1,143 +0,0 @@ -## MF05-PRA05: Jenkins CI/CD Pipeline for Spring Boot Application - -### CIFO La Violeta - DevOps IFCT0116-24 MF05 - -This practical exercise will guide you through setting up a Jenkins CI/CD pipeline for a Spring Boot project, including Docker integration. - -### Tasks - -#### 1. Pull Jenkins Docker Image - -Pull the official Jenkins Docker image from DockerHub: - -```bash -docker pull jenkins/jenkins:lts -``` - -#### 2. Build and Run Jenkins Container - -Create and run a Jenkins container: - -```bash -docker run -d -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home --name jenkins jenkins/jenkins:lts -``` - -To pause the container: - -```bash -docker pause jenkins -``` - -To resume: - -```bash -docker unpause jenkins -``` - -#### 3. Configure Jenkins Account - -Access Jenkins at `http://localhost:8080` and follow the setup wizard. Retrieve the initial admin password from the Docker logs: - -```bash -docker logs jenkins -``` - -Create an admin account during the setup process. - -#### 4. Install Basic Plugins - -In Jenkins, go to "Manage Jenkins" > "Manage Plugins" and install these plugins: - -- Maven Integration -- Git -- Docker -- SSH -- SonarQube Scanner - -#### 5. Create a Pipeline for Spring Boot Project - -Create a new pipeline job in Jenkins and use this script: - -```groovy -pipeline { - agent any - - tools { - maven 'Maven' - jdk 'JDK' - } - - stages { - stage('Checkout') { - steps { - git 'https://github.com/yourusername/PageableBooks.git' - } - } - - stage('Build') { - steps { - sh 'mvn clean package' - } - } - - stage('Docker Build') { - steps { - script { - docker.build("pageablebooks:${env.BUILD_ID}") - } - } - } - - stage('Docker Run') { - steps { - script { - docker.image("pageablebooks:${env.BUILD_ID}").run('-p 8080:8080') - } - } - } - } -} -``` - -Ensure your Spring Boot project (PageableBooks) has a Dockerfile in its root directory: - -```dockerfile -FROM openjdk:11-jre-slim -ARG JAR_FILE=target/*.jar -COPY ${JAR_FILE} app.jar -ENTRYPOINT ["java","-jar","/app.jar"] -``` - -This pipeline will checkout your code, build the Spring Boot application, create a Docker image, and run it[1][2][3][4][5]. - -### Additional Notes - -- Ensure Docker is installed on the Jenkins server. -- Configure Docker permissions for the Jenkins user. -- Adjust the pipeline script according to your project structure and requirements. - -### Submission Guidelines - -- Fork the repository or create a new one on GitHub. -- Create a branch named `MF05-PRA05-YourNameAndSurname`. -- Implement the required changes and add the Jenkins pipeline script. -- Commit with clear messages. -- Push your branch and create a pull request titled `MF05-PRA05-YourNameAndSurname-JenkinsPipeline`. -- Create a `PRA05_ANSWER` folder to save the answer, docs, and images. - -### Evaluation Criteria - -- Successful setup of Jenkins in Docker. -- Correct installation and configuration of required plugins. -- Proper implementation of the Jenkins pipeline for the Spring Boot project. -- Successful Docker integration within the pipeline. -- Clear documentation and commit messages. - -Citations: -[1] https://dev.to/hackmamba/jenkins-in-docker-running-docker-in-a-jenkins-container-1je?comments_sort=top -[2] https://www.red-gate.com/simple-talk/devops/containers-and-virtualization/deploying-a-dockerized-application-to-the-kubernetes-cluster-using-jenkins/ -[3] https://devopscube.com/docker-containers-as-build-slaves-jenkins/ -[4] https://www.youtube.com/watch?v=RKaxATb2kz8 -[5] https://www.jenkins.io/doc/book/installing/docker/ -[6] https://github.com/jenkinsci/docker -[7] https://phoenixnap.com/kb/how-to-configure-docker-in-jenkins \ No newline at end of file diff --git a/Resources/AWS/install-cli/2024-12-03_18-11.png b/Resources/AWS/install-cli/2024-12-03_18-11.png deleted file mode 100644 index baf225b1..00000000 Binary files a/Resources/AWS/install-cli/2024-12-03_18-11.png and /dev/null differ diff --git a/Resources/AWS/install-cli/2024-12-03_18-12.png b/Resources/AWS/install-cli/2024-12-03_18-12.png deleted file mode 100644 index 6c0c3703..00000000 Binary files a/Resources/AWS/install-cli/2024-12-03_18-12.png and /dev/null differ diff --git a/Resources/AWS/install-cli/aws-cli.md b/Resources/AWS/install-cli/aws-cli.md deleted file mode 100644 index 284673f4..00000000 --- a/Resources/AWS/install-cli/aws-cli.md +++ /dev/null @@ -1,49 +0,0 @@ -# AWS CLI - -## Install - -To install the AWS CLI on Linux Mint, follow these steps: - -1. **Install via APT:** - - - Update your package list:bash - - `sudo apt-get update` - - - Install AWS CLI:bash - - `sudo apt-get install awscli` - - - Verify installation: - - `aws --version` - -## AWS Credentials - -To log in to your AWS account using the AWS CLI on Linux Mint, follow these steps: - -1. **Retrieve AWS Credentials:** - - - Log in to your AWS Management Console. - - Navigate to the IAM service to create or retrieve your AWS Access Key ID and Secret Access Key. - -2. **Configure AWS CLI:** - - - Open a terminal and run the following command: - - ```bash - aws configure - ``` - - - Enter your **AWS Access Key ID**, **AWS Secret Access Key**, **Default region name** (e.g., `us-west-2`), and **Default output format** (e.g., `json`) when prompted. - -3. **Verify Configuration:** - - - Check if the configuration is successful by listing S3 buckets or describing VPCs: - - ```bash - aws s3 ls - aws ec2 describe-vpcs - ``` - - - If these commands return data, your AWS CLI is configured correctly. diff --git a/Resources/Bash_scripts/qpubl.sh b/Resources/Bash_scripts/qpubl.sh deleted file mode 100644 index 157e79d6..00000000 --- a/Resources/Bash_scripts/qpubl.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# Check if the commit message is provided -if [ -z "$1" ]; then - echo "Please provide a commit message." - exit 1 -fi - -# Commit the changes with the provided message -git add . -git commit -m "$1" - -# Push the changes to the main branch -git push origin main - -# Publish to GitHub Pages using quarto -quarto publish gh-pages --no-render --no-prompt diff --git a/Resources/Bash_scripts/qpubliLog.sh b/Resources/Bash_scripts/qpubliLog.sh deleted file mode 100644 index fb827bda..00000000 --- a/Resources/Bash_scripts/qpubliLog.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# Function to log messages -log_message() { - echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> publish_log.txt -} - -# Check if the commit message is provided -if [ -z "$1" ]; then - echo "Please provide a commit message." - log_message "Error: No commit message provided" - exit 1 -fi - -# Start logging -log_message "Starting Quarto publishing process" - -# Commit the changes with the provided message -git add . -git commit -m "$1" -if [ $? -eq 0 ]; then - log_message "Changes committed successfully" -else - log_message "Error: Git commit failed" - exit 1 -fi - -# Push the changes to the main branch -git push origin main -if [ $? -eq 0 ]; then - log_message "Changes pushed to remote repository" -else - log_message "Error: Git push failed" - exit 1 -fi - -# Publish to GitHub Pages using quarto -quarto publish gh-pages --no-render --no-prompt -if [ $? -eq 0 ]; then - log_message "Quarto site published successfully" -else - log_message "Error: Quarto publish failed" - exit 1 -fi - -log_message "Quarto publishing process completed successfully" - -echo "Process completed. Check publish_log.txt for details." diff --git a/Resources/Bash_scripts/qpubliLogFile.sh b/Resources/Bash_scripts/qpubliLogFile.sh deleted file mode 100644 index 86231d4f..00000000 --- a/Resources/Bash_scripts/qpubliLogFile.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -# Get current date for log file name -log_date=$(date '+%Y-%m-%d') -log_file="log_${log_date}.txt" - -# Function to log messages -log_message() { - local message="$(date '+%Y-%m-%d %H:%M:%S') - $1" - echo "$message" | tee -a "$log_file" -} - -# Check if the commit message is provided -if [ -z "$1" ]; then - log_message "Error: Please provide a commit message." - exit 1 -fi - -# Start logging -log_message "Starting Quarto publishing process" - -# Commit the changes with the provided message -git add . -git commit -m "$1" -if [ $? -eq 0 ]; then - log_message "Changes committed successfully" -else - log_message "Error: Git commit failed" - exit 1 -fi - -# Push the changes to the main branch -git push origin main -if [ $? -eq 0 ]; then - log_message "Changes pushed to remote repository" -else - log_message "Error: Git push failed" - exit 1 -fi - -# Publish to GitHub Pages using quarto -quarto publish gh-pages --no-render --no-prompt -if [ $? -eq 0 ]; then - log_message "Quarto site published successfully" -else - log_message "Error: Quarto publish failed" - exit 1 -fi - -log_message "Quarto publishing process completed successfully" - -# Prompt user before exiting -while true; do - read -p "Do you want to exit the script? (y/n): " choice - case "$choice" in - y|Y ) - log_message "Process completed. Check $log_file for details." - exit 0;; - n|N ) - log_message "Continuing with the script..." - # You can add more actions here if needed. - break;; - * ) - echo "Invalid input. Please enter 'y' or 'n'.";; - esac -done diff --git a/Resources/Bash_scripts/qpublish.md b/Resources/Bash_scripts/qpublish.md deleted file mode 100644 index 9199e062..00000000 --- a/Resources/Bash_scripts/qpublish.md +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Publishing Pipeline - -```bash -#!/bin/bash - -# Check if the commit message is provided -if [ -z "$1" ]; then - echo "Please provide a commit message." - exit 1 -fi - -# Commit the changes with the provided message -git add . -git commit -m "$1" - -# Push the changes to the main branch -git push origin main - -# Publish to GitHub Pages using quarto -quarto publish gh-pages --no-render --no-prompt -``` - -## Explanation: - -- The script checks if a commit message is provided. If not, it exits with an error message. - -- It adds all changes (`git add .`), commits them with the provided message (`git commit -m "$1"`), and pushes the changes to the `main` branch (`git push origin main`). - -- Finally, it publishes the Quarto website to GitHub Pages using `quarto publish gh-pages` with the `--no-render` and `--no-prompt` options. - -## Components of the If Statement - -- **`if`**: This keyword begins the conditional statement. - -- **`[ -z "$1" ]`**: This is the condition being evaluated. - - - **`[ ]`**: These are test brackets, which are used to enclose the condition. The space between the brackets and the condition is crucial. - - **`-z`**: This is a test operator that checks if the string that follows is empty. It returns `true` if the string is empty and `false` otherwise. - - **`"$1"`**: This refers to the first command-line argument passed to the script. The double quotes around `$1` ensure that the argument is treated as a single word, even if it contains spaces. - -- **`then`**: This keyword indicates the start of the code block that will be executed if the condition is true. - -## Square Brackets (`[ ]`) - -Square brackets are used as a synonym for the `test` command in Bash. They are primarily used for evaluating expressions and conditions within `if` statements and loops. Here are some key points about their usage: - -- **Test Constructs**: Square brackets are commonly used in `if` statements to evaluate conditions. For example, `[ "$VAR" -eq 2 ]` checks if the variable `VAR` is equal to 2 - -- **Syntax Requirements**: There must be spaces between the brackets and the expression inside them. For example, `[ "$name" = 'Bob' ]` is valid, whereas `[ "$name"='Bob' ]` is not s - -- **Single vs. Double Brackets**: Single square brackets (`[ ]`) are used for basic tests, while double square brackets (`[[ ]]`) offer more advanced features like pattern matching and regular expressions. - -## Semicolon (`;`) - -The semicolon in Bash scripting is used to separate commands on the same line. It acts as a command delimiter, allowing multiple commands to be executed sequentially. Here’s how it works: - -- **Command Separation**: When you want to execute multiple commands in sequence on a single line, you can separate them with a semicolon. For example:bash - - `echo "Hello"; echo "World"` - This will execute both `echo` commands one after the other. - -- **In Conditional Statements**: In `if` statements, a semicolon can be used before the `then` keyword when writing the entire condition on a single line:bash - - `if [ "$name" = 'Bob' ]; then echo "Hello Bob"; fi` - Here, the semicolon separates the condition from the action to be taken if the condition is true. diff --git a/Resources/Deploy-Spring-React/Amplify/deploy-api-localhost/2024-12-02_16-57.png b/Resources/Deploy-Spring-React/Amplify/deploy-api-localhost/2024-12-02_16-57.png deleted file mode 100644 index 1328a5df..00000000 Binary files a/Resources/Deploy-Spring-React/Amplify/deploy-api-localhost/2024-12-02_16-57.png and /dev/null differ diff --git a/Resources/Deploy-Spring-React/Amplify/deploy-api-localhost/2024-12-02_16-58.png b/Resources/Deploy-Spring-React/Amplify/deploy-api-localhost/2024-12-02_16-58.png deleted file mode 100644 index 2ab11060..00000000 Binary files a/Resources/Deploy-Spring-React/Amplify/deploy-api-localhost/2024-12-02_16-58.png and /dev/null differ diff --git a/Resources/Deploy-Spring-React/Amplify/deploy-api-localhost/2024-12-02_16-59.png b/Resources/Deploy-Spring-React/Amplify/deploy-api-localhost/2024-12-02_16-59.png deleted file mode 100644 index 38536a89..00000000 Binary files a/Resources/Deploy-Spring-React/Amplify/deploy-api-localhost/2024-12-02_16-59.png and /dev/null differ diff --git a/Resources/Deploy-Spring-React/DockerHub/2024-12-02_17-01.png b/Resources/Deploy-Spring-React/DockerHub/2024-12-02_17-01.png deleted file mode 100644 index cb0f5f5c..00000000 Binary files a/Resources/Deploy-Spring-React/DockerHub/2024-12-02_17-01.png and /dev/null differ diff --git a/Resources/Deploy-Spring-React/DockerHub/2024-12-02_17-02.png b/Resources/Deploy-Spring-React/DockerHub/2024-12-02_17-02.png deleted file mode 100644 index 015bad24..00000000 Binary files a/Resources/Deploy-Spring-React/DockerHub/2024-12-02_17-02.png and /dev/null differ diff --git a/Resources/Deploy-Spring-React/DockerHub/2024-12-02_17-02_1.png b/Resources/Deploy-Spring-React/DockerHub/2024-12-02_17-02_1.png deleted file mode 100644 index e364527e..00000000 Binary files a/Resources/Deploy-Spring-React/DockerHub/2024-12-02_17-02_1.png and /dev/null differ diff --git a/Resources/Deploy-Spring-React/Render/2024-12-02_17-03.png b/Resources/Deploy-Spring-React/Render/2024-12-02_17-03.png deleted file mode 100644 index 2a512559..00000000 Binary files a/Resources/Deploy-Spring-React/Render/2024-12-02_17-03.png and /dev/null differ diff --git a/Resources/Deploy-Spring-React/Render/2024-12-02_17-04.png b/Resources/Deploy-Spring-React/Render/2024-12-02_17-04.png deleted file mode 100644 index 34aba5b3..00000000 Binary files a/Resources/Deploy-Spring-React/Render/2024-12-02_17-04.png and /dev/null differ diff --git a/Resources/Deploy-Spring-React/Render/2024-12-02_17-05.png b/Resources/Deploy-Spring-React/Render/2024-12-02_17-05.png deleted file mode 100644 index 00b3f3f5..00000000 Binary files a/Resources/Deploy-Spring-React/Render/2024-12-02_17-05.png and /dev/null differ diff --git a/Resources/Deploy-Spring-React/Render/2024-12-02_17-05_1.png b/Resources/Deploy-Spring-React/Render/2024-12-02_17-05_1.png deleted file mode 100644 index ece09f9a..00000000 Binary files a/Resources/Deploy-Spring-React/Render/2024-12-02_17-05_1.png and /dev/null differ diff --git a/Resources/Deploy-Spring-React/Render/2024-12-02_17-06.png b/Resources/Deploy-Spring-React/Render/2024-12-02_17-06.png deleted file mode 100644 index ef8f8b27..00000000 Binary files a/Resources/Deploy-Spring-React/Render/2024-12-02_17-06.png and /dev/null differ diff --git a/Resources/Deploy-Spring-React/Render/2024-12-02_17-08.png b/Resources/Deploy-Spring-React/Render/2024-12-02_17-08.png deleted file mode 100644 index da2dd047..00000000 Binary files a/Resources/Deploy-Spring-React/Render/2024-12-02_17-08.png and /dev/null differ diff --git a/Resources/Deploy-Spring-React/Render/2024-12-02_17-16.png b/Resources/Deploy-Spring-React/Render/2024-12-02_17-16.png deleted file mode 100644 index ec0ed9be..00000000 Binary files a/Resources/Deploy-Spring-React/Render/2024-12-02_17-16.png and /dev/null differ diff --git a/Resources/Deploy-Spring-React/Spring-React-Deploy.png b/Resources/Deploy-Spring-React/Spring-React-Deploy.png deleted file mode 100644 index 9201f897..00000000 Binary files a/Resources/Deploy-Spring-React/Spring-React-Deploy.png and /dev/null differ diff --git a/Resources/Deploy-Spring-React/docker-push/2024-12-02_13-54.png b/Resources/Deploy-Spring-React/docker-push/2024-12-02_13-54.png deleted file mode 100644 index a0b5a363..00000000 Binary files a/Resources/Deploy-Spring-React/docker-push/2024-12-02_13-54.png and /dev/null differ diff --git a/Resources/Deploy-Spring-React/docker-push/docker-push.md b/Resources/Deploy-Spring-React/docker-push/docker-push.md deleted file mode 100644 index 97ecff58..00000000 --- a/Resources/Deploy-Spring-React/docker-push/docker-push.md +++ /dev/null @@ -1,5 +0,0 @@ -```bash -docker tag books-backend:latest w3564/books-backend:latest - -docker push w3564/books-backend:latest -``` diff --git a/Resources/Deploy-Spring-React/react-api-spring-deploy.md b/Resources/Deploy-Spring-React/react-api-spring-deploy.md deleted file mode 100644 index c8953d4e..00000000 --- a/Resources/Deploy-Spring-React/react-api-spring-deploy.md +++ /dev/null @@ -1,61 +0,0 @@ -# Book Management Docker-standalone and Cloud Deployment - -This project is a full-stack web application for managing books, consisting of a Spring Boot backend and a React frontend. - -The components are containerized using Docker for local deployment and also deployed to cloud services for production use. - -## Backend (Spring Boot) - -- **Repository**: [BooksPageable](https://github.com/AlbertProfe/BooksPageable) - -- **Description**: RESTful API for managing books - -- **Key Features**: H2 In-Memory Database, RESTful API, CORS Configuration, Pagination Support - -- **Build Tool**: Maven (IntelliJ IDEA) - -- **Local Docker Deployment**: - - ```bash - docker run -d --name books-backend -p 8080:8080 books-backend-image - ``` - -- **Cloud Deployment**: - - - Dockerhub for image storage - - Render for hosting: [https://books-backend-icx2.onrender.com/api/books](https://books-backend-icx2.onrender.com/api/books) - -## Frontend (React) - -- **Repository**: [BooksFrontend](https://github.com/AlbertProfe/BooksFrontend) - -- **Description**: User interface for book management - -- **Key Features**: React UI, Axios Integration, CRUD Operations, Pagination Controls - -- **Build Tool**: npm (Visual Studio Code) - -- **Local Docker Deployment**: - - ```bash - docker run -d --name books-frontend -p 90:80 books-frontend-image - ``` - -- **Cloud Deployment**: - - - GitHub for source control - - AWS Amplify for hosting: [https://master.dfzntypm2yg8j.amplifyapp.com/](https://master.dfzntypm2yg8j.amplifyapp.com/) - -## Cloud Deployment - -1. **Backend (Spring Boot)**: - - - Push Docker image to Dockerhub - - Deploy on Render: [https://books-backend-icx2.onrender.com/api/books](https://books-backend-icx2.onrender.com/api/books) - -2. **Frontend (React)**: - - - Push code to GitHub - - Deploy on AWS Amplify: [https://master.dfzntypm2yg8j.amplifyapp.com/](https://master.dfzntypm2yg8j.amplifyapp.com/) - -This setup allows for both local development using Docker and production deployment using cloud services, providing flexibility and scalability for the Book Management application. diff --git a/Resources/Docker_commands/docker-commands.md b/Resources/Docker_commands/docker-commands.md deleted file mode 100644 index 009afe37..00000000 --- a/Resources/Docker_commands/docker-commands.md +++ /dev/null @@ -1,110 +0,0 @@ -```dockerfile -# Use a Java 17 base image -FROM openjdk:17-jdk-slim - -# Maintainer information -MAINTAINER albertprofe - -# Copy the application JAR file to the container -COPY restaurant-0.0.1-SNAPSHOT.jar restVaadin.jar - -# Set the entry point to run the JAR file -ENTRYPOINT ["java", "-jar", "restVaadin.jar"] -``` - -```bash -docker login -docker build -t restvaadinapp . -docker run -p 8080:8080 restvaadinapp -``` - -| Command | Flag | Description | -| -------------- | --------------- | -------------------------------------------------------------------- | -| `docker build` | `-t, --tag` | Assigns a name and optionally a tag (e.g., `name:tag`) to the image. | -| `docker build` | `-f, --file` | Specifies the Dockerfile to use if it's not named `Dockerfile`. | -| `docker build` | `--build-arg` | Passes build-time variables to the Dockerfile. | -| `docker build` | `--no-cache` | Ignores cached layers and forces a fresh build. | -| `docker build` | `--target` | Builds a specific stage in a multi-stage Dockerfile. | -| `docker build` | `-q, --quiet` | Suppresses output, showing only the final image ID. | -| `docker run` | `-d, --detach` | Runs the container in detached mode (in the background). | -| `docker run` | `-p, --publish` | Maps container ports to host ports (e.g., `8080:80`). | -| `docker run` | `--name` | Assigns a name to the container for easier reference. | -| `docker run` | `-e, --env` | Sets environment variables inside the container. | -| `docker run` | `--rm` | Automatically removes the container when it exits. | -| `docker run` | `-v, --volume` | Mounts host directories or volumes into the container. | -| `docker run` | `--network` | Connects the container to a specified network. | -| `docker run` | `--cpus` | Limits the number of CPUs available to the container. | -| `docker run` | `--memory` | Sets a memory limit for the container. | - -```bash -# Build a Docker image from the current directory's Dockerfile -# -t: Tag the image with the name 'myapp' and version '1.0' -docker build -t myapp:1.0 . - -# Run a new container from the 'myapp' image -# -d: Run the container in detached mode (in the background) -# --name: Assign the name 'myapp_container' to the container -# -p: Map port 8080 on the host to port 80 in the container -docker run -d --name myapp_container -p 8080:80 myapp:1.0 - -# List all running containers -docker ps - -# Show logs from 'myapp_container' -# -f: Follow log output in real-time -docker logs -f myapp_container - -# Display real-time statistics for all running containers -docker stats - -# Stop the 'myapp_container' -docker stop myapp_container - -# Remove the stopped 'myapp_container' -docker rm myapp_container - -# Remove the 'myapp' image -docker rmi myapp:1.0 - -# Clean up unused Docker resources (containers, networks, images) -docker system prune -f -``` - -## Mapping Multiple Ports - -When you want to map multiple ports, you simply specify the `-p` option multiple times in your `docker run` command. Here is an example: - -```bash -`docker run -d --name my_container -p 8080:80 -p 8443:443 nginx` -``` - -## Explanation - -- **`-d`**: Runs the container in detached mode (in the background). -- **`--name my_container`**: Assigns the name `my_container` to the running container. -- **`-p 8080:80`**: Maps port 80 in the container to port 8080 on the host. This is typically used for HTTP traffic. -- **`-p 8443:443`**: Maps port 443 in the container to port 8443 on the host. This is commonly used for HTTPS traffic - -## Steps to Add a User to the Docker Group - -1. **Create the Docker Group (if it doesn't exist)**:- Run the following command to create the `docker` group if it hasn't been created already:bash - - `sudo groupadd docker` - -2. **Add Your User to the Docker Group**:- Add your user to the `docker` group using the following command. Replace `${USER}` with your username if you're not using an environment variable:bash - - `sudo usermod -aG docker ${USER}` - -3. **Apply Changes**:- Log out and log back in so that your group membership is re-evaluated. - - - Alternatively, you can use the following command to apply the changes without logging out:bash - - `newgrp docker` - -4. **Verify Docker Access**: - - - Test your Docker setup by running a simple command like `docker ps` without `sudo`:bash - - `docker ps` - - - If this command runs successfully without errors, your setup is complete. diff --git a/Resources/Docker_commands/docker-image-container.jpeg b/Resources/Docker_commands/docker-image-container.jpeg deleted file mode 100644 index f18c25b8..00000000 Binary files a/Resources/Docker_commands/docker-image-container.jpeg and /dev/null differ diff --git a/Resources/Docker_commands/docker-image-container2.png b/Resources/Docker_commands/docker-image-container2.png deleted file mode 100644 index d4bdc2eb..00000000 Binary files a/Resources/Docker_commands/docker-image-container2.png and /dev/null differ diff --git a/Resources/Docker_commands/docker-run.md b/Resources/Docker_commands/docker-run.md deleted file mode 100644 index aa33aa16..00000000 --- a/Resources/Docker_commands/docker-run.md +++ /dev/null @@ -1,87 +0,0 @@ -# docker run - -## first container - -![](https://github.com/AlbertProfe/DevOps_PRA/blob/master/Resources/Docker_commands/docker-run.png) - -```bash -docker run -d -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock --name jenkins jenkins/jenkins:lts -``` - -This command creates and runs a new Jenkins container: - -- `-d`: Runs the container in detached mode (in the background) -- `-p 8080:8080`: Maps port 8080 from the container to port 8080 on the host -- `-p 50000:50000`: Maps port 50000 from the container to port 50000 on the host -- `-v jenkins_home:/var/jenkins_home`: Creates a volume named jenkins_home and mounts it to /var/jenkins_home in the container -- `-v /var/run/docker.sock:/var/run/docker.sock`: Mounts the Docker socket from the host to the container -- `--name jenkins`: Names the container "jenkins" -- `jenkins/jenkins:lts`: Specifies the Jenkins LTS image to use - -### docker create - -> We can use the `docker create` command instead of `docker run`. - -The `docker create` command creates a new container from the specified image without starting it. - -```bash -docker create -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock --name jenkins jenkins/jenkins:lts -``` - -This command will create a new container with the specified configuration but won't start it. The container will be in a "**Created**" state, and you can later start it using the `docker start` command. - -Key differences from the original `docker run` command: - -1. `docker create` is used instead of `docker run` -2. The `-d` (detach) flag is removed as it's not needed for container creation - -After creating the container, you can start it when needed using: - -```bash -docker start jenkins -``` - -This approach allows you to set up the container configuration ahead of time without introducing any side effects from starting the container immediately. - -```bash -docker create -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock --name jenkins jenkins/jenkins:lts -``` - -## second container - -This setup creates a Jenkins instance with persistent storage and Docker capabilities, accessible via port 9090 on the host machine: - --  `-v jenkins_home:/var/jenkins_home`: Mount the Docker volume named 'jenkins_home' to /var/jenkins_home in the container. This persists Jenkins data. - -- `-v /var/run/docker.sock:/var/run/docker.sock`: Mount the Docker socket from the host into the container. This allows Jenkins to interact with the Docker daemon on the host. - -- `--name jenkins2`: Assign the name 'jenkins2' to this container. - -```bash -docker run -d -p 9090:8080 -p 50000:50000 --v jenkins_home:/var/jenkins_home --v /var/run/docker.sock:/var/run/docker.sock ---name jenkins2 -jenkins/jenkins:lts -``` - -## third container - -By not mounting any volumes, you ensure that this is a completely fresh instance of Jenkins without any existing configuration or data from previous installation - -```bash -docker run -d -p 9091:8080 -p 50001:50000 ---name -jenkins3 -jenkins/jenkins:lts -``` - -## Links - -DockerHub Jenins - -https://hub.docker.com/r/jenkins/jenkins - -Downloading and running Jenkins in Docker - -https://www.jenkins.io/doc/book/installing/docker/#downloading-and-running-jenkins-in-docker diff --git a/Resources/Docker_commands/docker-run.png b/Resources/Docker_commands/docker-run.png deleted file mode 100644 index 3d6ac360..00000000 Binary files a/Resources/Docker_commands/docker-run.png and /dev/null differ diff --git a/Resources/Docker_commands/docker-states.md b/Resources/Docker_commands/docker-states.md deleted file mode 100644 index a9508287..00000000 --- a/Resources/Docker_commands/docker-states.md +++ /dev/null @@ -1,129 +0,0 @@ -# Docker Images and Containers - -### Image - -An image is a read-only template containing instructions for creating a Docker container: it's like a snapshot of a container. - -Example: - -```bash -jenkins/jenkins:lts -``` - -## Container - -A container is a runnable instance of an image. It's a lightweight, standalone, executable package that includes everything needed to run an application. - -Example: - -```bash -docker run -d -p 8080:8080 -p 50000:50000 \ - -v jenkins_home:/var/jenkins_home \ - -v /var/run/docker.sock:/var/run/docker.sock \ - --name jenkins \ - jenkins/jenkins:lts -``` - - - -## Container States - -1. **Created**: Container is created but not started. -2. **Running**: Container is actively executing processes. -3. **Paused**: Container processes are temporarily stopped. -4. **Exited**: Container has completed its execution or was stopped. -5. **Dead**: Container failed to start or be removed completely. - -## Docker Commands and Container States - -### docker run - -Creates and starts a new container instance. - -```bash -docker run -d --name jenkins jenkins/jenkins:lts -``` - -State Transition: Created → Running - -## docker pause - -Suspends all processes in the specified containers. - -```bash -`docker pause jenkins` -``` - -State: Running → Paused - -*Key Differences* - -- `docker start`: Restarts a stopped container, resuming processes. -- `docker pause`: Suspends processes in a running container without termination. - - - -### docker stop - -Stops a running container. - -```bash -docker stop jenkins -``` - -State Transition: Running → Exited - -### docker start - -Restarts an existing stopped container. - -```bash -docker start jenkins -``` - -State Transition: Exited → Running - -*Key Differenced* - -- `docker start`: Restarts an existing stopped container. -- `docker run`: Creates a new container instance. - -## Docker Stop vs Docker Kill - -The main difference between `docker stop` and `docker kill` lies in how they terminate containers: - -**Docker Stop** - -- Sends a SIGTERM signal first, allowing for graceful shutdown - -- Gives the container a chance to clean up and save data - -- Has a default timeout of 10 seconds before forcefully terminating - -- Preferred for normal container shutdown - -**Docker Kill** - -- Sends a SIGKILL signal immediately - -- Forcefully terminates the container without allowing cleanup - -- Used when containers are unresponsive or need immediate termination - -*When to Use* - -- **Docker Stop**: Use for normal container shutdown to allow proper cleanup and data saving - -- **Docker Kill**: Use when containers are locked up or not responding to stop commands - -It's generally recommended to use `docker stop` first, and only resort to `docker kill` if the container doesn't respond or you need immediate termination[ - -### Key Differences: Docker Stop vs Docker Kill - -| Aspect | Docker Stop | Docker Kill | -| ------------------- | --------------------- | ----------------------- | -| Signal | SIGTERM, then SIGKILL | SIGKILL | -| Graceful Shutdown | Yes | No | -| Cleanup Opportunity | Yes | No | -| Speed | Slower (up to 10s) | Immediate | -| Use Case | Normal shutdown | Unresponsive containers | diff --git a/Resources/Dockerfiles/app.dockerfile b/Resources/Dockerfiles/app.dockerfile deleted file mode 100644 index 975eac3b..00000000 --- a/Resources/Dockerfiles/app.dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -docker# Use a Java 17 base image -FROM openjdk:17-jdk-slim - -# Maintainer information -MAINTAINER albertprofe - -# Copy the application JAR file to the container -COPY restaurant-0.0.1-SNAPSHOT.jar restVaadin.jar - -# Set the entry point to run the JAR file -ENTRYPOINT ["java", "-jar", "restVaadin.jar"] diff --git a/Resources/Dockerfiles/app2.dockerfile b/Resources/Dockerfiles/app2.dockerfile deleted file mode 100644 index a783364d..00000000 --- a/Resources/Dockerfiles/app2.dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Use a Java 21 base image -FROM openjdk:21-jdk-slim - -# Maintainer information -MAINTAINER albertprofe - -# Copy the application JAR file to the container -COPY BooksPageable-0.0.1-SNAPSHOT.jar books.jar - -# Set the entry point to run the JAR file -ENTRYPOINT ["java", "-jar", "books.jar"] diff --git a/Resources/Dockerfiles/app3.dockerfile b/Resources/Dockerfiles/app3.dockerfile deleted file mode 100644 index 6613f303..00000000 --- a/Resources/Dockerfiles/app3.dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -# Use an official lightweight Nginx image -FROM nginx:alpine - -# Set the working directory to /usr/share/nginx/html -WORKDIR /usr/share/nginx/html - -# Copy the static files from the dist directory to the container -COPY books-frontend/dist . - -# Expose port 80 for the web server -EXPOSE 80 - -# Command to run when the container starts -CMD ["nginx", "-g", "daemon off;"] diff --git a/Resources/Dockerfiles/app4.dockerfile b/Resources/Dockerfiles/app4.dockerfile deleted file mode 100644 index 1852d010..00000000 --- a/Resources/Dockerfiles/app4.dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -# Importing JDK and copying required files -FROM openjdk:19-jdk AS build -WORKDIR /app -COPY pom.xml . -COPY src src - -# Copy Maven wrapper -COPY mvnw . -COPY .mvn .mvn - -# Set execution permission for the Maven wrapper -RUN chmod +x ./mvnw -RUN ./mvnw clean package -DskipTests - -# Stage 2: Create the final Docker image using OpenJDK 19 -FROM openjdk:19-jdk -VOLUME /tmp - -# Copy the JAR from the build stage -COPY --from=build /app/target/*.jar app.jar -ENTRYPOINT ["java","-jar","/app.jar"] -EXPOSE 8080 diff --git a/Resources/Jenkins/CDCI-JenkinsToAWS.md b/Resources/Jenkins/CDCI-JenkinsToAWS.md deleted file mode 100644 index b40a8499..00000000 --- a/Resources/Jenkins/CDCI-JenkinsToAWS.md +++ /dev/null @@ -1,89 +0,0 @@ -# CI/CD (Continuous Integration/Continuous Deployment) Jenkins pipeline - -## Key elements - -The **CI/CD (Continuous Integration/Continuous Deployment) pipeline** is used for deploying applications to the AWS cloud. - -The key elements of the pipeline are: - -1\. **Docker**: The pipeline starts with a Docker container, which likely contains the application code and its dependencies. - -2\. **Jenkins**: Jenkins is an open-source automation server that orchestrates the various stages of the CI/CD pipeline. - -3\. **GitHub**: The application code is stored in a GitHub repository, which is integrated with the Jenkins pipeline. - -4\. **AWS ECR (Elastic Container Registry):** After the Docker image is built, it is pushed to the AWS ECR, which is a private Docker container registry hosted on AWS. - -5\. **AWS ECS (Elastic Container Service)**: The Docker image stored in AWS ECR is then deployed to the AWS ECS, which is a fully managed container orchestration service. - -6\. **AWS Fargate or EC2**: The container workloads are then run on either AWS Fargate (a serverless compute engine for containers) or EC2 (Elastic Compute Cloud) instances. - -## Flow summary - -The flow of the pipeline is as follows: - -1\. A developer commits code changes to the GitHub repository. - -2\. Jenkins, which is integrated with GitHub, detects the code changes and triggers the pipeline. - -3\. Jenkins builds a new Docker image using the updated code. - -4\. The Docker image is pushed to the AWS ECR. - -5\. The updated Docker image is then deployed to the AWS ECS, which runs the application on either Fargate or EC2 instances. - -This pipeline automates the process of building, testing, and deploying the application to the AWS cloud, ensuring that changes are integrated and deployed quickly and consistently. - -## Pipeline - -> By integrating Jenkins with GitHub, t**he pipeline is triggered automatically whenever code changes are pushed** to the repository. - -Jenkins then orchestrates the entire process of building, containerizing, and deploying the application to the AWS cloud infrastructure, specifically utilizing the ECR for container image storage and the ECS with Fargate for scalable and managed container deployment. - -1. **Jenkins** Integration with **GitHub**: - - The Jenkins server is integrated with the GitHub repository where the application code is hosted. - - This integration allows Jenkins to monitor the GitHub repository for any code changes or new commits. - - When a developer pushes code changes to the GitHub repository, Jenkins is automatically notified about the update. -2. **Jenkins** as the Pipeline Orchestrator: - - Jenkins is the central orchestrator of the entire CI/CD pipeline. - - It does not directly store the application code itself. Instead, Jenkins retrieves the code from the connected GitHub repository when needed. - - Jenkins manages the various stages of the pipeline, such as building, testing, packaging, and deploying the application. -3. Triggering the Pipeline on **Code Push**: - - When a developer pushes code changes to the GitHub repository, the integration with Jenkins triggers the pipeline automatically. - - This trigger event signals Jenkins to start the predefined pipeline workflow. -4. Building and **Dockerizing** the Spring Boot Application: - - The pipeline executed by Jenkins will first build the Spring Boot application. - - Jenkins then creates a Docker image from the built application, packaging the code and its dependencies into a containerized format. -5. Pushing the Docker Image to **AWS ECR**: - - After the Docker image is built, Jenkins pushes the image to the AWS Elastic Container Registry (ECR). - - ECR is a private Docker container registry hosted on AWS, which provides a secure and scalable location to store the application's Docker images. -6. Deploying to **AWS ECS with Fargate**: - - The pipeline then deploys the Docker image from ECR to the AWS Elastic Container Service (ECS). - - ECS is the container orchestration service provided by AWS, and it is responsible for managing the lifecycle of the containerized application. - - In this case, the application is deployed to run on the AWS Fargate compute engine, which is a serverless option for running containers without the need to manage the underlying infrastructure (EC2 instances). - - - -## AWS Services Deployment - -The use of AWS services in this pipeline helps to achieve continuous integration and continuous deployment, which are important practices in modern software development and deployment workflows.​​​​​​​​​​​​​​​​ - -1. **AWS ECR (Elastic Container Registry):** - - This is a fully managed Docker container registry provided by AWS. - - It allows you to store, manage, and deploy Docker container images securely. - - By storing the Docker images in ECR, the pipeline can ensure that the same consistent and vetted container images are deployed across different environments (e.g., development, staging, production). - - ECR integrates seamlessly with other AWS services, such as ECS, making it easy to deploy the container images. -2. **AWS ECS (Elastic Container Service):** - - ECS is a fully managed container orchestration service provided by AWS. - - It allows you to run and scale Docker containers on a serverless infrastructure. - - ECS takes care of tasks like provisioning and managing the underlying infrastructure (EC2 instances or Fargate) needed to run your containers. - - In the pipeline depicted, the updated Docker image from ECR is deployed to the ECS service, which then manages the containerized application. -3. **AWS Fargate:** - - Fargate is a serverless compute engine for containers provided by AWS. - - It allows you to run containers without having to manage the underlying infrastructure (EC2 instances). - - With Fargate, you only pay for the resources (CPU and memory) consumed by your containers, without having to provision or manage the servers. - - In the pipeline, the containerized application can be deployed to run on the Fargate compute engine. -4. **AWS EC2 (Elastic Compute Cloud):** - - EC2 is the core compute service provided by AWS, allowing you to run virtual machines (instances) on the cloud. - - In the pipeline, the containerized application can also be deployed to run on EC2 instances, where you have more control over the underlying infrastructure. - - EC2 instances provide more flexibility and customization options compared to the serverless Fargate, but require more management overhead. \ No newline at end of file diff --git a/Resources/Jenkins/Pipelines/2022-11-15 13_04_29-Window.png b/Resources/Jenkins/Pipelines/2022-11-15 13_04_29-Window.png deleted file mode 100644 index 626660c5..00000000 Binary files a/Resources/Jenkins/Pipelines/2022-11-15 13_04_29-Window.png and /dev/null differ diff --git a/Resources/Jenkins/Pipelines/2022-11-15 14_09_19-Window.png b/Resources/Jenkins/Pipelines/2022-11-15 14_09_19-Window.png deleted file mode 100644 index ad80185c..00000000 Binary files a/Resources/Jenkins/Pipelines/2022-11-15 14_09_19-Window.png and /dev/null differ diff --git a/Resources/Jenkins/Pipelines/2022-11-15 14_09_19-pipe.png b/Resources/Jenkins/Pipelines/2022-11-15 14_09_19-pipe.png deleted file mode 100644 index ad80185c..00000000 Binary files a/Resources/Jenkins/Pipelines/2022-11-15 14_09_19-pipe.png and /dev/null differ diff --git a/Resources/Jenkins/Pipelines/2022-11-17 12_36_13-Window-2.png b/Resources/Jenkins/Pipelines/2022-11-17 12_36_13-Window-2.png deleted file mode 100644 index e931432b..00000000 Binary files a/Resources/Jenkins/Pipelines/2022-11-17 12_36_13-Window-2.png and /dev/null differ diff --git a/Resources/Jenkins/Pipelines/2022-11-17 12_37_50-Window-3.png b/Resources/Jenkins/Pipelines/2022-11-17 12_37_50-Window-3.png deleted file mode 100644 index 79deb0da..00000000 Binary files a/Resources/Jenkins/Pipelines/2022-11-17 12_37_50-Window-3.png and /dev/null differ diff --git a/Resources/Jenkins/Pipelines/2022-11-17 12_38_59-Window-4.png b/Resources/Jenkins/Pipelines/2022-11-17 12_38_59-Window-4.png deleted file mode 100644 index d6a617e6..00000000 Binary files a/Resources/Jenkins/Pipelines/2022-11-17 12_38_59-Window-4.png and /dev/null differ diff --git a/Resources/Jenkins/app.groovy b/Resources/Jenkins/app.groovy deleted file mode 100644 index 2ffd69b0..00000000 --- a/Resources/Jenkins/app.groovy +++ /dev/null @@ -1,91 +0,0 @@ -pipeline { - agent any - - environment { - DOCKER_IMAGE = "albertprofehub/bookspageable" - AWS_REGION = "us-east-1" - ECR_REGISTRY = ".dkr.ecr.${AWS_REGION}.amazonaws.com" - ECR_REPOSITORY = "bookspageable" - } - - stages { - stage('Checkout') { - steps { - git 'https://github.com/AlbertProfe/BooksPageable.git' - } - } - - stage('Build') { - steps { - sh 'mvn clean package' - } - } - - stage('Docker Build') { - steps { - script { - docker.build("${DOCKER_IMAGE}:${env.BUILD_NUMBER}") - } - } - } - - stage('Login to Docker Hub') { - steps { - script { - docker.withRegistry('https://index.docker.io/v1/', 'dockerhub-credentials') { - // This block will log in using the credentials specified - } - } - } - } - - stage('Push Image to Docker Hub') { - steps { - script { - docker.withRegistry('https://index.docker.io/v1/', 'dockerhub-credentials') { - docker.image("${DOCKER_IMAGE}:${env.BUILD_NUMBER}").push() - } - } - } - } - - stage('Login to AWS ECR') { - steps { - script { - // Authenticate Docker to your Amazon ECR registry - sh ''' - aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${ECR_REGISTRY} - ''' - } - } - } - - stage('Tag and Push Image to ECR') { - steps { - script { - // Tag the image for ECR - sh "docker tag ${DOCKER_IMAGE}:${env.BUILD_NUMBER} ${ECR_REGISTRY}/${ECR_REPOSITORY}:${env.BUILD_NUMBER}" - - // Push the image to ECR - sh "docker push ${ECR_REGISTRY}/${ECR_REPOSITORY}:${env.BUILD_NUMBER}" - } - } - } - - stage('Deploy to ECS') { - steps { - withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', credentialsId: 'fake-aws-credentials']]) { - sh ''' - aws ecs update-service --cluster my-fake-cluster --service my-fake-service --force-new-deployment - ''' - } - } - } - - stage('Cleanup') { - steps { - sh 'docker image prune -af' - } - } - } -} diff --git a/Resources/Jenkins/install-jenkins/2024-11-29_12-00.png b/Resources/Jenkins/install-jenkins/2024-11-29_12-00.png deleted file mode 100644 index a49fc746..00000000 Binary files a/Resources/Jenkins/install-jenkins/2024-11-29_12-00.png and /dev/null differ diff --git a/Resources/Jenkins/install-jenkins/2024-11-29_12-22.png b/Resources/Jenkins/install-jenkins/2024-11-29_12-22.png deleted file mode 100644 index e6b8b82c..00000000 Binary files a/Resources/Jenkins/install-jenkins/2024-11-29_12-22.png and /dev/null differ diff --git a/Resources/Jenkins/install-jenkins/2024-11-29_12-32.png b/Resources/Jenkins/install-jenkins/2024-11-29_12-32.png deleted file mode 100644 index 140db428..00000000 Binary files a/Resources/Jenkins/install-jenkins/2024-11-29_12-32.png and /dev/null differ diff --git a/Resources/Jenkins/install-jenkins/2024-11-29_12-32_1.png b/Resources/Jenkins/install-jenkins/2024-11-29_12-32_1.png deleted file mode 100644 index f4d72979..00000000 Binary files a/Resources/Jenkins/install-jenkins/2024-11-29_12-32_1.png and /dev/null differ diff --git a/Resources/Jenkins/install-jenkins/2024-11-29_12-32_2.png b/Resources/Jenkins/install-jenkins/2024-11-29_12-32_2.png deleted file mode 100644 index 22fefbe7..00000000 Binary files a/Resources/Jenkins/install-jenkins/2024-11-29_12-32_2.png and /dev/null differ diff --git a/Resources/Jenkins/install-jenkins/2024-11-29_12-47.png b/Resources/Jenkins/install-jenkins/2024-11-29_12-47.png deleted file mode 100644 index 6a4e5aea..00000000 Binary files a/Resources/Jenkins/install-jenkins/2024-11-29_12-47.png and /dev/null differ diff --git a/Resources/Jenkins/install-jenkins/2024-11-29_12-48.png b/Resources/Jenkins/install-jenkins/2024-11-29_12-48.png deleted file mode 100644 index 6ee51172..00000000 Binary files a/Resources/Jenkins/install-jenkins/2024-11-29_12-48.png and /dev/null differ diff --git a/Resources/Jenkins/install-jenkins/2024-11-29_12-48_1.png b/Resources/Jenkins/install-jenkins/2024-11-29_12-48_1.png deleted file mode 100644 index 3d377a01..00000000 Binary files a/Resources/Jenkins/install-jenkins/2024-11-29_12-48_1.png and /dev/null differ diff --git a/Resources/Jenkins/install-jenkins/2024-11-29_12-48_2.png b/Resources/Jenkins/install-jenkins/2024-11-29_12-48_2.png deleted file mode 100644 index af2de810..00000000 Binary files a/Resources/Jenkins/install-jenkins/2024-11-29_12-48_2.png and /dev/null differ diff --git a/Resources/Jenkins/jemkins-intro.md b/Resources/Jenkins/jemkins-intro.md deleted file mode 100644 index 2ba5e617..00000000 --- a/Resources/Jenkins/jemkins-intro.md +++ /dev/null @@ -1,157 +0,0 @@ -# Jenkins - -## Installing - -### Prerequisites - -Minimum hardware requirements: - -- 256 MB of RAM - -- 1 GB of drive space (although 10 GB is a recommended minimum if running - Jenkins as a Docker container) - -Recommended hardware configuration for a small team: - -- 4 GB+ of RAM - -- 50 GB+ of drive space - -Comprehensive hardware recommendations: - -- Hardware: see the [Hardware Recommendations](https://www.jenkins.io/doc/book/scaling/hardware-recommendations) page - -Software requirements: - -- Java: see the [Java Requirements](https://www.jenkins.io/doc/book/platform-information/support-policy-java/) page - -- Web browser: see the [Web Browser Compatibility](https://www.jenkins.io/doc/administration/requirements/web-browsers/) page - -- For Windows operating system: [Windows Support Policy](https://www.jenkins.io/doc/administration/requirements/windows/) - -- For Linux operating system: [Linux Support Policy](https://www.jenkins.io/doc/book/platform-information/support-policy-linux/) - -- For servlet containers: [Servlet Container Support Policy](https://www.jenkins.io/doc/book/platform-information/support-policy-servlet-containers/) - -*Links* - -Installing [Linux](https://www.jenkins.io/doc/book/installing/linux/) - -Installing [Docker](https://www.jenkins.io/doc/book/installing/docker/) - -Download docker for [Jenkins](https://hub.docker.com/r/jenkins/jenkins) - -Official Jenkins Docker [image]([docker/README.md at master · jenkinsci/docker · GitHub](https://github.com/jenkinsci/docker/blob/master/README.md)) - -## Pipeline - -To automate the deployment of a Spring Boot project from GitHub using Jenkins and Docker, follow these steps: - -1. **Set Up Jenkins**: Install Jenkins and configure it to use Docker. Ensure Docker is installed on the Jenkins server- - -2. **Create Jenkins Pipeline**: - - - Use a Jenkinsfile to define the pipeline stages: checkout code, build with Maven, create a Docker image, and push it to DockerHub. - -3. **Dockerize the Application**: - - - Create a `Dockerfile` in your Spring Boot project to containerize the application. - -4. **Deploy the Docker Image**: - - - Pull and run the Docker image on your production server. - - - Consider deploying to platforms like AWS, Azure, or Google Cloud for scalability and reliability - -### Dockerfile - -Create a `Dockerfile` in your Spring Boot project directory - -```javadoclike -# Use an official OpenJDK runtime as the base image -FROM openjdk:17-jdk-alpine - -# Add a volume pointing to /tmp -VOLUME /tmp - -# Make port 8080 available to the world outside this container -EXPOSE 8080 - -# The application's jar file -ARG JAR_FILE=target/*.jar - -# Add the application's jar to the container -ADD ${JAR_FILE} app.jar - -# Run the jar file -ENTRYPOINT ["java","-jar","/app.jar"] -``` - -### Jenkinsfile - -Create a `Jenkinsfile` in your project root. To use the pipeline: - -1. Ensure Jenkins is set up with necessary plugins (Docker Pipeline, AWS Credentials, Kubernetes CLI. - -2. Configure AWS credentials in Jenkins. - -3. Create an Amazon ECR repository named "bookspageable". - -4. Set up an EKS cluster and replace "your-eks-cluster-name" in the Jenkinsfile. - -5. *(Optional)* Create a Kubernetes deployment manifest for your application and apply it to your EKS cluster before running this pipeline. - -This pipeline will checkout your code, build the Spring Boot application, create a Docker image, push it to Amazon ECR, and update the deployment in your EKS cluster with the new image - -### AWS Credentials - -```yaml -stage('Deploy to AWS') { - steps { - withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', credentialsId: 'fake-aws-credentials']]) { - sh ''' - aws ecs update-service --cluster my-fake-cluster --service my-fake-service --force-new-deployment - ''' - } - } -} -``` - -Explanation of the Pipeline Stage - -- **withCredentials**: This block allows Jenkins to use the specified AWS credentials securely during the execution of commands within it. -- **sh command**: The command `aws ecs update-service` updates your ECS service with a new deployment, ensuring that it uses the latest Docker image that was pushed earlier in the pipeline - -### Deployment on AWS - -We are using ECS AWS: - -1. **ECS Setup**: Use Amazon ECS to manage Docker containers. Create a cluster and define a task with your Docker image. -2. **Service Update**: Use the AWS CLI command in the Jenkins pipeline to update the ECS service, triggering a new deployment with the latest Docker image. - -*AWS and DockerHub:* - -> Ensure you have configured AWS credentials in Jenkins and have access to your DockerHub account for pushing images. - -AWS can retrieve Docker images from Docker Hub, but it typically involves a few steps to facilitate the process. Here’s how it works: - -1. **Pulling from Docker Hub**: You can pull a Docker image directly from Docker Hub to an AWS service like EC2 or ECS. This process involves using the `docker pull` command on your AWS instance to download the image. - -2. **Using Amazon ECR**: Alternatively, many users prefer to push their Docker images from Docker Hub to Amazon Elastic Container Registry (ECR). This allows for better integration with other AWS services and provides a more secure environment for storing container images. - -3. **Steps to Push an Image from Docker Hub to ECR**: - - - **Authenticate with ECR**: Use the AWS CLI to log in to your ECR registry. - - **Pull the Image**: Pull the desired image from Docker Hub using `docker pull`. - - **Tag the Image**: Tag the pulled image with the ECR repository URI. - - **Push to ECR**: Finally, push the tagged image to your ECR repository using `docker push`. - -4. **AWS Services Deployment**: Once the image is in ECR, you can deploy it using services like Amazon ECS or EKS by referencing the image stored in ECR. - -This process ensures that your Docker images are securely stored and easily accessible within your AWS environment, facilitating seamless deployment and scaling of applications. - -### Execute Pipeline - -Run your Jenkins pipeline. - -> The deployment command will execute using the fake credentials you configured, simulating what would happen in a real environment without making actual changes to any AWS resources. diff --git a/Resources/Jenkins/jenkins-pipeline-figure.png b/Resources/Jenkins/jenkins-pipeline-figure.png deleted file mode 100644 index a4205092..00000000 Binary files a/Resources/Jenkins/jenkins-pipeline-figure.png and /dev/null differ diff --git a/Resources/Jenkins/jenkins-tools/2024-12-03_17-25.png b/Resources/Jenkins/jenkins-tools/2024-12-03_17-25.png deleted file mode 100644 index 72fa8a9c..00000000 Binary files a/Resources/Jenkins/jenkins-tools/2024-12-03_17-25.png and /dev/null differ diff --git a/Resources/Jenkins/jenkins-tools/2024-12-03_17-33.png b/Resources/Jenkins/jenkins-tools/2024-12-03_17-33.png deleted file mode 100644 index bee608ad..00000000 Binary files a/Resources/Jenkins/jenkins-tools/2024-12-03_17-33.png and /dev/null differ diff --git a/Resources/Jenkins/jenkins-tools/jankins-tools.md b/Resources/Jenkins/jenkins-tools/jankins-tools.md deleted file mode 100644 index 823f0f9f..00000000 --- a/Resources/Jenkins/jenkins-tools/jankins-tools.md +++ /dev/null @@ -1,34 +0,0 @@ -## Git - -In the Jenkins GUI, the Git section under Global Tool Configuration indicates that Git is installed and configured. - -1. Name: A user-defined name for this Git installation (e.g., "Default Git"). - -2. Path to Git executable: The location of the Git executable on the Jenkins server. If left blank, Jenkins will use the Git installation found in the system PATH. - -## Maven - -To configure Maven installations in Jenkins with the "Install automatically" option, follow these steps: - -- Go to "Manage Jenkins" > "Global Tool Configuration". -- Scroll down to the "Maven" section and click on "Add Maven". -- Enter a name for this Maven installation, such as "Maven 3.9.6" or "M3". -- Check the "Install automatically" box: Jenkins will handle the download and installation of Maven. -- By default, Jenkins will install Maven from the official Apache repository - - Use the dropdown menu to select the specific version of Maven you wish to install, such as 3.9.6 - -## JDK - -To install Java 21 in Jenkins automatically: - -Download URL for Java 21 - -- **URL**: `https://jdk.java.net/21/` -- **URL**: `https://download.java.net/java/GA/jdk21.0.1/415e3f918a1f4062a0074a2794853d0d/12/GPL/openjdk-21.0.1_linux-x64_bin.tar.gz` - -This URL points to the official Java Development Kit (JDK) 21 download page. - -Subdirectory of Extracted Archive - -- **Subdirectory**: `java-21` -- **Subdirectory**: `jdk-21.0.1` diff --git a/Resources/React_projects/Cors/2024-11-28_11-38.png b/Resources/React_projects/Cors/2024-11-28_11-38.png deleted file mode 100644 index 5901215e..00000000 Binary files a/Resources/React_projects/Cors/2024-11-28_11-38.png and /dev/null differ diff --git a/Resources/React_projects/Cors/2024-11-28_11-38_1.png b/Resources/React_projects/Cors/2024-11-28_11-38_1.png deleted file mode 100644 index 3592b860..00000000 Binary files a/Resources/React_projects/Cors/2024-11-28_11-38_1.png and /dev/null differ diff --git a/Resources/React_projects/Cors/2024-11-28_11-57.png b/Resources/React_projects/Cors/2024-11-28_11-57.png deleted file mode 100644 index 2f1c7fc1..00000000 Binary files a/Resources/React_projects/Cors/2024-11-28_11-57.png and /dev/null differ diff --git a/Resources/React_projects/Cors/2024-11-28_12-05.png b/Resources/React_projects/Cors/2024-11-28_12-05.png deleted file mode 100644 index 5f387fe6..00000000 Binary files a/Resources/React_projects/Cors/2024-11-28_12-05.png and /dev/null differ diff --git a/Resources/React_projects/Cors/2024-11-28_18-33.png b/Resources/React_projects/Cors/2024-11-28_18-33.png deleted file mode 100644 index d42971df..00000000 Binary files a/Resources/React_projects/Cors/2024-11-28_18-33.png and /dev/null differ diff --git a/Resources/React_projects/Cors/2024-11-28_19-08.png b/Resources/React_projects/Cors/2024-11-28_19-08.png deleted file mode 100644 index d48e2dea..00000000 Binary files a/Resources/React_projects/Cors/2024-11-28_19-08.png and /dev/null differ diff --git a/Resources/React_projects/Web_FrontEnd_screenshots/2024-11-27_15-37.png b/Resources/React_projects/Web_FrontEnd_screenshots/2024-11-27_15-37.png deleted file mode 100644 index a34abc07..00000000 Binary files a/Resources/React_projects/Web_FrontEnd_screenshots/2024-11-27_15-37.png and /dev/null differ diff --git a/Resources/React_projects/Web_FrontEnd_screenshots/2024-11-27_15-38.png b/Resources/React_projects/Web_FrontEnd_screenshots/2024-11-27_15-38.png deleted file mode 100644 index b05feb5c..00000000 Binary files a/Resources/React_projects/Web_FrontEnd_screenshots/2024-11-27_15-38.png and /dev/null differ diff --git a/Resources/React_projects/Web_FrontEnd_screenshots/2024-11-27_18-33.png b/Resources/React_projects/Web_FrontEnd_screenshots/2024-11-27_18-33.png deleted file mode 100644 index cad8ae6b..00000000 Binary files a/Resources/React_projects/Web_FrontEnd_screenshots/2024-11-27_18-33.png and /dev/null differ diff --git a/Resources/React_projects/Web_FrontEnd_screenshots/2024-11-27_18-33_1.png b/Resources/React_projects/Web_FrontEnd_screenshots/2024-11-27_18-33_1.png deleted file mode 100644 index b4783cca..00000000 Binary files a/Resources/React_projects/Web_FrontEnd_screenshots/2024-11-27_18-33_1.png and /dev/null differ diff --git a/Resources/React_projects/Web_FrontEnd_screenshots/2024-11-27_18-33_2.png b/Resources/React_projects/Web_FrontEnd_screenshots/2024-11-27_18-33_2.png deleted file mode 100644 index 054e3096..00000000 Binary files a/Resources/React_projects/Web_FrontEnd_screenshots/2024-11-27_18-33_2.png and /dev/null differ diff --git a/Resources/React_projects/dist.tar.gz b/Resources/React_projects/dist.tar.gz deleted file mode 100644 index b8673de6..00000000 Binary files a/Resources/React_projects/dist.tar.gz and /dev/null differ diff --git a/Resources/React_projects/docker_cli_screenshots/2024-11-27-18-27-00-image.png b/Resources/React_projects/docker_cli_screenshots/2024-11-27-18-27-00-image.png deleted file mode 100644 index 16669e15..00000000 Binary files a/Resources/React_projects/docker_cli_screenshots/2024-11-27-18-27-00-image.png and /dev/null differ diff --git a/Resources/React_projects/docker_cli_screenshots/2024-11-27-18-27-52-image.png b/Resources/React_projects/docker_cli_screenshots/2024-11-27-18-27-52-image.png deleted file mode 100644 index 98916f57..00000000 Binary files a/Resources/React_projects/docker_cli_screenshots/2024-11-27-18-27-52-image.png and /dev/null differ diff --git a/Resources/React_projects/docker_cli_screenshots/2024-11-27-18-28-12-image.png b/Resources/React_projects/docker_cli_screenshots/2024-11-27-18-28-12-image.png deleted file mode 100644 index ddc62e9f..00000000 Binary files a/Resources/React_projects/docker_cli_screenshots/2024-11-27-18-28-12-image.png and /dev/null differ diff --git a/Resources/React_projects/docker_cli_screenshots/2024-11-28_18-44.png b/Resources/React_projects/docker_cli_screenshots/2024-11-28_18-44.png deleted file mode 100644 index 08da1bd3..00000000 Binary files a/Resources/React_projects/docker_cli_screenshots/2024-11-28_18-44.png and /dev/null differ diff --git a/Resources/React_projects/react-api-spring.md b/Resources/React_projects/react-api-spring.md deleted file mode 100644 index 80a5de47..00000000 --- a/Resources/React_projects/react-api-spring.md +++ /dev/null @@ -1,92 +0,0 @@ -# Book Management Docker-standalone - -> This project is a full-stack web application for managing books, consisting of two main components: a backend built with Spring Boot and a frontend built with React. -> -> Both components are containerized using Docker, allowing for easy deployment and management. - -## Backend (Spring Boot) - -- **Repository**: [BooksPageable](https://github.com/AlbertProfe/BooksPageable) - -- **Description**: The backend serves as a RESTful API for managing books. - -- **Key Features**: - - - **H2 In-Memory Database**: Utilizes an H2 database for data storage, which is lightweight and suitable for development purposes. - - **RESTful API**: Provides endpoints to perform CRUD (Create, Read, Update, Delete) operations on book data. - - **CORS Configuration**: Configured to allow cross-origin requests from the frontend. - - **Pagination Support**: Implements pagination for efficient data retrieval, allowing users to navigate through large datasets. - - **Build Tool**: Built using `Maven` within IntelliJ IDEA. - -- **Running Environment**: - - - Runs in a Docker container on port 8080. - - - Container Name: `books-backend` - -- Example Command to Run: - - ```bash - docker run -d --name books-backend -p 8080:8080 books-backend-image - ``` - -## Frontend (React) - -- **Repository**: [BooksFrontend](https://github.com/AlbertProfe/BooksFrontend) - -- **Description**: The frontend provides a user interface for interacting with the book management system. - -- **Key Features**: - - - **User Interface**: Built with React, it offers a dynamic and responsive UI for managing books. - - **Axios Integration**: Uses Axios for making HTTP requests to the backend API to fetch and manipulate book data. - - **CRUD Operations**: Allows users to create, read, update, and delete books through the interface. - - **Pagination Controls**: Implements pagination controls to navigate through book listings easily. - - **Build Tool**: Built using `npm` within Visual Studio Code. - -- **Running Environment**: - - - Runs in a Docker container on port 90. - - - Container Name: `books-frontend` - -- Example Command to Run: - - ```bash - docker run -d --name books-frontend -p 90:80 books-frontend-image - ``` - -## Docker Setup - -### Running Containers - -The following Docker containers are currently running: - -```bash -albert@albert-VirtualBox:~$ sudo docker ps -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -79bcfc400b67 books-backend "java -jar books.jar" 46 seconds ago Up 45 seconds 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp peaceful_chaplygin -2fe6368ade9a books-frontend "/docker-entrypoint.…" 14 minutes ago Up 14 minutes 0.0.0.0:90->80/tcp, [::]:90->80/tcp eloquent_margulis -``` - -## Optional Networking - -To enhance communication between the frontend and backend containers, you can create a custom Docker network: - -1. Create a custom network: - - ```bash - docker network create books-network - ``` - -2. Connect both containers to this network: - - ```bash - docker network connect books-network peaceful_chaplygin - - docker network connect books-network eloquent_margulis - ``` - -## CORS Configuration - -CORS (Cross-Origin Resource Sharing) is configured in the Spring Boot application to allow the React frontend to communicate with the backend API without encountering CORS-related issues. diff --git a/Resources/React_projects/react-to-docker.md b/Resources/React_projects/react-to-docker.md deleted file mode 100644 index 4ea95633..00000000 --- a/Resources/React_projects/react-to-docker.md +++ /dev/null @@ -1,74 +0,0 @@ -# Dockerize React app - -## Step 0: create the build - -If you used `create-react-app` to set up your project, you can build it using the following command (with Vite projects works as well): - -```bash -npm run build -``` - -**Verify the Build** - -After running the build command, you should see a `build`/ `dist` folder in your project directory. This folder contains the optimized and minified files ready for deployment. - -After running the build command, you should see a `dist` folder in your project directory. This folder contains the optimized and minified files ready for deployment. - -## Step 1: Structure Your Project - -Ensure your project directory structure includes the `dist` folder within the build context. Here is an example structure: - -```dockerfile -/home/albert/MyProjects/Sandbox/docker-sandbox -├── app3.dockerfile -├── books-frontend - └── dist - ├── index.html - ├── assets - │ ├── index-kQJbKSsj.css - │ └── index-CO1OO85Z.js - └── ... other files ... -``` - -## Step 2: dockerfile - -Here is an example of what the `Dockerfile` should contain: - -```dockerfile -# Use an official lightweight Nginx image -FROM nginx:alpine - -# Set the working directory to /usr/share/nginx/html -WORKDIR /usr/share/nginx/html - -# Copy the static files from the dist directory to the container -COPY books-frontend/dist . - -# Expose port 80 for the web server -EXPOSE 80 - -# Command to run when the container starts -CMD ["nginx", "-g", "daemon off;"] -``` - -## Step 3: build and run - -Navigate to the root directory of your project and run the following command to build the Docker image: - -```bash -docker build -f app3.dockerfile -t books-frontend . -``` - -Once the image is built, you can run a container based on this image using the following command: - -```bash -docker run -d -p 80:80 books-frontend -``` - -## Step 4: manage the docker images - -![](https://raw.githubusercontent.com/AlbertProfe/DevOps_PRA/6e2d40fa94eddec7ca2c12578b3df339c39ceedf/Resources/React_projects/docker_cli_screenshots/2024-11-27-18-27-00-image.png) - -![](https://raw.githubusercontent.com/AlbertProfe/DevOps_PRA/6e2d40fa94eddec7ca2c12578b3df339c39ceedf/Resources/React_projects/docker_cli_screenshots/2024-11-27-18-28-12-image.png) - -![](https://raw.githubusercontent.com/AlbertProfe/DevOps_PRA/6e2d40fa94eddec7ca2c12578b3df339c39ceedf/Resources/React_projects/docker_cli_screenshots/2024-11-27-18-27-52-image.png) diff --git a/Resources/SpringBoot_projects/BooksPageable-0.0.1-SNAPSHOT.jar b/Resources/SpringBoot_projects/BooksPageable-0.0.1-SNAPSHOT.jar deleted file mode 100644 index e8d1dcb4..00000000 Binary files a/Resources/SpringBoot_projects/BooksPageable-0.0.1-SNAPSHOT.jar and /dev/null differ diff --git a/Resources/SpringBoot_projects/BooksPageable-0.0.2-SNAPSHOT.jar b/Resources/SpringBoot_projects/BooksPageable-0.0.2-SNAPSHOT.jar deleted file mode 100644 index b1589ad1..00000000 Binary files a/Resources/SpringBoot_projects/BooksPageable-0.0.2-SNAPSHOT.jar and /dev/null differ diff --git a/Resources/SpringBoot_projects/BooksPageable-0.0.3-SNAPSHOT.jar b/Resources/SpringBoot_projects/BooksPageable-0.0.3-SNAPSHOT.jar deleted file mode 100755 index 2563f730..00000000 Binary files a/Resources/SpringBoot_projects/BooksPageable-0.0.3-SNAPSHOT.jar and /dev/null differ diff --git a/Resources/SpringBoot_projects/BooksPageable-0.0.4-SNAPSHOT.jar b/Resources/SpringBoot_projects/BooksPageable-0.0.4-SNAPSHOT.jar deleted file mode 100644 index 2563f730..00000000 Binary files a/Resources/SpringBoot_projects/BooksPageable-0.0.4-SNAPSHOT.jar and /dev/null differ diff --git a/Resources/TestQuartoGHActions/Publishing with Continuous Integration/TestQuartoGHActions.md b/Resources/TestQuartoGHActions/Publishing with Continuous Integration/TestQuartoGHActions.md deleted file mode 100644 index 8ee112c1..00000000 --- a/Resources/TestQuartoGHActions/Publishing with Continuous Integration/TestQuartoGHActions.md +++ /dev/null @@ -1,198 +0,0 @@ -# Publishing with Continuous Integration (CI) - -## Summary - -Let's summary the process for setting up a GitHub Action to publish a Quarto project. Here’s a breakdown of the steps involved: - -1. **Run Locally**: First, you need to run the command `quarto publish gh-pages` locally within your Quarto project. This step is crucial as it generates the necessary `_publish.yml` configuration file that will be used by the GitHub Action for subsequent invocations. This command publishes your content to the `gh-pages` branch of your repository and ensures that everything is set up correctly for future automated publishing. - -2. **Create GitHub Action File**: After successfully running the local publish, you should create a YAML file for the GitHub Action. Save this file as `.github/workflows/publish.yml` in your project directory. The content of this file defines the workflow for rendering and publishing your site automatically whenever you push changes to the main branch or manually trigger it from the Actions tab. - - Here’s a sample of what your `publish.yml` might look like: - - ```yaml - on: - workflow_dispatch: - push: - branches: main - - name: Quarto Publish - - jobs: - build-deploy: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Quarto - uses: quarto-dev/quarto-actions/setup@v2 - - - name: Render and Publish - uses: quarto-dev/quarto-actions/publish@v2 - with: - target: gh-pages - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ``` - -3. **Commit and Push**: Once you have created and saved the `publish.yml` file, commit your changes and push them to your GitHub repository. This action will trigger the workflow defined in your YAML file, which will render your content and publish it to GitHub Pages automatically. - -4. **Permissions**: Ensure that GitHub Actions has permission to write to your repository. You can check this under the "Actions" section in your repository settings, where you need to select "Read and write permissions" for workflows. - -## Essential Elements of a YAML Workflow File - -You can automate processes within your GitHub repository using GitHub Actions workflows. This setup allows for continuous integration and deployment, enhancing your development workflow with automation - -Key Components - -- **Triggers (`on`)**: Specify when the workflow should run. -- **Jobs**: Define tasks that run in parallel or sequentially. -- **Steps**: Individual commands or actions within a job. -- **Runners (`runs-on`)**: Specify the environment for running jobs, like `ubuntu-latest`. - -To create a YAML workflow file, especially for GitHub Actions, you need to include several essential elements. Here’s a summary of the key components: - -#### Elements of a YAML Workflow File - -1. **Name**: - - - Defines the name of the workflow. - - - Example: - - ```yaml - name: My Workflow - ``` - -2. **Triggers (`on`)**: - - - Specifies the events that will trigger the workflow, such as `push`, `pull_request`, or scheduled events. - - - Example: - - ```yaml - on: - push: - branches: - - main - ``` - -3. **Jobs**: - - - A workflow must contain at least one job that defines the tasks to be executed. - - - Each job runs on a specified runner (e.g., `ubuntu-latest`). - - - Example: - - ```yaml - jobs: - build: - runs-on: ubuntu-latest - ``` - -4. **Steps**: - - - Each job consists of steps that define individual tasks, which can be actions or scripts. - - - Steps can use actions from the GitHub marketplace or run shell commands. - - - Example: - - ```yaml - steps: - - uses: actions/checkout@v3 - - name: Run a script - run: echo "Hello, world!" - ``` - -5. **Environment Variables** (optional): - - - You can define environment variables that can be used in your steps. - - - Example: - - ```yaml - env: - MY_VAR: value - ``` - -6. **Outputs** (optional): - - - Define outputs from jobs that can be used by other jobs in the workflow. - - - Example: - - ```yaml - outputs: - my_output: ${{ steps.step_id.outputs.output_name }} - ``` - -7. **Conditions** (optional): - - - You can specify conditions under which jobs or steps should run using `if`. - - - Example: - - ```yaml - if: github.event_name == 'push' - ``` - -Example Workflow File - -Here’s a complete example of a simple YAML workflow file: - -```yaml -name: CI Workflow - -on: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '14' - - - name: Install dependencies - run: npm install - - - name: Run tests - run: npm test -``` - -This example defines a continuous integration (CI) workflow that triggers on pushes to the main branch, checks out the code, sets up Node.js, installs dependencies, and runs tests. - -## References - -[Publishing with Continuous Integration (CI) – Quarto](https://quarto.org/docs/publishing/ci.html) - -[GitHub Pages – Quarto](https://quarto.org/docs/publishing/github-pages.html) - -[GitHub Actions documentation - GitHub Docs](https://docs.github.com/en/actions) - -[Workflow syntax for GitHub Actions - GitHub Docs](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions) - -[Learn YAML in Y Minutes](https://learnxinyminutes.com/docs/yaml/) - -Some engines: - -[GitHub - actions/checkout: Action for checking out a repo](https://github.com/actions/checkout) - -[GitHub - quarto-dev/quarto-actions](https://github.com/quarto-dev/quarto-actions) - -[quarto-actions/publish at main · quarto-dev/quarto-actions · GitHub](https://github.com/quarto-dev/quarto-actions/tree/main/publish) - -[quarto-actions/render at main · quarto-dev/quarto-actions · GitHub](https://github.com/quarto-dev/quarto-actions/tree/main/render) diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-1-create.png b/Resources/TestQuartoGHActions/QuartoGHActions-1-create.png deleted file mode 100644 index 533e7e48..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-1-create.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-10-published.png b/Resources/TestQuartoGHActions/QuartoGHActions-10-published.png deleted file mode 100644 index 2b08bd40..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-10-published.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-11-published.png b/Resources/TestQuartoGHActions/QuartoGHActions-11-published.png deleted file mode 100644 index b420ca3b..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-11-published.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-12-ghactions.png b/Resources/TestQuartoGHActions/QuartoGHActions-12-ghactions.png deleted file mode 100644 index 6896475a..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-12-ghactions.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-13-ghactions.png b/Resources/TestQuartoGHActions/QuartoGHActions-13-ghactions.png deleted file mode 100644 index f5b4f89f..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-13-ghactions.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-14-ghactions.png b/Resources/TestQuartoGHActions/QuartoGHActions-14-ghactions.png deleted file mode 100644 index e41ec1db..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-14-ghactions.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-15-ghactions.png b/Resources/TestQuartoGHActions/QuartoGHActions-15-ghactions.png deleted file mode 100644 index 7b4be550..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-15-ghactions.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-16-finished.png b/Resources/TestQuartoGHActions/QuartoGHActions-16-finished.png deleted file mode 100644 index 0cc238f0..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-16-finished.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-17-finished.png b/Resources/TestQuartoGHActions/QuartoGHActions-17-finished.png deleted file mode 100644 index e6e282ff..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-17-finished.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-18-third-commit.png b/Resources/TestQuartoGHActions/QuartoGHActions-18-third-commit.png deleted file mode 100644 index 91fe064d..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-18-third-commit.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-19-third-commit.png b/Resources/TestQuartoGHActions/QuartoGHActions-19-third-commit.png deleted file mode 100644 index 741bb180..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-19-third-commit.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-2-git.png b/Resources/TestQuartoGHActions/QuartoGHActions-2-git.png deleted file mode 100644 index 22a1a23b..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-2-git.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-20-third-commit.png b/Resources/TestQuartoGHActions/QuartoGHActions-20-third-commit.png deleted file mode 100644 index 4738fd98..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-20-third-commit.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-21-third-commit.png b/Resources/TestQuartoGHActions/QuartoGHActions-21-third-commit.png deleted file mode 100644 index 56ca6122..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-21-third-commit.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-22-third-commit.png b/Resources/TestQuartoGHActions/QuartoGHActions-22-third-commit.png deleted file mode 100644 index 4a8e16a8..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-22-third-commit.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-3-git.png b/Resources/TestQuartoGHActions/QuartoGHActions-3-git.png deleted file mode 100644 index e05c08d2..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-3-git.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-4-git.png b/Resources/TestQuartoGHActions/QuartoGHActions-4-git.png deleted file mode 100644 index 6f6d8d5f..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-4-git.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-5-git.png b/Resources/TestQuartoGHActions/QuartoGHActions-5-git.png deleted file mode 100644 index 983782ac..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-5-git.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-6-remote.png b/Resources/TestQuartoGHActions/QuartoGHActions-6-remote.png deleted file mode 100644 index f92bc001..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-6-remote.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-7-ghpages.png b/Resources/TestQuartoGHActions/QuartoGHActions-7-ghpages.png deleted file mode 100644 index 539df495..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-7-ghpages.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-8-ghpages.png b/Resources/TestQuartoGHActions/QuartoGHActions-8-ghpages.png deleted file mode 100644 index 379b548d..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-8-ghpages.png and /dev/null differ diff --git a/Resources/TestQuartoGHActions/QuartoGHActions-9-ghpages.png b/Resources/TestQuartoGHActions/QuartoGHActions-9-ghpages.png deleted file mode 100644 index 67af0a41..00000000 Binary files a/Resources/TestQuartoGHActions/QuartoGHActions-9-ghpages.png and /dev/null differ diff --git a/Resources/Ubuntu-auto-installing/Ubuntu-auto-installation.md b/Resources/Ubuntu-auto-installing/Ubuntu-auto-installation.md deleted file mode 100644 index 31064968..00000000 --- a/Resources/Ubuntu-auto-installing/Ubuntu-auto-installation.md +++ /dev/null @@ -1,104 +0,0 @@ -# Introduction to autoinstall - -Auto-install of Ubuntu, also known as unattended or hands-off installation, allows you to perform an automatic installation without user interaction. For Ubuntu Server (version 20.04 and later) and Ubuntu Desktop (version 23.04 and later), this is done using the autoinstall format[1]. - -The process works as follows: - -1. You create an autoinstall configuration file in YAML format, which contains answers to all installation questions[1]. - -2. During the installation process, the system uses this configuration file to automatically answer all setup questions without requiring user input[1]. - -3. If any question is not answered in the configuration file, the installer will use the default option[1]. - -4. You can designate specific sections of the configuration as "interactive" if you want the installer to stop and ask about those particular items[1]. - -5. The installation proceeds automatically, with progress and any errors reported via the system[1]. - -This method differs from the older debian-installer preseeding by using YAML format instead of `debconf-set-selections` and by **defaulting to automatic** answers for any unspecified options[1]. - -# autoinstall quickstart - -This quickstart provides instructions for using autoinstall to set up Ubuntu on an amd64 virtual machine. It offers two methods: network-based installation and installation using a separate volume for autoinstall configuration. - -## Network-based Installation - -1. Download the latest Ubuntu Server ISO. -2. Mount the ISO to a local directory. -3. Create a cloud-init configuration with autoinstall settings. -4. Serve the configuration over HTTP using Python. -5. Create a target VM disk. -6. Run the installation using KVM, pointing to the HTTP server for configuration. -7. Boot the installed system. - -## Installation Using Separate Volume - -1. Download the latest Ubuntu Server ISO. -2. Create user-data and meta-data files with autoinstall configuration. -3. Create an ISO to use as a cloud-init data source. -4. Create a target VM disk. -5. Run the installation using KVM, providing the cloud-init ISO and Ubuntu Server ISO. -6. Boot the installed system. - -Both methods use a basic autoinstall configuration that sets the hostname to "ubuntu-server" and creates a user named "ubuntu" with the password "ubuntu". The installation is performed using KVM, and the resulting system can be booted and accessed using the created disk image[3]. - -# How to use ubuntu-image with the classic command - -The :command:`classic` command in :command:`ubuntu-image` is used to create classical Ubuntu images based on traditional Ubuntu releases (like Desktop or Server images). The :command:`classic` command uses an **image definition** YAML file to define the image structure.[2] - -## Building a basic Ubuntu image for a PC - -```yml -# Image metadata -name: ubuntu-classical-amd64 -display-name: Ubuntu Classical Image for amd64 -revision: 1 -architecture: amd64 -series: noble -class: preinstalled - -# Optional kernel (defaults to 'linux' if omitted) -kernel: linux-image-generic - -# Gadget snap -gadget: - url: https://github.com/canonical/pc-gadget - branch: classic - type: git - -# Root filesystem definition -rootfs: - components: - - main - - restricted - - universe - - multiverse - archive: ubuntu - mirror: http://archive.ubuntu.com/ubuntu/ - pocket: updates - seed: - urls: - - git://git.launchpad.net/~ubuntu-core-dev/ubuntu-seeds/+git/ - names: - - server - - minimal - branch: noble - vcs: true - sources-list-deb822: true - -# Required dependency -customization: - extra-snaps: - - name: snapd - -# Artifacts to generate -artifacts: - img: - - name: ubuntu-classical-amd64.img - manifest: - name: ubuntu-classical-amd64.manifest -``` - -Citations: -[1] https://canonical-subiquity.readthedocs-hosted.com/en/latest/intro-to-autoinstall.html -[2] https://canonical-subiquity.readthedocs-hosted.com/en/latest/howto/ubuntu-image-classic-examples.html -[3] https://ppl-ai-file-upload.s3.amazonaws.com/web/direct-files/19229998/de41f05d-2158-4867-a0cb-0c13f8bfee0e/paste.txt \ No newline at end of file diff --git a/Resources/books/docker_para_devops_r1.pdf b/Resources/books/docker_para_devops_r1.pdf deleted file mode 100644 index c02bb34a..00000000 Binary files a/Resources/books/docker_para_devops_r1.pdf and /dev/null differ diff --git a/images/1-budget.png b/images/1-budget.png new file mode 100644 index 00000000..d6298da0 Binary files /dev/null and b/images/1-budget.png differ diff --git a/images/2-ecr.png b/images/2-ecr.png new file mode 100644 index 00000000..19b6fc54 Binary files /dev/null and b/images/2-ecr.png differ diff --git a/images/3-ecs-cluster.png b/images/3-ecs-cluster.png new file mode 100644 index 00000000..cc029d6e Binary files /dev/null and b/images/3-ecs-cluster.png differ diff --git a/pra06.qmd b/pra06.qmd new file mode 100644 index 00000000..dc22c0bb --- /dev/null +++ b/pra06.qmd @@ -0,0 +1,15 @@ +## MF06-PRA06: AWS Deployment for Spring Boot Docker Application + +## Objectius && Passos aproximats +- Desplegar la imatge creada amb Jenkins als serveis d'AWS que faran la publicació (ECR, ECS i Fargate) +- Crear un compte d'AWS en la Free Tier (capa gratuïta) +- Configurar un Budget per controlar el límit de despesa (que avisi amb un Alert si es supera un determinat llindar mensual sobre el pressupost) +- Crear i configurar els serveis AWS que desplegaran l'aplicació Spring Boot convertida en una imatge per Jenkins +- A ECR crear un repositori (apuntar la públic URI) +- A ECS crear un cluster, task, services, i escollir Fargate com a manera de desplegar la imatge (podríem fer-ho amb EC2 alternativament) +- Tornar a Jenkins per modificar la pipeline per a integrar ECR (connectar automàticament amb ECR a través de la URI on penjarà la imatge, afegir un stage que faci el push a ECR i una latre stage que faci el deploy a ECS) +- Per a activar tot el procés caldrà tornar a executar la pipeline de Jenkins + +![](images/1-budget.png) +![](images/2-ecr.png) +![](images/3-ecs-cluster.png) \ No newline at end of file