Compare commits

..

24 Commits

Author SHA1 Message Date
github-actions
ca35261432 Updated pylint badge
Some checks failed
Build and push Docker image / build-and-push (pull_request) Failing after 37m23s
2025-06-09 09:50:57 +00:00
Basyrov Rustam
a2e446c5b4 add jenkins manual deploy
All checks were successful
CI-pipeline / linters (pull_request) Successful in 1m14s
2025-06-09 12:48:04 +03:00
Basyrov Rustam
9cb31912fe full pipeline 2025-06-09 12:29:29 +03:00
Basyrov Rustam
28a2772714 try this 2025-06-09 12:29:00 +03:00
Basyrov Rustam
0806e2f99d test 2025-06-09 12:27:37 +03:00
Basyrov Rustam
bc8f4a5c98 quote EOF 2025-06-09 12:27:13 +03:00
Basyrov Rustam
5ba1fcccd1 test 2025-06-09 12:25:05 +03:00
Basyrov Rustam
3dffd8505a _EOF_ 2025-06-09 12:23:30 +03:00
Basyrov Rustam
927985d692 add bash 2025-06-09 12:21:41 +03:00
Basyrov Rustam
408d9d7f1e fix 2025-06-09 12:18:30 +03:00
Basyrov Rustam
ab4016aef4 test EOF 2025-06-09 12:16:53 +03:00
Basyrov Rustam
5674895656 fix typo 2025-06-09 12:15:31 +03:00
Basyrov Rustam
ebe164c861 add docker compose step 2025-06-09 12:15:05 +03:00
Basyrov Rustam
316ab869d8 test 2 2025-06-09 12:13:11 +03:00
Basyrov Rustam
90d5d05be3 test 2025-06-09 12:11:52 +03:00
Basyrov Rustam
3593e52eec fix
https://serverfault.com/questions/880938/jenkins-host-key-verification-failed
2025-06-09 12:10:09 +03:00
Basyrov Rustam
a0dd1e91db fix 2025-06-09 12:04:30 +03:00
Basyrov Rustam
1a3bfcad85 privcacy fixes 2025-06-09 12:03:03 +03:00
Basyrov Rustam
df31f4672b add port 2025-06-09 12:01:04 +03:00
Basyrov Rustam
ef2741fccb add colons 2025-06-09 12:00:23 +03:00
Basyrov Rustam
0169c28170 make new ssh 2025-06-09 11:58:45 +03:00
Basyrov Rustam
92498c074c init ssh command 2025-06-09 11:52:38 +03:00
Basyrov Rustam
6b4e12697f init Jenkinsfile 2025-06-09 11:24:56 +03:00
Basyrov Rustam
a9df789b04 add trusted origins 2025-06-06 14:43:36 +03:00
4 changed files with 54 additions and 1 deletions

16
.github/workflows/jenkins-deploy.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: Deploy on server
on:
workflow_dispatch:
jobs:
Deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Trigger Jenkins jobs
uses: appleboy/jenkins-action@master
with:
url: "http://ci.saccada.xyz"
user: ${{ env.JENKINS_USERNAME }}
token: ${{ secrets.JENKINS_TOKEN }}
job: "Deploy Django application"

36
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,36 @@
pipeline {
agent any
stages {
stage('Hello') {
steps {
echo 'Hello from Jenkins'
}
}
stage('Connect to server') {
steps {
withCredentials([
sshUserPrivateKey(
credentialsId: '73d234d2-3f9d-44e9-97fc-b6317070b462',
keyFileVariable: 'SSH_PRIVATE_KEY'
)
]) {
sh '''#!/bin/bash
ssh -i "$SSH_PRIVATE_KEY" -p 2222 saccada@saccada.xyz << EOF
cd ~/ws/django-example-app
git pull --rebase
docker compose pull
docker compose down
docker compose up -d
'''
}
}
}
}
post {
always {
sleep 5
}
}
}

View File

@@ -4,4 +4,4 @@ Application made by django's instruction for **DevOps** education purposes
# Pylint
![pylint](https://img.shields.io/badge/PyLint-6.20-orange?logo=python&logoColor=white)
![pylint](https://img.shields.io/badge/PyLint-6.22-orange?logo=python&logoColor=white)

View File

@@ -26,6 +26,7 @@ SECRET_KEY = os.getenv("DJANGO_SECRET_KEY")
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
CSRF_TRUSTED_ORIGINS = ["https://app.saccada.xyz"]
ALLOWED_HOSTS = ["localhost", "app.saccada.xyz"]