<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tetrain.com/index.php?action=history&amp;feed=atom&amp;title=OxyPC_CICD_Documentation</id>
	<title>OxyPC CICD Documentation - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tetrain.com/index.php?action=history&amp;feed=atom&amp;title=OxyPC_CICD_Documentation"/>
	<link rel="alternate" type="text/html" href="https://wiki.tetrain.com/index.php?title=OxyPC_CICD_Documentation&amp;action=history"/>
	<updated>2026-07-27T11:10:58Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki.tetrain.com/index.php?title=OxyPC_CICD_Documentation&amp;diff=4325&amp;oldid=prev</id>
		<title>Admin: Auto-created from uploaded PDF text extraction</title>
		<link rel="alternate" type="text/html" href="https://wiki.tetrain.com/index.php?title=OxyPC_CICD_Documentation&amp;diff=4325&amp;oldid=prev"/>
		<updated>2026-07-26T16:27:10Z</updated>

		<summary type="html">&lt;p&gt;Auto-created from uploaded PDF text extraction&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;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.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
CI/CD Deployment Pipeline&lt;br /&gt;
               Documentation (OxyPC)&lt;br /&gt;
&lt;br /&gt;
1. Overview&lt;br /&gt;
This document describes the CI/CD setup for deploying the OxyPC application using Jenkins.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Architecture&lt;br /&gt;
- Source Code: GitHub&lt;br /&gt;
&lt;br /&gt;
- CI/CD Tool: Jenkins&lt;br /&gt;
&lt;br /&gt;
- Framework: Yii&lt;br /&gt;
&lt;br /&gt;
- Deployment Path: /var/www/html/oxypc&lt;br /&gt;
&lt;br /&gt;
- Backup Path: /opt/Oxypc_pipeline_code_backup&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Workflow&lt;br /&gt;
Developer pushes code → GitHub → Webhook → Jenkins → Deployment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Jenkins Job Configuration&lt;br /&gt;
&lt;br /&gt;
      Job Type: Freestyle&lt;br /&gt;
      Source: GitHub repository&lt;br /&gt;
      Credentials: GitHub token&lt;br /&gt;
      Trigger: GitHub webhook&lt;br /&gt;
      Build Step: Execute shell script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Deployment Script&lt;br /&gt;
Script present in Jenkins Web UI&lt;br /&gt;
&lt;br /&gt;
Dashboard&amp;gt;oxypc&amp;gt;Configuration inside build steps&lt;br /&gt;
&lt;br /&gt;
TARGET_DIR=&amp;quot;/var/www/html/oxypc&amp;quot;&lt;br /&gt;
WORKSPACE_DIR=&amp;quot;/var/lib/jenkins/workspace/oxypc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
mkdir -p $TARGET_DIR&lt;br /&gt;
# Ensure permissions before deployment&lt;br /&gt;
sudo chown -R jenkins:www-data $TARGET_DIR&lt;br /&gt;
sudo chmod -R 775 $TARGET_DIR&lt;br /&gt;
&lt;br /&gt;
# Deploy code&lt;br /&gt;
cp -r $WORKSPACE_DIR/ $TARGET_DIR/&lt;br /&gt;
&lt;br /&gt;
# Fix permissions after deployment sudo chown -R jenkins:www-data&lt;br /&gt;
$TARGET_DIR sudo chmod -R 775 $TARGET_DIR&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Backup Script&lt;br /&gt;
Script present in /opt/Oxypc_pipeline_code_backup.sh&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
TARGET_DIR=&amp;quot;/var/www/html/oxypc&amp;quot;&lt;br /&gt;
BACKUP_DIR=&amp;quot;/opt/Oxypc_pipeline_code_backup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S)&lt;br /&gt;
&lt;br /&gt;
sudo mkdir -p $BACKUP_DIR&lt;br /&gt;
&lt;br /&gt;
if   [ -d &amp;quot;$TARGET_DIR&amp;quot; ]; then&lt;br /&gt;
      sudo cp -r $TARGET_DIR $BACKUP_DIR/oxypc_backup_$TIMESTAMP&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
6. Retention Policy&lt;br /&gt;
&lt;br /&gt;
Only last 5 backups are retained.&lt;br /&gt;
&lt;br /&gt;
Retention Script&lt;br /&gt;
KEEP=5&lt;br /&gt;
&lt;br /&gt;
cd /opt/Oxypc_pipeline_code_backup&lt;br /&gt;
&lt;br /&gt;
ls -1dt oxypc_backup_* | tail -n +$((KEEP+1)) | while read backup&lt;br /&gt;
do&lt;br /&gt;
     sudo rm -rf &amp;quot;$backup&amp;quot;&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sudo Configuration&lt;br /&gt;
&lt;br /&gt;
To allow Jenkins to execute privileged commands:&lt;br /&gt;
&lt;br /&gt;
sudo visudo&lt;br /&gt;
&lt;br /&gt;
Add:&lt;br /&gt;
&lt;br /&gt;
jenkins ALL=(ALL) NOPASSWD: ALL&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>