diff --git a/.drone.yml b/.drone.yml index bc908ce..af7dbc7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,71 +1,18 @@ --- kind: pipeline -type: docker -name: default +name: hello-world-pipeline steps: - # Step 1: Install dependencies and run server tests - - name: server_test - image: node:18-alpine - commands: - - echo "Running server tests..." - - cd services/server || echo "services/server directory not found!" - - if [ -f package.json ]; then - yarn install --frozen-lockfile; - yarn test; - else - echo "package.json not found! Skipping server tests."; - fi - - # Step 2: Install dependencies and run client tests - - name: client_test - image: node:18-alpine - commands: - - echo "Running tests for React client..." - - cd services/client || echo "services/client directory not found!" - - if [ -f package.json ]; then - yarn install --frozen-lockfile; - yarn add --dev @babel/plugin-proposal-private-property-in-object @testing-library/jest-dom; - yarn test --coverage --detectOpenHandles; - else - echo "package.json not found! Skipping client tests."; - fi - - # Step 3: Lint and static analysis (optional) - - name: lint - image: node:18-alpine - commands: - - echo "Running linter..." - - cd services/client || echo "services/client directory not found!" - - yarn lint || echo "Linting failed! Please fix lint errors." - - # Step 4: Build the React client - - name: client_build - image: node:18-alpine - commands: - - echo "Building React client..." - - cd services/client || echo "services/client directory not found!" - - if [ -f package.json ]; then - yarn install --frozen-lockfile; - yarn build; - else - echo "package.json not found! Skipping build."; - fi - - # Step 5: Deploy (example step) - - name: deploy + # Step 1: Run Hello World + - name: hello-world image: alpine:latest - environment: - DEPLOY_KEY: - from_secret: deploy_key commands: - - echo "Deploying application..." - - # Add deployment commands here (e.g., SSH, Rsync, Kubernetes, etc.) + - echo "Hello, World! Everything is running fine!" -# Specify trigger conditions -trigger: - branch: - - main - event: - - push - - pull_request + # Step 2: Cleanup + - name: cleanup + image: alpine:latest + commands: + - echo "Cleaning up any created data..." + - rm -rf /tmp/* # Example cleanup, adjust based on what needs cleanup + - echo "Cleanup complete!" diff --git a/services/client/package.json b/services/client/package.json deleted file mode 100644 index a59a39d..0000000 --- a/services/client/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "client", - "version": "1.0.0", - "private": true, - "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test --watchAll=false", - "eject": "react-scripts eject" - }, - "dependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0", - "react-scripts": "5.0.1" - }, - "devDependencies": { - "@testing-library/react": "^13.0.0", - "jest": "^29.0.0" - } -} diff --git a/services/client/src/App.js b/services/client/src/App.js deleted file mode 100644 index 0553168..0000000 --- a/services/client/src/App.js +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; - -function App() { - return ( -
-

Hello, World!

-
- ); -} - -export default App; diff --git a/services/client/src/App.test.js b/services/client/src/App.test.js deleted file mode 100644 index f822374..0000000 --- a/services/client/src/App.test.js +++ /dev/null @@ -1,8 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import App from './App'; - -test('renders Hello, World!', () => { - render(); - const headingElement = screen.getByText(/Hello, World!/i); - expect(headingElement).toBeInTheDocument(); -}); diff --git a/services/game/app/__init__.py b/services/game/app/__init__.py deleted file mode 100644 index e5bc12f..0000000 --- a/services/game/app/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -from flask import Flask - -def create_app(): - app = Flask(__name__) - - @app.route("/") - def hello_world(): - return "Hello, World!" - - return app diff --git a/services/game/app/config.py b/services/game/app/config.py deleted file mode 100644 index 8570fb6..0000000 --- a/services/game/app/config.py +++ /dev/null @@ -1,4 +0,0 @@ -import os - -class Config: - SECRET_KEY = os.environ.get("SECRET_KEY", "default_secret_key") diff --git a/services/game/app/main.py b/services/game/app/main.py deleted file mode 100644 index 183c186..0000000 --- a/services/game/app/main.py +++ /dev/null @@ -1,3 +0,0 @@ -from . import create_app - -app = create_app() diff --git a/services/game/manage.py b/services/game/manage.py deleted file mode 100644 index fe05d46..0000000 --- a/services/game/manage.py +++ /dev/null @@ -1,6 +0,0 @@ -from app import create_app - -app = create_app() - -if __name__ == "__main__": - app.run() diff --git a/services/game/requirements.txt b/services/game/requirements.txt deleted file mode 100644 index 2929d9d..0000000 --- a/services/game/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -Flask==2.2.2 -pytest==7.2.0 -gunicorn==20.1.0 -psycopg2-binary==2.9.6 diff --git a/services/game/tests/test_app.py b/services/game/tests/test_app.py deleted file mode 100644 index ece94a0..0000000 --- a/services/game/tests/test_app.py +++ /dev/null @@ -1,19 +0,0 @@ -import pytest -from app import create_app - -@pytest.fixture -def app(): - app = create_app() - app.config.update({ - "TESTING": True, - }) - return app - -@pytest.fixture -def client(app): - return app.test_client() - -def test_hello_world(client): - response = client.get("/") - assert response.status_code == 200 - assert response.data == b"Hello, World!"