commit a277da1311c8428456db7c76d9be73fb35866f9f Author: Josuani Moranchel <130728934+Josuani@users.noreply.github.com> Date: Thu Dec 21 01:19:09 2023 -0600 add pipeline diff --git a/.github/scripts/CloudGuru.py b/.github/scripts/CloudGuru.py new file mode 100644 index 0000000..eb6a259 --- /dev/null +++ b/.github/scripts/CloudGuru.py @@ -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() diff --git a/.github/workflows/CloudGuru.yml b/.github/workflows/CloudGuru.yml new file mode 100644 index 0000000..b0cb580 --- /dev/null +++ b/.github/workflows/CloudGuru.yml @@ -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 }}