- The default CentOS7 docker image enables root connectivity by default.
- The default CentOS7 AWS AMI is typically accessed via ssh using the centos user and a .pem file. (Requiring sudo to perform privileged operations on the CLI).
- The Ansible playbook needs privileged access (root) to perform provisioning.
- Ansible provides a
--becomeoption in order to perform privileged tasks. - Providing
--becomewhen running the playbook on the CLI for the AMI enironment was the simplest solution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| stage('Seed') { | |
| env.PATH = "/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:${env.PATH}" | |
| dir('bqp') { | |
| nodeBlock { | |
| echo 'Running Seed...' | |
| sh 'set -o pipefail && npm run seed' | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Template for NodeJs Blocks | |
| def call(Closure body) { | |
| // find the version of nodejs from .nvmrc or default to lts/* | |
| if (!env.NODE_VERSION) { | |
| PWD = sh ( | |
| script: "pwd", | |
| returnStdout: true | |
| ).trim() | |
| echo "${PWD}" + '/.nvmrc' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ npm run upgrade:check-lts | |
| > myapp@0.0.1 upgrade:check-lts .../repos/git/myapp | |
| > npm install -g --dry-run node@lts | node bin/nodeLtsCheck.js | |
| Checking for Node LTS: 12.16.2 ... | |
| LTS Version 12.16.2 does not match .nvmrc: 12.16.1 | |
| npm ERR! code ELIFECYCLE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "upgrade:check-lts": "npm i -g --dry-run node@lts | node bin/nodeLtsCheck.js", | |
| "ci:branch": "run-s ... upgrade:check-lts", | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require('fs'); | |
| function getNvmVersion() { | |
| return fs.readFileSync('.nvmrc').toString().trim(); | |
| } | |
| /** | |
| * Run with: | |
| * $ npm install -g --dry-run node@lts | node bin/nodeLtsCheck | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ npm run upgrade:check-dep | |
| ... | |
| > npm outdated | node bin/outdatedCheck.js | |
| Package Current Wanted Latest Location | |
| @sendgrid/mail 6.5.5 6.5.5 7.0.0 myapp | |
| @types/express 4.17.3 4.17.3 4.17.6 myapp | |
| @types/jest 25.1.4 25.1.4 25.2.1 myapp | |
| @types/node 13.9.1 13.9.1 13.11.1 myapp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Usage: | |
| * $npm outdated | node bin/outdatedCheck.js | |
| */ | |
| function outdatedCheck() { | |
| const readline = require('readline'); | |
| const ioProcessor = readline.createInterface({ | |
| input: process.stdin, | |
| output: process.stdout, |
The Problem:
- $http.config clearly shows how to add a property which propogates to response.config (https://docs.angularjs.org/api/ng/service/$http#usage)
- property can be checked in global error handling to decide on whether to handle
- $resource does not obviously show how to add properties to response.config
- the object value of the "action" is the config (https://docs.angularjs.org/api/ngResource/service/$resource)
A Solution:
- add a function to the config which decides if the response can be ignored globally
Example:
Brew:
Git:
$ brew install git
$ mkdir ~/repos; mkdir ~/repos/git