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

Sentry implementation #9

Open
wants to merge 14 commits into
base: main
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
11 changes: 0 additions & 11 deletions .eslintrc.js

This file was deleted.

48 changes: 18 additions & 30 deletions .github/workflows/ecr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,40 @@ jobs:
runs-on: ubuntu-latest

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

- name: Read .nvmrc
run: echo "{NODE_VERSION}={cat .nvmrc}" >> $GITHUB_OUTPUT
id: nvm

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
with:
image: tonistiigi/binfmt:latest
platforms: arm64,arm

- name: Use Node.js ${{ steps.nvm.outputs.NODE_VERSION }}
uses: actions/setup-node@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5

- uses: actions/setup-node@v4
with:
node-version: ${{ steps.nvm.outputs.NODE_VERSION }}
node-version-file: '.nvmrc'

- name: Install npm
run: npm install
- run: npm ci

- name: Set AWS credentials
if: ${{ !env.ACT }}
uses: aws-actions/configure-aws-credentials@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Login to Amazon ECR
if: ${{ !env.ACT }}
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076

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

# Building the thumbnail app
- name: Build the app with NPM
- name: Upload sourcemap to Sentry
run: |
npm install
npm ci
npm install tsc -g
npm run build
npm run sentry:sourcemaps
shell: bash

# Get branch names for ECR tagging
Expand All @@ -69,7 +60,6 @@ jobs:

# Push to ECR
- name: Build, tag, and push image to Amazon ECR
if: ${{ !env.ACT }}
id: build-image
env:
IMAGE_TAG: ${{ github.sha }}
Expand All @@ -81,6 +71,4 @@ jobs:
-t $ECR_REGISTRY/$ECR_REPOSITORY:$BRANCH_NAME \
-t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \
--platform linux/amd64,linux/arm64 . \
--push


--push
12 changes: 4 additions & 8 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@ jobs:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version-file: '.nvmrc'
- run: npm ci
- run: npm install tsc -g
- run: npm run build --if-present
- run: npm run test

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,6 @@ dist/
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml

# Sentry Config File
.sentryclirc
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/erbium
lts/Jod
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM node:erbium-alpine
FROM node:jod-alpine
WORKDIR /opt/thumbnail-api
COPY . /opt/thumbnail-api
EXPOSE 3000
RUN npm install
RUN npm run clean
RUN npm ci
RUN npm install tsc -g
RUN npm run build
CMD ["npm", "run", "start"]
17 changes: 17 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// eslint.config.mjs
import globals from "globals";
import pluginJs from "@eslint/js";
import tsEsLint from "typescript-eslint";
import eslintConfigPrettier from "eslint-config-prettier";

export default [
{ files: ["**/*.{js,mjs,cjs,ts}"] },
{ files: ["**/*.js"], languageOptions: { sourceType: "commonjs" } },
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tsEsLint.configs.recommended,
{
ignores: [".node_modules/*", "dist/*"],
},
eslintConfigPrettier,
];
Loading
Loading