Skip to content

Instantly share code, notes, and snippets.

@joestump
Last active February 21, 2024 11:40
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save joestump/37830c5e4114e4aad726 to your computer and use it in GitHub Desktop.
Using modern JavaScript and CI tooling for Google Apps Scripts
#!/bin/bash
npm run build
gas deploy -s ./conf/$CLIENT_SECRETS -c ./conf/$OAUTH_CREDENTIALS -b ./build -f $GAS_FILE_ID
{
"name": "sprintly-spreadsheet",
"version": "0.0.1",
"description": "A Google Apps Add-on for Google Docs Spreadsheets that loads items from the API into a sheet.",
"main": "src/index.js",
"scripts": {
"test": "./node_modules/mocha/bin/mocha $(find src/* -path *test* -name \\*.js -type f)",
"build": "rm -fr ./build && mkdir ./build && ./node_modules/browserify/bin/cmd.js ./src/index.js -o ./build/Code.gs && cp ./html/*.html ./build",
"lint": "./node_modules/eslint/bin/eslint.js src/"
},
"repository": {
"type": "git",
"url": "https://github.com/sprintly/sprintly-spreadsheet.git"
},
"author": "Joe Stump <joe@stu.mp>",
"license": "NA",
"bugs": {
"url": "https://github.com/sprintly/sprintly-spreadsheet/issues"
},
"homepage": "https://github.com/sprintly/sprintly-spreadsheet",
"dependencies": {
"gas-manager": "^0.4.3",
"jquery": "^2.1.3",
"lodash": "^3.4.0"
},
"devDependencies": {
"browserify": "^9.0.3",
"chai": "^2.1.1",
"eslint": "^0.16.2",
"mocha": "^2.2.1"
}
}
#!/bin/bash
npm run lint && npm run test
language: node_js
node_js:
- "0.11"
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y python-virtualenv python-pip
- virtualenv .
- . ./bin/activate
- pip install -r ./requirements.txt
script:
- "/bin/bash ./ci/test.sh"
- "/bin/bash ./ci/deploy.sh"
env:
global:
- CLIENT_SECRETS="client_secret_XXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com.json"
- OAUTH_CREDENTIALS="credentials_production.json"
- GAS_FILE_ID="YYYYYYYYY_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment