Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/create a pull request #806

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/drender_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Render Deployment

on:
push:
branches:
- master
# note that your "main" branch might be called main instead of master
pull_request:
branches: [master]
types: [opened, synchronize]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run build
run: echo "Building the project..."

deploy:
runs-on: ubuntu-latest
needs: build
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v2
- name: Deploy to Render
run: echo "Deploying the project..."
- name: Trigger deployment
run: curl https://api.render.com/deploy/srv-${{ secrets.RENDER_SERVICE_ID }}?key=${{ secrets.RENDER_API_KEY }}

24 changes: 24 additions & 0 deletions .github/workflows/hello.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Hello World!

on:
push:
branches:
- master
# note that your "main" branch might be called main instead of master
pull_request:
branches: [master]
types: [opened, synchronize]

jobs:
hello_world_job:
runs-on: ubuntu-20.04
steps:
- name: Say hello
run: |
echo "Hello World!"
- name: Now it is
run: |
date
- name: Directory content
run: |
ls -l
28 changes: 28 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deployment pipeline

on:
push:
branches:
- master
# note that your "main" branch might be called main instead of master
pull_request:
branches: [master]
types: [opened, synchronize]

jobs:
simple_deployment_pipeline:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: lint
run: npm run eslint
- name: build
run: npm run build
- name: test
run: npm run test

24 changes: 18 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
const express = require("express");
const app = express();
/* eslint-disable no-console */
const express = require('express')
const app = express()

// Heroku dynamically sets a port
const PORT = process.env.PORT || 5000;
// eslint-disable-next-line no-undef
const PORT = process.env.PORT || 5000

app.use(express.static("dist"));
app.use(express.static('dist'))

app.get('/health', (req, res) => {
res.send('ok')
})

app.get('/health', (req, res) => {
throw 'error...'
// eslint-disable-next-line no-unreachable
res.send('ok')
})

app.listen(PORT, () => {
console.log("server started on port 5000");
});
console.log('server started on port 5000')
})
11 changes: 11 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable no-unused-vars */
/* eslint-disable no-undef */
const { defineConfig } = require('cypress')

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
})
50 changes: 50 additions & 0 deletions exercise1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# CI Tools for JavaScript/TypeScript:
## Linting:

ESLint: A widely used static analysis tool, especially for linting in JavaScript. It catches inconsistent formatting, styling, and possible errors​​.
Prettier: Focuses on code style and formatting rules, automatically fixing code that doesn't conform to its style guide​​.

## Testing:

1. Jest: A popular JavaScript testing framework, known for its simplicity and support for React applications.
2. Cypress: End to end testing, simple and easy to set up

## Building:

1. Webpack: A static module bundler for JavaScript applications, transforming, bundling, or packaging just about any resource or asset.
2. Babel: A JavaScript compiler that helps in converting ECMAScript 2015+ code into a backwards-compatible version for older browsers or environments.

# CI Tools for Java:
## Linting:

1. Checkstyle: Analyzes Java code and ensures it adheres to a coding standard.
2. FindBugs/SpotBugs: Examines Java bytecode for potential bugs.

## Testing:

1. JUnit: A unit testing framework for Java programming language.
2. Mockito: A popular mocking framework for unit tests in Java.
3. TestNG: An advanced framework designed to cover a broader range of test categories: unit, functional, end-to-end, integration, etc.

## Building:

1. Apache Maven: Known for its convention over configuration principle​​.

# CI Alternatives to Jenkins and GitHub Actions:
1. GoCD: Focuses on modeling and visualizing complex workflows​​.
2. TeamCity: Known for its extensibility and customization options​​.
3. Bamboo: Integrates well with JIRA software and Bitbucket, offering per-environment permissions​​.
4. Codeship: Allows full control over the design of CI and CD systems​​.
5. CircleCI: Flexible, supporting many languages and environments, with features like optimal caching and parallelism​​.
6. GitLab CI: Part of GitLab and known for its friendly user interface and comprehensive feature set​​.
7. Buddy: Designed for web developers with a clear UI/UX and supports all popular languages and frameworks​​.

# Self-hosted vs. Cloud-based CI Environment:
Deciding between a self-hosted and cloud-based CI environment depends on various factors:

1. Security and Compliance: For projects requiring high security or specific compliance standards, a self-hosted solution might be preferable.
2. Customization and Control: Self-hosted environments offer more customization and control over the build environment.
3. Resource Availability and Costs: Cloud-based solutions can be more cost-effective and less resource-intensive in terms of maintenance and scalability.
4. Team Size and Project Complexity: Smaller teams or less complex projects might benefit more from cloud-based solutions due to their ease of setup and lower overhead.

#### The cloud-based CI environment is more suitable for this application at this moment.
Loading