Skip to content

Commit

Permalink
⤵️ automation(synchronize) Applying changes from upstream repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
Megabyte Labs committed Feb 18, 2022
1 parent 8765b56 commit 724f92e
Show file tree
Hide file tree
Showing 16 changed files with 1,368 additions and 12 deletions.
1 change: 1 addition & 0 deletions .config/package-lock.json

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions .config/taskfiles/ci/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tasks:
cmds:
- task: commit:config
- task: checkout
- task: lockfiles
- task: before:npm

before:npm:
Expand Down Expand Up @@ -44,6 +45,7 @@ tasks:
start: Bypassing git hooks and pushing changes to master (if there are any changes)
cmds:
- task: commit:config
- task: lockfiles:clean
- git add --all
- git diff --cached "*"
- |
Expand All @@ -69,6 +71,28 @@ tasks:
msg: 'The `GITLAB_CI_NAME` GitLab CI variable must be set to the name you would like associated with automated commits
(e.g. "CI Automation").'

lockfiles:
cmds:
- |
if [ -f .config/package-lock.json ]; then
cp .config/package-lock.json package-lock.json
fi
- |
if [ -f .config/yarn.lock ]; then
cp .config/yarn.lock yarn.lock
fi
lockfiles:clean:
cmds:
- |
if [ -f .config/package-lock.json ]; then
rm -f package-lock.json
fi
- |
if [ -f .config/yarn.lock ];then
rm -f yarn.lock
fi
submodules:
deps:
- :install:software:git
Expand Down
2 changes: 1 addition & 1 deletion .config/taskfiles/common/Taskfile-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ tasks:
fi
cat .config/dockerignore >> "$TMP"
echo '# Saved entries below' >> "$TMP"
cat .dockerignore >> "$TMP"
cat .dockerignore | sed -n '/# Saved entries below/,$p' | sed 's/# Saved entries below//' | awk 'NF' >> "$TMP"
mv "$TMP" .dockerignore
elif [ '{{.PROJECT_TYPE}}' == 'project' ]; then
rm .config/dockerignore
Expand Down
14 changes: 14 additions & 0 deletions .config/taskfiles/install/Taskfile-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,13 @@ tasks:
status:
- type pnpm &> /dev/null

pnpm-lock-export:
run: once
cmds:
- task: global
vars:
NPM_PACKAGE: pnpm-lock-export

pnpm:import:
run: once
log:
Expand Down Expand Up @@ -357,6 +364,13 @@ tasks:
vars:
NPM_PACKAGE: standard-version

synp:
run: once
cmds:
- task: global
vars:
NPM_PACKAGE: synp

tinypng:
run: once
cmds:
Expand Down
9 changes: 9 additions & 0 deletions .config/taskfiles/install/Taskfile-software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,15 @@ tasks:
vars:
SOFTWARE: vmware

yarn:
run: once
cmds:
- task: brew:formulae
vars:
FORMULAE: yarn
status:
- type yarn > /dev/null

yq:
run: once
cmds:
Expand Down
20 changes: 20 additions & 0 deletions .config/taskfiles/install/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,26 @@ tasks:
sources:
- package.json

modules:local:lockfiles:
deps:
- :install:npm:pnpm-lock-export
- :install:npm:synp
cmds:
- |
if [ ! -f package-lock.json ]; then
pnpm-lock-export
MOVE_PACKAGE_LOCK=true
fi
if [ ! -f yarn.lock ] && [ -f package-lock.json ]; then
synp --source-file package-lock.json
mv yarn.lock .config/yarn.lock
fi
if [ -n "$MOVE_PACKAGE_LOCK" ]; then
mv package-lock.json .config/package-lock.json
fi
sources:
- pnpm-lock.yaml

