git clone https://github.com/d3vadv3ntur3s/some-cool-repo.git
Cloning into 'some-cool-repo'...
remote: Enumerating objects: 145563, done.
# 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 |
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] |
#!/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 |