| name | evernote-deploy-integration |
| description | Deploy Evernote integrations to production environments.
Use when deploying to cloud platforms, configuring production,
or setting up deployment pipelines.
Trigger with phrases like "deploy evernote", "evernote production deploy",
"release evernote", "evernote cloud deployment".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Grep |
| version | 1.0.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
Evernote Deploy Integration
Overview
Deploy Evernote integrations to production environments including cloud platforms, containerized deployments, and serverless architectures.
Prerequisites
- CI/CD pipeline configured
- Production API credentials approved
- Cloud platform account (AWS, GCP, Azure)
- Docker installed (for containerized deployments)
Instructions
Step 1: Docker Deployment
# Dockerfile
FROM node:20-alpine AS builder
WORKDIR /app
# Install dependencies
COPY package*.json ./
RUN npm ci --only=production
# Copy source
COPY . .
# Build if needed
RUN npm run build --if-present
# Production image
FROM node:20-alpine AS production
WORKDIR /app
# Security: non-root user
RUN addgroup -g 1001 -S appgroup && \
adduser -u 1001 -S appuser -G appgroup
# Copy from builder
COPY --from=builder --chown=appuser:appgroup /app/node_modules ./node_modules
COPY --from=builder --chown=appuser:appgroup /app/dist ./dist
COPY --from=builder --chown=appuser:appgroup /app/package.json ./
USER appuser
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
EXPOSE 3000
CMD ["node", "dist/index.js"]
version: '3.8'
services:
app:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- EVERNOTE_CONSUMER_KEY=${EVERNOTE_CONSUMER_KEY}
- EVERNOTE_CONSUMER_SECRET=${EVERNOTE_CONSUMER_SECRET}
- EVERNOTE_SANDBOX=false
- SESSION_SECRET=${SESSION_SECRET}
- REDIS_URL=redis://redis:6379
depends_on:
- redis
restart: unless-stopped
redis:
image: redis:7-alpine
volumes:
- redis-data:/data
restart: unless-stopped
volumes:
redis-data:
Step 2: AWS Deployment (ECS/Fargate)
AWSTemplateFormatVersion: '2010-09-09'
Description: Evernote Integration Service
Parameters:
Environment:
Type: String
AllowedValues: [staging, production]
EvernoteConsumerKey:
Type: String
NoEcho: true
EvernoteConsumerSecret:
Type: String
NoEcho: true
Resources:
Cluster:
Type: AWS::ECS::Cluster
Properties:
ClusterName: !Sub evernote-${Environment}
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
Family: !Sub evernote-app-${Environment}
Cpu: '256'
Memory: '512'
NetworkMode: awsvpc
RequiresCompatibilities:
- FARGATE
ExecutionRoleArn: !GetAtt ExecutionRole.Arn
Step 3: GitHub Actions Deployment
name: Deploy to Production
on:
push:
branches: [main]
tags: ['v*']
env:
AWS_REGION: us-east-1
ECR_REPOSITORY: evernote-app
ECS_SERVICE: evernote-app-production
ECS_CLUSTER: evernote-production
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Login to
Step 4: Google Cloud Run Deployment
steps:
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
- '-t'
- 'gcr.io/$PROJECT_ID/evernote-app:$COMMIT_SHA'
- '-t'
- 'gcr.io/$PROJECT_ID/evernote-app:latest'
- '.'
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/evernote-app:$COMMIT_SHA']
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'evernote-app'
- '--image'
- 'gcr.io/$PROJECT_ID/evernote-app:$COMMIT_SHA'
- '--region'
- 'us-central1'
- '--platform'
- 'managed'
-
Step 5: Serverless Deployment (AWS Lambda)
service: evernote-integration
provider:
name: aws
runtime: nodejs20.x
stage: ${opt:stage, 'dev'}
region: us-east-1
environment:
NODE_ENV: production
EVERNOTE_SANDBOX: false
iam:
role:
statements:
- Effect: Allow
Action:
- secretsmanager:GetSecretValue
Resource:
- !Sub arn:aws:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:evernote
Step 6: Kubernetes Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: evernote-app
labels:
app: evernote-app
spec:
replicas: 3
selector:
matchLabels:
app: evernote-app
template:
metadata:
labels:
app: evernote-app
spec:
containers:
- name: app
image: your-registry/evernote-app:latest
ports:
- containerPort: 3000
env:
- name: NODE_ENV
value: production
- name: EVERNOTE_SANDBOX
value: 'false'
- name: EVERNOTE_CONSUMER_KEY
valueFrom:
secretKeyRef:
name: evernote-secrets
key:
Step 7: Deployment Verification
const https = require('https');
const checks = [
{
name: 'Health Check',
url: `${process.env.APP_URL}/health`,
expectedStatus: 200
},
{
name: 'OAuth Endpoint',
url: `${process.env.APP_URL}/auth/evernote`,
expectedStatus: 302
}
];
async function verifyDeployment() {
console.log('Verifying deployment...\n');
for (const check of checks) {
try {
const response = await fetch(check.url, { redirect: 'manual' });
if (response.status === check.expectedStatus) {
console.log(`[PASS] ${check.name}`);
} else {
console.log(`[FAIL] ${check.name} - Expected ${check.expectedStatus}, got ${response.status}`);
process.();
}
} (error) {
.();
process.();
}
}
.();
}
();
Output
- Docker containerization setup
- AWS ECS/Fargate deployment
- GitHub Actions CI/CD pipeline
- Google Cloud Run deployment
- Serverless (Lambda) deployment
- Kubernetes deployment
- Deployment verification scripts
Deployment Checklist
## Pre-Deployment
- [ ] All tests passing
- [ ] Production API key configured
- [ ] Secrets stored securely
- [ ] Health check endpoint working
- [ ] Logging configured
## Deployment
- [ ] Container built and pushed
- [ ] Infrastructure provisioned
- [ ] Secrets mounted
- [ ] Service deployed
- [ ] Load balancer configured
## Post-Deployment
- [ ] Verify health check
- [ ] Test OAuth flow
- [ ] Monitor error rates
- [ ] Check metrics
- [ ] Update documentation
Resources
Next Steps
For webhook handling, see evernote-webhooks-events.