add pipeline
This commit is contained in:
21
.github/scripts/CloudGuru.py
vendored
Normal file
21
.github/scripts/CloudGuru.py
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import requests
|
||||
import os
|
||||
|
||||
def setup_lab():
|
||||
try:
|
||||
cloudguru_api_key = os.environ.get('CLOUDGURU_API_KEY')
|
||||
other_secret = os.environ.get('OTHER_SECRET')
|
||||
|
||||
# aqui deben de ir las llamadas a la API
|
||||
|
||||
if response.status_code == 200:
|
||||
print('Laboratorio configurado exitosamente')
|
||||
else:
|
||||
print(f'Error al configurar el laboratorio. Código de estado: {response.status_code}')
|
||||
print(response.text)
|
||||
|
||||
except Exception as e:
|
||||
print(f'Error inesperado: {str(e)}')
|
||||
|
||||
if __name__ == "__main__":
|
||||
setup_lab()
|
||||
30
.github/workflows/CloudGuru.yml
vendored
Normal file
30
.github/workflows/CloudGuru.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: pipeline
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
setup-lab:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install requests==2.26.0
|
||||
|
||||
- name: Run Lab Setup
|
||||
run: python .github/scripts/lab-setup.py
|
||||
env:
|
||||
CLOUDGURU_API_KEY: ${{ secrets.CLOUDGURU_API_KEY }}
|
||||
OTHER_SECRET: ${{ secrets.OTHER_SECRET }}
|
||||
Reference in New Issue
Block a user