-
Notifications
You must be signed in to change notification settings - Fork 20
176 lines (162 loc) · 6.74 KB
/
ow_docker-compose.yml
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: 2.x testing with Docker Compose deployment
env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CLIENT_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CLIENT_KEY }}
on:
workflow_dispatch:
inputs:
deployment_version:
default: 'main'
description: 'OpenWIFI deployment repository version to be deployed.'
required: true
owgw_version:
description: 'OpenWIFI Gateway version to be deployed.'
required: false
owsec_version:
description: 'OpenWIFI Security version to be deployed.'
required: false
owfms_version:
description: 'OpenWIFI Firmware version to be deployed.'
required: false
owprov_version:
description: 'OpenWIFI Provisioning version to be deployed.'
required: false
owanalytics_version:
description: 'OpenWIFI Analytics version to be deployed.'
required: false
owsub_version:
description: 'OpenWIFI Subscription (Userportal) version to be deployed.'
required: false
id:
description: 'run identifier'
required: false
microservice:
description: 'OpenWIFI microservice to be tested'
required: true
type: choice
options:
- owgw
- owsec
- owfms
- all
defaults:
run:
shell: bash
jobs:
id:
name: Workflow ID Provider
runs-on: ubuntu-latest
steps:
- name: ${{ github.event.inputs.id }}
run: echo run identifier ${{ inputs.id }}
deploy-controller:
name: Deploy OpenWIFI Cloud SDK
needs: id
runs-on: ubuntu-latest
env:
AWS_DEFAULT_OUTPUT: json
AWS_DEFAULT_REGION: us-east-2
outputs:
gateway_url: ${{ steps.deploy-sdk-docker-compose.outputs.gateway_url }}
sec_url: ${{ steps.deploy-sdk-docker-compose.outputs.sec_url }}
instance_id: ${{ steps.deploy-sdk-docker-compose.outputs.instance_id }}
instance_name: ${{ steps.deploy-sdk-docker-compose.outputs.instance_name }}
instance_public_ip: ${{ steps.deploy-sdk-docker-compose.outputs.instance_public_ip }}
steps:
- uses: actions/checkout@v3
- name: Use deploy-sdk-docker-compose composite action
id: deploy-sdk-docker-compose
uses: ./.github/actions/deploy-sdk-docker-compose
with:
deployment_version: ${{ github.event.inputs.deployment_version }}
owgw_version: ${{ github.event.inputs.owgw_version }}
owsec_version: ${{ github.event.inputs.owsec_version }}
owfms_version: ${{ github.event.inputs.owfms_version }}
owprov_version: ${{ github.event.inputs.owprov_version }}
owanalytics_version: ${{ github.event.inputs.owanalytics_version }}
owsub_version: ${{ github.event.inputs.owsub_version }}
owsec_default_username: ${{ secrets.OWSEC_DEFAULT_USERNAME }}
owsec_default_password: ${{ secrets.OWSEC_DEFAULT_PASSWORD }}
owsec_hashed_default_password: ${{ secrets.UCENTRALGW_AUTH_PASSWORD }}
owsec_new_password: ${{ secrets.OWSEC_NEW_PASSWORD }}
owfms_s3_secret: ${{ secrets.UCENTRALFMS_S3_SECRET }}
owfms_s3_key: ${{ secrets.UCENTRALFMS_S3_KEY }}
rtty_token: ${{ secrets.RTTY_TOKEN }}
instance_ssh_key: ${{ secrets.SSH_LOADSIM }}
deploy-virtual-ap-instance:
name: Deploy virtual AP EC2 instance
needs: deploy-controller
runs-on: ubuntu-latest
env:
AWS_DEFAULT_REGION: us-east-1
outputs:
serial_number: ${{ steps.deploy-virtual-ap-instance.outputs.serial_number }}
instance_id: ${{ steps.deploy-virtual-ap-instance.outputs.instance_id }}
steps:
- uses: actions/checkout@v3
- name: Use deploy-virtual-ap-instance composite action
id: deploy-virtual-ap-instance
uses: ./.github/actions/deploy-virtual-ap-instance
with:
virtual_ap_password: ${{ secrets.VIRTUAL_AP_PASSWORD }}
virtual_ap_cert: ${{ secrets.VIRTUAL_AP_CERT }}
virtual_ap_key: ${{ secrets.VIRTUAL_AP_KEY }}
virtual_ap_dev_id: ${{ secrets.VIRTUAL_AP_DEV_ID }}
gateway_url: ${{ needs.deploy-controller.outputs.gateway_url }}
gateway_public_ip: ${{ needs.deploy-controller.outputs.instance_public_ip }}
test:
name: Test specified microservice
needs: [deploy-controller, deploy-virtual-ap-instance]
runs-on: ubuntu-latest
env:
OWSEC: "${{ needs.deploy-controller.outputs.sec_url }}:16001"
OWSEC_USERNAME: ${{ secrets.OWSEC_DEFAULT_USERNAME }}
OWSEC_PASSWORD: ${{ secrets.OWSEC_NEW_PASSWORD }}
FLAGS: "-s -k"
steps:
- name: Add hostname for ${{ needs.deploy-controller.outputs.sec_url }}
run: |
echo "${{ needs.deploy-controller.outputs.instance_public_ip }} ${{ needs.deploy-controller.outputs.sec_url }}" | sudo tee -a /etc/hosts
- name: Get OWGW CLI script and test service
if: github.event.inputs.microservice == 'owgw' || github.event.inputs.microservice == 'all'
run: |
curl -s https://raw.githubusercontent.com/Telecominfraproject/wlan-cloud-ucentralgw/master/test_scripts/curl/cli -o cli
chmod +x cli
./cli test_service ${{ needs.deploy-virtual-ap-instance.outputs.serial_number }}
- name: Get OWSec CLI script and test service
if: github.event.inputs.microservice == 'owsec' || github.event.inputs.microservice == 'all'
run: |
curl -s https://raw.githubusercontent.com/Telecominfraproject/wlan-cloud-ucentralsec/main/test_scripts/curl/cli -o cli
chmod +x cli
./cli test_service
- name: Get OWFms CLI script and test service
if: github.event.inputs.microservice == 'owfms' || github.event.inputs.microservice == 'all'
run: |
curl -s https://raw.githubusercontent.com/Telecominfraproject/wlan-cloud-ucentralfms/main/test_scripts/curl/cli -o cli
chmod +x cli
./cli test_service ${{ needs.deploy-virtual-ap-instance.outputs.serial_number }}
destroy-controller:
name: Destroy OpenWiFi cloud SDK instance
needs: [deploy-controller, test]
runs-on: ubuntu-latest
env:
AWS_DEFAULT_REGION: us-east-2
if: always()
steps:
- name: Delete EC2 instance
continue-on-error: true
run: |
aws ec2 terminate-instances --instance-ids ${{ needs.deploy-controller.outputs.instance_id }}
terminate-virtual-ap-instance:
name: Terminate virtual AP instance
needs: [deploy-virtual-ap-instance, test]
runs-on: ubuntu-latest
env:
AWS_DEFAULT_REGION: us-east-1
if: always()
steps:
- name: Terminate virtual AP EC2 instance
continue-on-error: true
run: |
aws ec2 terminate-instances --instance-ids ${{ needs.deploy-virtual-ap-instance.outputs.instance_id }}