-
Notifications
You must be signed in to change notification settings - Fork 4
72 lines (71 loc) · 3.06 KB
/
deploy-service-image.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Deploy Service Image
on:
workflow_dispatch:
inputs:
service_name:
description: "Name of the service"
required: true
jobs: {}
## Disabled by @andgein
# deploy-image:
# runs-on: self-hosted
# steps:
# - name: Check out repository code
# uses: actions/checkout@v2
# - name: Save private keys
# run: |-
# echo "$SSH_KEY" > ~/cloud_ssh_private_key;
# chmod 600 ~/cloud_ssh_private_key;
# echo "$DO_DEPLOY_KEY" > "${{ github.workspace }}/ansible/cloud/cloud_master/files/api_srv/do_deploy_key";
# echo "$DO_TOKENS_PY" > "${{ github.workspace }}/ansible/cloud/cloud_master/files/api_srv/do_tokens.py";
# shell: bash
# env:
# SSH_KEY: ${{ secrets.CLOUD_SSH_PRIVATE_KEY }}
# DO_DEPLOY_KEY: ${{ secrets.DO_DEPLOY_KEY }}
# DO_TOKENS_PY: ${{ secrets.DO_TOKENS_PY }}
# - name: Deploy new image to the cloud
# run: ansible-playbook -vv --private-key=~/cloud_ssh_private_key cloud_master.yaml
# working-directory: "${{ github.workspace }}/ansible/cloud/"
# recreate-team-vms:
# runs-on: self-hosted
# needs: [deploy-image]
# steps:
# - name: Check out repository code
# uses: actions/checkout@v2
# - name: Save private key
# run: 'echo "$SSH_KEY" > ~/cloud_ssh_private_key; chmod 600 ~/cloud_ssh_private_key'
# shell: bash
# env:
# SSH_KEY: ${{ secrets.CLOUD_SSH_PRIVATE_KEY }}
# - name: Copy script
# run: scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/cloud_ssh_private_key .github/scripts/recreate_team_vms.sh [email protected]:~/
# - name: Recreate team VMs
# run: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/cloud_ssh_private_key [email protected] '~/recreate_team_vms.sh ${{ github.event.inputs.service_name }}'
# deploy-proxies:
# runs-on: self-hosted
# needs: [deploy-image]
# steps:
# - name: Check out repository code
# uses: actions/checkout@v2
# - name: Install python
# uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# - name: Install dependencies
# uses: BSFishy/pip-action@v1
# with:
# requirements: vuln_images/requirements.txt
# - name: Save private key
# run: |-
# echo "$DO_DEPLOY_KEY" > "${{ github.workspace }}/ansible/cloud/cloud_master/files/api_srv/do_deploy_key";
# shell: bash
# env:
# DO_DEPLOY_KEY: ${{ secrets.DO_DEPLOY_KEY }}
# - name: Deploy proxies
# run: python3 deploy_proxies.py --skip-preparation ../services/${{ github.event.inputs.service_name }}/deploy.yaml # --skip-dns
# working-directory: "${{ github.workspace }}/vuln_images/"
# env:
# DO_API_TOKEN: ${{ secrets.DO_API_TOKEN }}
# CERTIFICATES_FOLDER: /etc/letsencrypt/live
# PROXY_SSH_KEY: "${{ github.workspace }}/ansible/cloud/cloud_master/files/api_srv/do_deploy_key"
# TEAMS_COUNT: 1