chore: remove drone pipeline and update items submodule
This commit is contained in:
parent
0d70a1e0e2
commit
8fb1d51701
@ -1,26 +0,0 @@
|
||||
# Website Deployment
|
||||
|
||||
The deployment happens on commit or merge on `master` branch. It is automatically handled by [DroneCI](https://drone.sp-tarkov.com/SPT-AKI/Website) and Ansible.
|
||||
|
||||
The deployment pipeline lives in:
|
||||
- [.drone-docker.yml](../.drone-docker.yml) for the official [DroneCI](https://drone.sp-tarkov.com/SPT-AKI/Website)
|
||||
- [.drone-kubernetes.yml](../.drone-kubernetes.yml) for anyone testing this on a DroneCI in Kubernetes
|
||||
|
||||
## Deployment flow
|
||||
|
||||
On `development` and feature branches, the deployment flow is:
|
||||
- Cloning the project
|
||||
- Replacing values for ansible inventory file using DroneCI secrets
|
||||
- Checking the playbook syntax
|
||||
- Running the playbook in dry-run mode
|
||||
|
||||
On `master`, the deployment flow is:
|
||||
- Cloning the project
|
||||
- Replacing values for ansible inventory file using DroneCI secrets
|
||||
- Checking the playbook syntax
|
||||
- Running the playbook in dry-run mode
|
||||
- Executing the playbook
|
||||
|
||||
## The playbook
|
||||
|
||||
It has only one instruction: Go to the directory in the server and `git pull` to update everything.
|
@ -1,11 +0,0 @@
|
||||
all:
|
||||
children:
|
||||
sptarkov:
|
||||
hosts:
|
||||
sp-tarkov:
|
||||
ansible_host: {{ DEPLOY_HOSTNAME }}
|
||||
ansible_user: {{ DEPLOY_USER }}
|
||||
ansible_connection: paramiko_ssh
|
||||
ansible_ssh_pass: {{ DEPLOY_SSH_KEY_PASSPHRASE }}
|
||||
ansible_ssh_user: {{ DEPLOY_USER }}
|
||||
ansible_ssh_private_key_file: /drone/src/private.key # Hardcoded because created by the Drone plugin
|
@ -1,11 +0,0 @@
|
||||
---
|
||||
- name: update the server
|
||||
hosts: sptarkov
|
||||
|
||||
tasks:
|
||||
- name: Update website
|
||||
git:
|
||||
repo: "{{ lookup('env', 'DRONE_REPO_LINK') }}"
|
||||
dest: "{{ lookup('env', 'SPT_WEBSITE_PATH') }}"
|
||||
update: yes
|
||||
version: "{{ lookup('env', 'DRONE_BRANCH') }}"
|
@ -1,95 +0,0 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: website deployment
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
|
||||
steps:
|
||||
- name: replace hosts and user variables
|
||||
image: ubuntu:impish
|
||||
environment:
|
||||
DEPLOY_HOSTNAME:
|
||||
from_secret: deploy_hostname
|
||||
DEPLOY_USER:
|
||||
from_secret: deploy_username
|
||||
DEPLOY_PRIVATE_KEY:
|
||||
from_secret: deploy_ssh_key
|
||||
DEPLOY_SSH_KEY_PASSPHRASE:
|
||||
from_secret: deploy_ssh_key_passphrase
|
||||
commands:
|
||||
- echo "$DEPLOY_PRIVATE_KEY" > private.key && chmod 600 private.key
|
||||
- sed -i 's/{{ DEPLOY_HOSTNAME }}/'"$DEPLOY_HOSTNAME"'/g' ./.ansible/inventory
|
||||
- sed -i 's/{{ DEPLOY_SSH_KEY_PASSPHRASE }}/'"$DEPLOY_SSH_KEY_PASSPHRASE"'/g' ./.ansible/inventory
|
||||
- sed -i 's/{{ DEPLOY_USER }}/'"$DEPLOY_USER"'/g' ./.ansible/inventory
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
- development
|
||||
- main
|
||||
- develop
|
||||
|
||||
- name: check website ansible syntax
|
||||
image: plugins/ansible:3
|
||||
settings:
|
||||
playbook: ./.ansible/playbook.yml
|
||||
inventory: ./.ansible/inventory
|
||||
syntax_check: true
|
||||
depends_on:
|
||||
- replace hosts and user variables
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
- development
|
||||
- main
|
||||
- develop
|
||||
|
||||
- name: dry-run ansible playbook website
|
||||
image: plugins/ansible:3
|
||||
settings:
|
||||
playbook: ./.ansible/playbook.yml
|
||||
inventory: ./.ansible/inventory
|
||||
timeout: 60
|
||||
verbose: 3
|
||||
check: true
|
||||
environment:
|
||||
DEPLOY_HOSTNAME:
|
||||
from_secret: deploy_hostname
|
||||
DEPLOY_USER:
|
||||
from_secret: deploy_username
|
||||
DEPLOY_USER_GROUP:
|
||||
from_secret: deploy_user_group
|
||||
SPT_WEBSITE_PATH:
|
||||
from_secret: website_deploy_path
|
||||
depends_on:
|
||||
- check website ansible syntax
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
- development
|
||||
- main
|
||||
- develop
|
||||
|
||||
- name: apply ansible playbook website
|
||||
image: plugins/ansible:3
|
||||
settings:
|
||||
playbook: ./.ansible/playbook.yml
|
||||
inventory: ./.ansible/inventory
|
||||
timeout: 60
|
||||
verbose: 2
|
||||
environment:
|
||||
DEPLOY_HOSTNAME:
|
||||
from_secret: deploy_hostname
|
||||
DEPLOY_USER:
|
||||
from_secret: deploy_username
|
||||
DEPLOY_USER_GROUP:
|
||||
from_secret: deploy_user_group
|
||||
SPT_WEBSITE_PATH:
|
||||
from_secret: website_deploy_path
|
||||
depends_on:
|
||||
- check website ansible syntax
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
- main
|
@ -1,95 +0,0 @@
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: website deployment
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
|
||||
steps:
|
||||
- name: replace hosts and user variables
|
||||
image: ubuntu:impish
|
||||
environment:
|
||||
DEPLOY_HOSTNAME:
|
||||
from_secret: deploy_hostname
|
||||
DEPLOY_USER:
|
||||
from_secret: deploy_username
|
||||
DEPLOY_PRIVATE_KEY:
|
||||
from_secret: deploy_ssh_key
|
||||
DEPLOY_SSH_KEY_PASSPHRASE:
|
||||
from_secret: deploy_ssh_key_passphrase
|
||||
commands:
|
||||
- echo "$DEPLOY_PRIVATE_KEY" > private.key && chmod 600 private.key
|
||||
- sed -i 's/{{ DEPLOY_HOSTNAME }}/'"$DEPLOY_HOSTNAME"'/g' ./.ansible/inventory
|
||||
- sed -i 's/{{ DEPLOY_SSH_KEY_PASSPHRASE }}/'"$DEPLOY_SSH_KEY_PASSPHRASE"'/g' ./.ansible/inventory
|
||||
- sed -i 's/{{ DEPLOY_USER }}/'"$DEPLOY_USER"'/g' ./.ansible/inventory
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
- development
|
||||
- main
|
||||
- develop
|
||||
|
||||
- name: check website ansible syntax
|
||||
image: plugins/ansible:3
|
||||
settings:
|
||||
playbook: ./.ansible/playbook.yml
|
||||
inventory: ./.ansible/inventory
|
||||
syntax_check: true
|
||||
depends_on:
|
||||
- replace hosts and user variables
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
- development
|
||||
- main
|
||||
- develop
|
||||
|
||||
- name: dry-run ansible playbook website
|
||||
image: plugins/ansible:3
|
||||
settings:
|
||||
playbook: ./.ansible/playbook.yml
|
||||
inventory: ./.ansible/inventory
|
||||
timeout: 60
|
||||
verbose: 3
|
||||
check: true
|
||||
environment:
|
||||
DEPLOY_HOSTNAME:
|
||||
from_secret: deploy_hostname
|
||||
DEPLOY_USER:
|
||||
from_secret: deploy_username
|
||||
DEPLOY_USER_GROUP:
|
||||
from_secret: deploy_user_group
|
||||
SPT_WEBSITE_PATH:
|
||||
from_secret: website_deploy_path
|
||||
depends_on:
|
||||
- check website ansible syntax
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
- development
|
||||
- main
|
||||
- develop
|
||||
|
||||
- name: apply ansible playbook website
|
||||
image: plugins/ansible:3
|
||||
settings:
|
||||
playbook: ./.ansible/playbook.yml
|
||||
inventory: ./.ansible/inventory
|
||||
timeout: 60
|
||||
verbose: 2
|
||||
environment:
|
||||
DEPLOY_HOSTNAME:
|
||||
from_secret: deploy_hostname
|
||||
DEPLOY_USER:
|
||||
from_secret: deploy_username
|
||||
DEPLOY_USER_GROUP:
|
||||
from_secret: deploy_user_group
|
||||
SPT_WEBSITE_PATH:
|
||||
from_secret: website_deploy_path
|
||||
depends_on:
|
||||
- check website ansible syntax
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
- main
|
1
.gitmodules
vendored
1
.gitmodules
vendored
@ -1,3 +1,4 @@
|
||||
[submodule "items"]
|
||||
path = items
|
||||
url = https://dev.sp-tarkov.com/WillDaPope/DB-Website
|
||||
branch = main
|
||||
|
2
items
2
items
@ -1 +1 @@
|
||||
Subproject commit c806cc45eb701f4cc0a54dc885b8fba784f30c73
|
||||
Subproject commit 1f8073873cb7cbc0fdeb08a943c2456b00162012
|
Loading…
x
Reference in New Issue
Block a user