Compare commits
11 Commits
dev
...
feeb4e665c
| Author | SHA1 | Date | |
|---|---|---|---|
| feeb4e665c | |||
| 2718229461 | |||
| c9cb6f1099 | |||
| 0c90dddf05 | |||
| 633b32b222 | |||
| 486f5d325d | |||
| a0a193babc | |||
| 33f13931dc | |||
| ea4486c8ea | |||
| 4a14a6cf48 | |||
| c6d2e6a9d3 |
16
.github/workflows/jenkins-deploy.yml
vendored
16
.github/workflows/jenkins-deploy.yml
vendored
@@ -1,16 +0,0 @@
|
|||||||
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
36
Jenkinsfile
vendored
@@ -1,36 +0,0 @@
|
|||||||
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
|
# Pylint
|
||||||
|
|
||||||

|

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