modules:local:sync:
log:
error: Error while synchronizing `NPM_KEEP_UPDATED` packages with the latest version(s)
Expand Down
9 changes: 6 additions & 3 deletions .config/taskfiles/lint/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ tasks:
deps:
- :install:software:docker
desc: Lint Dockerfiles using Hadolint (requires Docker)
hide:
sh: '[ ! -f Dockerfile ]'
summary: |
# Lint Dockerfiles using Hadolint
Expand Down Expand Up @@ -151,6 +149,11 @@ tasks:
`task lint:docker -- CustomDockerfile`
For more information, see [Hadolint's GitHub page](https://github.com/hadolint/hadolint).
vars:
PWD:
sh: echo "${PWD}/"
hide:
sh: '[ ! -f Dockerfile ]'
log:
error: Hadolint reported errors
start: Linting {{if .CLI_ARGS}}`{{.CLI_ARGS}}`{{else}}the project{{end}} with Hadolint
Expand All @@ -159,7 +162,7 @@ tasks:
- |
.config/log info 'Linting {{if .CLI_ARGS}}{{.CLI_ARGS}}{{else}}all Dockerfiles{{end}} with a Hadolint Docker image'
{{if .CLI_ARGS}}
docker run -v "$PWD:/work" -w /work megabytelabs/hadolint:slim {{.CLI_ARGS}}
docker run -v "$PWD:/work" -w /work megabytelabs/hadolint:slim {{.CLI_ARGS | replace .PWD ""}}
{{else}}
find . -type d \( {{.IGNORE_FOLDERS}} \) -prune -o -type f \( -name Dockerfile -o \
-name Dockerfile.j2 \) -print0 | xargs -0 -r -n1 docker run -v "$PWD:/work" -w /work \
Expand Down
3 changes: 2 additions & 1 deletion .config/taskfiles/publish/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ tasks:
deps:
- task: :install:modules:local
vars:
SEMANTIC_RELEASE: 'true'
SEMANTIC_RELEASE:
sh: echo true
- :install:npm:semantic-release
- :install:software:git
- :install:software:poetry
Expand Down
11 changes: 10 additions & 1 deletion .config/taskfiles/upstream/Taskfile-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,17 @@ tasks:
start: Removing `.config/`
success: Removed `.config/`
cmds:
- rm -rf .config
- mv .config .config-old
- task: copy:begin
- |
if [ -f .config-old/package-lock.json ]; then
cp .config-old/package-lock.json .config/package-lock.json
fi
- |
if [ -f .config-old/yarn.lock ]; then
cp .config-old/yarn.lock .config/yarn.lock
fi
- rm -rf .config-old

copy:begin:
deps:
Expand Down
11 changes: 10 additions & 1 deletion .config/taskfiles/upstream/Taskfile-commondocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,19 @@ tasks:
start: Copying common files
success: Copied common files
cmds:
- rm -rf .config
- mv .config .config-old
- |
PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH"
cp -rT ./{{.COMMON_FOLDER}}/common/ .
- |
if [ -f .config-old/package-lock.json ]; then
cp .config-old/package-lock.json .config/package-lock.json
fi
- |
if [ -f .config-old/yarn.lock ]; then
cp .config-old/yarn.lock .config/yarn.lock
fi
- rm -rf .config-old
- task: :common:husky:permissions
- mv {{.COMMON_FOLDER}}/.gitlab-ci.yml .gitlab-ci.yml

Expand Down
11 changes: 10 additions & 1 deletion .config/taskfiles/upstream/Taskfile-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,17 @@ tasks:
start: Beginning copy sequence
success: Completed copy sequence
cmds:
- rm -rf .config
- mv .config .config-old
- task: copy:before
- |
if [ -f .config-old/package-lock.json ]; then
cp .config-old/package-lock.json .config/package-lock.json
fi
- |
if [ -f .config-old/yarn.lock ]; then
cp .config-old/yarn.lock .config/yarn.lock
fi
- rm -rf .config-old
- cp {{.SHARED_FOLDER}}/.gitlab-ci.yml .gitlab-ci.yml

copy:before:
Expand Down
11 changes: 10 additions & 1 deletion .config/taskfiles/upstream/Taskfile-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,20 @@ tasks:
start: Copying pre-generated files
success: Copied pre-generated files
cmds:
- rm -rf .config
- mv .config .config-old
- |
PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH"
cp -rT {{.SHARED_FOLDER}}/_generated_/common .
cp -rT {{.SHARED_FOLDER}}/_generated_/{{.REPOSITORY_SUBTYPE}} .
- |
if [ -f .config-old/package-lock.json ]; then
cp .config-old/package-lock.json .config/package-lock.json
fi
- |
if [ -f .config-old/yarn.lock ]; then
cp .config-old/yarn.lock .config/yarn.lock
fi
- rm -rf .config-old
- task: :common:husky:permissions
- task: save:common:keywords

Expand Down
6 changes: 6 additions & 0 deletions .config/taskfiles/upstream/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ tasks:
- task: :upstream:common:template
- task: :upstream:common:combine
- task: :vscode:generate
- task: :install:modules:local:lockfiles
- task: :fix:eslint

commondocs:
Expand All @@ -29,6 +30,7 @@ tasks:
- task: :upstream:commondocs:clean
- task: :upstream:commondocs:template
- task: :vscode:generate
- task: :install:modules:local:lockfiles
- task: :fix:eslint

docs:
Expand All @@ -43,6 +45,7 @@ tasks:
- task: :upstream:docs:clean
- task: :upstream:docs:template
- task: :vscode:generate
- task: :install:modules:local:lockfiles
- task: :fix:eslint

project:
Expand All @@ -60,6 +63,7 @@ tasks:
- task: :vscode:generate
- task: :upstream:project:merge:package:overrides
- task: :common:update:update
- task: :install:modules:local:lockfiles
- task: :fix:eslint
- task: :git:commit:automated
- task: :git:push:all
Expand All @@ -80,6 +84,7 @@ tasks:
- task: :vscode:generate
- task: :upstream:project:merge:package:overrides
- SKIP_UPLOADING=true task common:update:update
- task: :install:modules:local:lockfiles
- task: :fix:eslint

pull:
Expand Down Expand Up @@ -115,6 +120,7 @@ tasks:
- task: :upstream:shared:variables
- task: :upstream:shared:template
- task: :vscode:generate
- task: :install:modules:local:lockfiles
- task: :fix:eslint

template:
Expand Down
Loading

0 comments on commit 724f92e

Please sign in to comment.