Training - Introduction to DevOps and CI/CD
Last Updated on: August 17, 2021 pm
Maven
pom.xml
Defines project object model.
Example:
1 |
|
Note: packaging
- Is it a WAR, JAR, EAR, or POM?
- How should the app be built
Dependency Management
- Download them from a remote repository (typically online) and then place them in a local repository on your system
- The local repository is
<USER_HOME_DIR>\.m2
Build Steps
compile
- Compile the codetest
- Run the testspackage
- Package up the app (JAR, WAR, EAR)install
- Place package into local repositorydeploy
- Place in remote repository and increment version
Basically, we use mvn clean package
to delete previous build package app.
To run the project in terminal, type java -jar NAMEOFJAR
after compilation.
Setting Up Maven - Mac
- Run
brew install maven
in terminal. - Run
mvn --version
to check installation.
1 |
|
Note:
- Maven Home -
/opt/homebrew/Cellar/maven/3.8.2/libexec
- JAVA Home -
/Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home
settings.xml
Path -/opt/homebrew/Cellar/maven/3.8.2/libexec/conf/settings.xml
.m2
Folder Path -/Users/xinyima/.m2
- Maven Version -
Apache Maven 3.8.2
Introduction to DevOps and CI/CD
What is DevOps
Bring developers and operations closer together to take responsibility for building, deploying and monitoring application
Continuous Integration
Members of a team integrate their work frequently, usually each person integrates at least daily – leading to multiple integrations per day.
Continuous Delivery
The essence is to make sure that the software is always in a state where it could be put into production.
Continuous Delivery = Continuous Integration + Fully automated test suite
Continuous Deployment
An Automated process that goes to production env.
Diff
Pipeline
This is the process that code changes go through before they are ready to be delivered to production.
Process
Code -> Build -> Automated all tests -> Deploy (to Artifactory)
Deployment Strategies
Rolling Deployment
Update Servers one by one - in-place update
Rollback when getting wrong.
Blue-green Deployment
2 Envs.
Install on one of them, then switch.
Canary Release
Jenkins
Jenkins Pipeline
Check in the pipeline file in Git along with the project.
Any Jenkins server can then complete the build - even one just launched from a container. - with Jenkinsfile
Jenkins can also run in a Docker container.