From d5c361298ecdfe25a9ef91784bd1f3cea6c69590 Mon Sep 17 00:00:00 2001 From: SPT-dev Date: Thu, 2 Mar 2023 21:25:15 -0500 Subject: [PATCH] chore: remove drone pipeline and update items submodule --- .ansible/README.md | 26 ------------ .ansible/inventory | 11 ----- .ansible/playbook.yml | 11 ----- .drone-docker.yml | 95 ------------------------------------------- .drone-kubernetes.yml | 95 ------------------------------------------- .gitmodules | 1 + items | 2 +- 7 files changed, 2 insertions(+), 239 deletions(-) delete mode 100644 .ansible/README.md delete mode 100644 .ansible/inventory delete mode 100644 .ansible/playbook.yml delete mode 100644 .drone-docker.yml delete mode 100644 .drone-kubernetes.yml diff --git a/.ansible/README.md b/.ansible/README.md deleted file mode 100644 index e3d0724..0000000 --- a/.ansible/README.md +++ /dev/null @@ -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. \ No newline at end of file diff --git a/.ansible/inventory b/.ansible/inventory deleted file mode 100644 index 5301913..0000000 --- a/.ansible/inventory +++ /dev/null @@ -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 \ No newline at end of file diff --git a/.ansible/playbook.yml b/.ansible/playbook.yml deleted file mode 100644 index aaff23a..0000000 --- a/.ansible/playbook.yml +++ /dev/null @@ -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') }}" diff --git a/.drone-docker.yml b/.drone-docker.yml deleted file mode 100644 index e4d2033..0000000 --- a/.drone-docker.yml +++ /dev/null @@ -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 diff --git a/.drone-kubernetes.yml b/.drone-kubernetes.yml deleted file mode 100644 index 711a3ac..0000000 --- a/.drone-kubernetes.yml +++ /dev/null @@ -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 diff --git a/.gitmodules b/.gitmodules index bf0fc42..9a7b4dc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "items"] path = items url = https://dev.sp-tarkov.com/WillDaPope/DB-Website + branch = main diff --git a/items b/items index c806cc4..1f80738 160000 --- a/items +++ b/items @@ -1 +1 @@ -Subproject commit c806cc45eb701f4cc0a54dc885b8fba784f30c73 +Subproject commit 1f8073873cb7cbc0fdeb08a943c2456b00162012