- asciinema: brew install asciinema
- svg-term-cli: npm install -g svg-term-cli
asciinema recWhen done type exit and save locally ctrl+d
| #!/bin/sh | |
| for branch in $(git branch -a | sed 's/^\s*//' | sed 's/^remotes\///' | grep -v 'master$\|develop$'); do | |
| if ! ( [[ -f "$branch" ]] || [[ -d "$branch" ]] ) && [[ "$(git log $branch --since "6 month ago" | wc -l)" -eq 0 ]]; then | |
| local_branch_name=$(echo "$branch" | sed 's/remotes\/origin\///') | |
| git branch -d "${local_branch_name}" | |
| echo "${local_branch_name}" | |
| git push origin --delete "${local_branch_name}" | |
| fi | |
| done |
| version: 2.1 | |
| # Use CircleCI's dynamic configuration feature | |
| setup: true | |
| # Orbs are built in helpers made by CircleCI & the community | |
| orbs: | |
| # Path iltering is the magic behind checking for file changes and leverages continuation orb to proceed with workflows | |
| path-filtering: circleci/[email protected] |
| # Stage 1 - Install dependencies & build react assets | |
| FROM node:14-alpine@sha256:0c80f9449d2690eef49aad35eeb42ed9f9bbe2742cd4e9766a7be3a1aae2a310 AS build | |
| WORKDIR /usr/src/app | |
| ENV NODE_ENV=production | |
| COPY package*.json /usr/src/app/ | |
| RUN npm i -g [email protected] | |
| # mount a secret i.e. a custom nprc for private repos to be used for the npm clean install command only |
| SHELL:=/usr/bin/env bash #default shell used | |
| MAKEFLAGS += --silent --jobs 10 #don't echo commands and parallelise | |
| # Default task executed when running with make command only no args | |
| default: help | |
| #src: https://victoria.dev/blog/how-to-create-a-self-documenting-makefile/ | |
| help: ## Show this help | |
| @egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' |
id - this has to match the id from the mount secret command src - path to file locally docker build --no-cache . -t test-backend --secret id=npmrc,src=backend/.npmrc --file backend/dockerfile
## Mount secrets commannd
Part of the docker build kit, enabled by default
A way of securely mounting secrets
The secret will not be in the final image, one to use for example performing the command npm ci.
| # install for mac via brew | |
| $ brew install --cask 1password-cli | |
| # sign in via cmd line | |
| # You will need your secret key generated see 1password website: https://support.1password.com/secret-key/ | |
| # followed by password | |
| $ op signin subdomain.1password.com [email protected] | |
| # alias into bash_profile for ease sake | |
| $ alias 1pws='eval $(op signin subdomain)' |
| Older hosted version of Bitbucket 1.0 api | |
| Using token generated via your user settings instead of username password option. | |
| ``` | |
| curl -H "Authorization: Bearer GENERATE-TOKEN-HERE" \ | |
| "$HOSTED_BITBUCKET_URL/rest/api/1.0/projects/BTT/repos?limit=1000" | \ | |
| jq -r '.values[].links.clone[] | select(.name=="http") | .href' | \ | |
| xargs -n1 git clone | |
| ``` |
| // openapi code generator using open api 3 specification | |
| // This will generate the model, api (interfaces only) | |
| // Spring-boot Server application using the SpringFox integration. | |
| // Generator Docs: https://openapi-generator.tech/docs/generators/spring/ | |
| // Gradle plugin: https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-gradle-plugin | |
| // Gradle plugin example: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle | |
| // templatesDir is to override the generated output, e.g. override method signature: Mono<ResponseEntity<Flux<ContactDTO>>> to Flux<ContactDTO> via mustache templates | |
| openApiGenerate { | |
| // don't try and reuse this variable for sourceSet as reference here is for a directory and generated code will append files to src/main/java under this directory |