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 ( -