Compare commits
25 Commits
feeb4e665c
...
783c9126b2
| Author | SHA1 | Date | |
|---|---|---|---|
| 783c9126b2 | |||
|
|
ca35261432 | ||
|
|
a2e446c5b4 | ||
|
|
9cb31912fe | ||
|
|
28a2772714 | ||
|
|
0806e2f99d | ||
|
|
bc8f4a5c98 | ||
|
|
5ba1fcccd1 | ||
|
|
3dffd8505a | ||
|
|
927985d692 | ||
|
|
408d9d7f1e | ||
|
|
ab4016aef4 | ||
|
|
5674895656 | ||
|
|
ebe164c861 | ||
|
|
316ab869d8 | ||
|
|
90d5d05be3 | ||
|
|
3593e52eec | ||
|
|
a0dd1e91db | ||
|
|
1a3bfcad85 | ||
|
|
df31f4672b | ||
|
|
ef2741fccb | ||
|
|
0169c28170 | ||
|
|
92498c074c | ||
|
|
6b4e12697f | ||
|
|
a9df789b04 |
16
.github/workflows/jenkins-deploy.yml
vendored
Normal file
16
.github/workflows/jenkins-deploy.yml
vendored
Normal 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
36
Jenkinsfile
vendored
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,4 +4,4 @@ Application made by django's instruction for **DevOps** education purposes
|
||||
|
||||
# Pylint
|
||||
|
||||

|
||||

|
||||
|
||||
@@ -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"]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user