Skip to content

Commit

Permalink
Merge pull request #174 from OpenPathfinder/feat/distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
UlisesGascon authored Dec 31, 2024
2 parents 30485f0 + 8f257bb commit e86980d
Show file tree
Hide file tree
Showing 10 changed files with 247 additions and 21 deletions.
136 changes: 136 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*


# CUSTOM
IGNORE/
output
.vscode
Binary file removed .github/OTHER/header.png
Binary file not shown.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,7 @@ jobs:
run: npm run db:seed

- name: Run tests
run: npm run test:ci
run: npm run test:ci

- name: Build Docker image
run: docker build -t visionboard .
55 changes: 55 additions & 0 deletions .github/workflows/docker-publish-on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish Docker Image on Release

on:
release:
types:
- published

permissions:
contents: read
packages: write

jobs:
build-and-push:
name: Build and Push Multi-Platform Docker Image
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true

- name: Set Lowercase Repository Info
id: repo_info
run: |
echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "REPO_NAME=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Build and Push Multi-Platform Docker Image
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}:latest
ghcr.io/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}:${{ github.event.release.tag_name }}
labels: |
org.opencontainers.image.title=visionboard
org.opencontainers.image.description=Transforming Data into Actionable Insights"
org.opencontainers.image.url=https://github.com/OpenPathfinder/visionBoard
org.opencontainers.image.source=https://github.com/OpenPathfinder/visionBoard.git
org.opencontainers.image.version=${{ github.event.release.tag_name }}
org.opencontainers.image.licenses=MIT
maintainer="Ulises Gascón <ulises@linux.com>"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,5 @@ dist

# CUSTOM
IGNORE/
output
output
.vscode
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:22-alpine

WORKDIR /usr/src/app

COPY package.json package-lock.json ./

RUN npm install --only=production --no-cache

COPY . .

RUN chmod -R 755 /usr/src/app

USER node

ENV NODE_ENV=production

ENTRYPOINT ["node", "./visionboard.js"]
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![VisionBoard logo with a gold compass emblem and the tagline 'Transforming Data into Actionable Insights' on a black background](.github/OTHER/header.png)
![VisionBoard logo with a gold compass emblem and the tagline 'Transforming Data into Actionable Insights' on a black background](https://raw.githubusercontent.com/OpenPathfinder/branding/refs/heads/main/visionBoard/variation_header.png)

# VisionBoard

Expand Down Expand Up @@ -100,7 +100,7 @@ GITHUB_TOKEN=your_github_token_here
Then load it using:

```bash
node --env-file=.env index.js workflow run --name populate-repos-list
node --env-file=.env visionboard.js workflow run --name populate-repos-list
```

## Usage
Expand All @@ -110,67 +110,67 @@ node --env-file=.env index.js workflow run --name populate-repos-list
Add a new project:

```bash
node index.js project add [--name <name>] [--github-urls <urls...>]
node visionboard.js project add [--name <name>] [--github-urls <urls...>]
```

Example:

```bash
node index.js project add --name express --github-urls https://github.com/expressjs https://github.com/pillarjs https://github.com/jshttp
node visionboard.js project add --name express --github-urls https://github.com/expressjs https://github.com/pillarjs https://github.com/jshttp
```

### Workflows

Run a workflow:

```bash
node index.js workflow run [--name <name>]
node visionboard.js workflow run [--name <name>]
```

List workflows:

```bash
node index.js workflow list
node visionboard.js workflow list
```

### Checks

List all checks:

```bash
node index.js check list
node visionboard.js check list
```
Run a specific check:

```bash
node index.js check run [--name <name>]
node visionboard.js check run [--name <name>]
```

There is an specific workflow that runs all the checks sequentially:

```bash
node index.js workflow run run-all-checks
node visionboard.js workflow run run-all-checks
```

### Checklist

The checklist are collections of checks. You can list the available list by running:

```bash
node index.js checklist list
node visionboard.js checklist list
```

Run a specific checklist:

```bash
node index.js checklist run [--name <name>]
node visionboard.js checklist run [--name <name>]
```


It is possible also to define a project scope:

```bash
node index.js checklist run [--name <name>] [--project-scope <name1,name2,...>]
node visionboard.js checklist run [--name <name>] [--project-scope <name1,name2,...>]
```

## Report Management
Expand All @@ -186,7 +186,7 @@ _Not yet implemented_
The simplest option is to run the workflow `show-reports`, which will start an HTTP server that lists the content in the `output` folder. Any asset previously generated can be accessed via a web browser using this approach. You can start the server by running:

```bash
node index.js workflow run --name show-reports
node visionboard.js workflow run --name show-reports
```

You can customize the IP and port using the environment variables `PORT` and `IP`. By default, it uses `localhost:3000`.
Expand Down Expand Up @@ -235,7 +235,7 @@ npm run db:generate-schema
Enable debug logs using the `DEBUG` environment variable:

```bash
DEBUG=* node index.js
DEBUG=* node visionboard.js
```

### Linting
Expand Down
7 changes: 5 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"name": "visionBoard",
"version": "1.0.0",
"version": "0.1.0-beta2",
"description": "Transforming Data into Actionable insights",
"main": "index.js",
"bin": {
"visionBoard": "visionboard.js"
},
"scripts": {
"lint": "standard",
"lint:fix": "standard --fix",
Expand All @@ -18,7 +20,14 @@
"db:export-checklists": "node scripts/export-checklists.js",
"db:seed": "knex seed:run"
},
"keywords": [],
"keywords": [
"security",
"CLI"
],
"repository": {
"type": "git",
"url": "https://github.com/OpenPathfinder/visionBoard"
},
"author": "Ulises Gascón",
"license": "MIT",
"standard": {
Expand Down
Loading

0 comments on commit e86980d

Please sign in to comment.