Skip to content

Instantly share code, notes, and snippets.

View sandalsoft's full-sized avatar
🏖️
Working from the beach

Eric Nelson sandalsoft

🏖️
Working from the beach
View GitHub Profile
FROM mhart/alpine-node:8
ENV APPDIR=/app
RUN mkdir $APPDIR
RUN npm install --global tsc typescript
ENV HOME=$APPDIR
COPY package.json $APPDIR
COPY jest.config.js $APPDIR
COPY license.txt $APPDIR
COPY .gitignore $APPDIR
// from https://stackoverflow.com/questions/51393952/mock-inner-axios-create/51414152#51414152
const mockAxios: any = jest.genMockFromModule('axios');
mockAxios.get = jest.fn(() => mockAxios);
mockAxios.post = jest.fn(() => mockAxios);
export default mockAxios;
module.exports = {
parser: `@typescript-eslint/parser`,
extends: [
// "plugin:@typescript-eslint/recommended",
`prettier/@typescript-eslint`,
`plugin:prettier/recommended`,
],
parserOptions: {
ecmaVersion: 2018,
sourceType: `module`,
ARG FUNCTION_RUNTIME
FROM mikesir87/aws-cli as code
ARG FUNCTION_NAME
ARG AWS_DEFAULT_REGION
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
RUN wget -O function.zip `aws lambda get-function --function-name $FUNCTION_NAME --query 'Code.Location' --output text`
module.exports = {
presets: [`@babel/env`, `@babel/preset-typescript`],
plugins: [
`@babel/proposal-class-properties`,
`@babel/proposal-object-rest-spread`,
`transform-es2015-modules-commonjs`,
`@babel/plugin-proposal-optional-chaining`,
`@babel/plugin-proposal-nullish-coalescing-operator`,
[
`@babel/plugin-transform-runtime`,
module.exports = {
//nothing here anymore. stuff into prettier top-level property of package.json
};
service:
name: __FUNCTION_NAME__
plugins:
- serverless-plugin-typescript
- serverless-plugin-offline
provider:
name: aws
stage: ${opt:stage, 'dev'}
#!/bin/bash
CONTAINER_NAME=`pwd | xargs basename`
DATA_FOLDER='data'
CONTAINER_DATA_PATH=$CONTAINER_HOME/$CONTAINER_NAME/$DATA_FOLDER
#HostIp=10.0.10.118
docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs \
-p 4001:4001 \
-p 2380:2380 \
-p 2379:2379 \
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@sandalsoft
sandalsoft / .bashrc
Created August 13, 2019 21:12
pi .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac