Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
TetraWiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
OxyPC CICD Documentation
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
''Auto-generated from the uploaded PDF [[:File:OxyPC_CICD_Documentation.pdf|OxyPC_CICD_Documentation.pdf]]. This is an extracted-text rendering for searchability; see the original PDF for exact formatting, diagrams, tables, and images.'' <pre> <nowiki> CI/CD Deployment Pipeline Documentation (OxyPC) 1. Overview This document describes the CI/CD setup for deploying the OxyPC application using Jenkins. 2. Architecture - Source Code: GitHub - CI/CD Tool: Jenkins - Framework: Yii - Deployment Path: /var/www/html/oxypc - Backup Path: /opt/Oxypc_pipeline_code_backup 3. Workflow Developer pushes code β GitHub β Webhook β Jenkins β Deployment 4. Jenkins Job Configuration ο· Job Type: Freestyle ο· Source: GitHub repository ο· Credentials: GitHub token ο· Trigger: GitHub webhook ο· Build Step: Execute shell script 4. Deployment Script Script present in Jenkins Web UI Dashboard>oxypc>Configuration inside build steps TARGET_DIR="/var/www/html/oxypc" WORKSPACE_DIR="/var/lib/jenkins/workspace/oxypc" mkdir -p $TARGET_DIR # Ensure permissions before deployment sudo chown -R jenkins:www-data $TARGET_DIR sudo chmod -R 775 $TARGET_DIR # Deploy code cp -r $WORKSPACE_DIR/ $TARGET_DIR/ # Fix permissions after deployment sudo chown -R jenkins:www-data $TARGET_DIR sudo chmod -R 775 $TARGET_DIR 5. Backup Script Script present in /opt/Oxypc_pipeline_code_backup.sh #!/bin/bash TARGET_DIR="/var/www/html/oxypc" BACKUP_DIR="/opt/Oxypc_pipeline_code_backup" TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S) sudo mkdir -p $BACKUP_DIR if [ -d "$TARGET_DIR" ]; then sudo cp -r $TARGET_DIR $BACKUP_DIR/oxypc_backup_$TIMESTAMP fi 6. Retention Policy Only last 5 backups are retained. Retention Script KEEP=5 cd /opt/Oxypc_pipeline_code_backup ls -1dt oxypc_backup_* | tail -n +$((KEEP+1)) | while read backup do sudo rm -rf "$backup" done Sudo Configuration To allow Jenkins to execute privileged commands: sudo visudo Add: jenkins ALL=(ALL) NOPASSWD: ALL </nowiki> </pre>
Summary:
Please note that all contributions to TetraWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TetraWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)