publish to s3

This commit is contained in:
Robert Kaussow 2020-05-26 09:19:21 +02:00
parent 7c7499313e
commit 5b49b99f2c
2 changed files with 23 additions and 72 deletions

View File

@ -245,43 +245,19 @@ local PipelineDocs = {
'cd docs/ && hugo-official', 'cd docs/ && hugo-official',
], ],
}, },
{
name: 'freeze',
image: 'appleboy/drone-ssh:1.5.5',
settings: {
host: { from_secret: 'ssh_host' },
key: { from_secret: 'ssh_key' },
script: [
'cp -R /var/www/virtual/geeklab/html/ansible-later.geekdocs.de/ /var/www/virtual/geeklab/html/ansiblelater_freeze/',
'ln -sfn /var/www/virtual/geeklab/html/ansiblelater_freeze /var/www/virtual/geeklab/ansible-later.geekdocs.de',
],
username: { from_secret: 'ssh_username' },
},
},
{ {
name: 'publish', name: 'publish',
image: 'appleboy/drone-scp', image: 'plugins/s3-sync',
settings: { settings: {
host: { from_secret: 'ssh_host' }, access_key: { from_secret: 's3_access_key' },
key: { from_secret: 'ssh_key' }, bucket: 'geekdocs',
rm: true, delete: true,
source: 'docs/public/*', endpoint: 'https://sp.rknet.org',
strip_components: 2, path_style: true,
target: '/var/www/virtual/geeklab/html/ansible-later.geekdocs.de/', secret_key: { from_secret: 's3_secret_access_key' },
username: { from_secret: 'ssh_username' }, source: 'docs/public/',
}, strip_prefix: 'docs/public/',
}, target: '/${DRONE_REPO_NAME}',
{
name: 'cleanup',
image: 'appleboy/drone-ssh:1.5.5',
settings: {
host: { from_secret: 'ssh_host' },
key: { from_secret: 'ssh_key' },
script: [
'ln -sfn /var/www/virtual/geeklab/html/ansible-later.geekdocs.de /var/www/virtual/geeklab/ansible-later.geekdocs.de',
'rm -rf /var/www/virtual/geeklab/html/ansiblelater_freeze/',
],
username: { from_secret: 'ssh_username' },
}, },
}, },
], ],

View File

@ -361,45 +361,20 @@ steps:
commands: commands:
- cd docs/ && hugo-official - cd docs/ && hugo-official
- name: freeze
image: appleboy/drone-ssh:1.5.5
settings:
host:
from_secret: ssh_host
key:
from_secret: ssh_key
script:
- cp -R /var/www/virtual/geeklab/html/ansible-later.geekdocs.de/ /var/www/virtual/geeklab/html/ansiblelater_freeze/
- ln -sfn /var/www/virtual/geeklab/html/ansiblelater_freeze /var/www/virtual/geeklab/ansible-later.geekdocs.de
username:
from_secret: ssh_username
- name: publish - name: publish
image: appleboy/drone-scp image: plugins/s3-sync
settings: settings:
host: access_key:
from_secret: ssh_host from_secret: s3_access_key
key: bucket: geekdocs
from_secret: ssh_key delete: true
rm: true endpoint: https://sp.rknet.org
source: docs/public/* path_style: true
strip_components: 2 secret_key:
target: /var/www/virtual/geeklab/html/ansible-later.geekdocs.de/ from_secret: s3_secret_access_key
username: source: docs/public/
from_secret: ssh_username strip_prefix: docs/public/
target: /${DRONE_REPO_NAME}
- name: cleanup
image: appleboy/drone-ssh:1.5.5
settings:
host:
from_secret: ssh_host
key:
from_secret: ssh_key
script:
- ln -sfn /var/www/virtual/geeklab/html/ansible-later.geekdocs.de /var/www/virtual/geeklab/ansible-later.geekdocs.de
- rm -rf /var/www/virtual/geeklab/html/ansiblelater_freeze/
username:
from_secret: ssh_username
trigger: trigger:
ref: ref:
@ -470,6 +445,6 @@ depends_on:
--- ---
kind: signature kind: signature
hmac: f0af28ae450c0424b52dd3e988f7521ea6556128002d03f2c6f5b82c3ae2d744 hmac: d4e67d00974f1737d4dadf41a2db23f17f8b69946a0066fe75aa1bcf0edb126e
... ...