From 511263913c35ee9883d8110d6593a0aec5328360 Mon Sep 17 00:00:00 2001 From: Mangiang Date: Wed, 3 Nov 2021 16:30:17 -0400 Subject: [PATCH] test --- .ansible-items/inventory | 21 +++++++++++---------- .ansible-items/playbook.yml | 4 ++-- .drone-kubernetes.yml | 33 ++++++++++++++------------------- 3 files changed, 27 insertions(+), 31 deletions(-) diff --git a/.ansible-items/inventory b/.ansible-items/inventory index e5ab2cb..5301913 100644 --- a/.ansible-items/inventory +++ b/.ansible-items/inventory @@ -1,10 +1,11 @@ -[sptarkov:hosts] -{{ DEPLOY_HOSTNAME }} - -[sptarkov:vars] -ansible_user={{ DEPLOY_USER }} -ansible_connection=paramiko_ssh -ansible_ssh_pass=test -ansible_ssh_user=drone -ansible_ssh_private_key_file=/drone/src/private.key -# ansible_control_path=/dev/shm/ansible_control_path \ No newline at end of file +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-items/playbook.yml b/.ansible-items/playbook.yml index d850b32..a727a10 100644 --- a/.ansible-items/playbook.yml +++ b/.ansible-items/playbook.yml @@ -36,8 +36,8 @@ - name: Reset files permissions file: path: "{{ lookup('env', 'SPT_ITEMS_PATH') }}" - owner: "{{ lookup('env', 'DEPLOYMENT_USER') }}" - group: "{{ lookup('env', 'DEPLOYMENT_USER_GROUP') }}" + owner: "{{ lookup('env', 'DEPLOY_USER') }}" + group: "{{ lookup('env', 'DEPLOY_USER_GROUP') }}" mode: 0774 recurse: yes diff --git a/.drone-kubernetes.yml b/.drone-kubernetes.yml index 4c72eb1..0725d9a 100644 --- a/.drone-kubernetes.yml +++ b/.drone-kubernetes.yml @@ -35,17 +35,17 @@ steps: - sed -i 's/{{ DEPLOY_SSH_KEY_PASSPHRASE }}/'"$DEPLOY_SSH_KEY_PASSPHRASE"'/g' ./.ansible-items/inventory - sed -i 's/{{ DEPLOY_USER }}/'"$DEPLOY_USER"'/g' ./.ansible-items/inventory -# - name: build frontend -# image: node:lts-alpine3.14 -# commands: -# - node -v -# - npm -v -# - yarn --version -# - yarn --cwd ./items/frontend install -# - yarn --cwd ./items/frontend build --pure-lockfile -# - rm -rf ./items/api/public/static/* -# - mv ./items/frontend/build/* ./items/api/public -# - rm ./items/api/public/index.html +- name: build frontend + image: node:lts-alpine3.14 + commands: + - node -v + - npm -v + - yarn --version + - yarn --cwd ./items/frontend install + - yarn --cwd ./items/frontend build --pure-lockfile + - rm -rf ./items/api/public/static/* + - mv ./items/frontend/build/* ./items/api/public + - rm ./items/api/public/index.html - name: check ansible syntax image: plugins/ansible:3 @@ -65,23 +65,18 @@ steps: inventory: ./.ansible-items/inventory galaxy: ./.ansible-items/requirements.yml timeout: 60 - # verbose: 4 + verbose: 2 environment: DEPLOY_HOSTNAME: from_secret: deploy_hostname SPT_ITEMS_HOSTNAME: from_secret: spt_items_hostname - DEPLOYMENT_USER: + DEPLOY_USER: from_secret: deploy_username - DEPLOYMENT_USER_GROUP: + DEPLOY_USER_GROUP: from_secret: deploy_user_group SPT_ITEMS_PATH: from_secret: deploy_path - # PLUGIN_ANSIBLE_DEBUG: true - # ANSIBLE_CONTROL_PATH: /dev/shm/ - # PLUGIN_ANSIBLE_CONTROL_PATH: /dev/shm/ - # ANSIBLE_SSH_ARGS: '-C -o ControlMaster=auto -o ControlPersist=30m -o ControlPath=/dev/shm/' - # PLUGIN_ANSIBLE_SSH_ARGS: '-C -o ControlMaster=auto -o ControlPersist=30m -o ControlPath=/dev/shm/' when: branch: - master