Skip to content

Commit

Permalink
☁️ chore(automation): Applying changes from upstream repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
Megabyte Labs committed Mar 22, 2023
1 parent 58455fa commit 838e69c
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 24 deletions.
5 changes: 5 additions & 0 deletions .config/taskfiles/common/Taskfile-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@ tasks:
- >
readme generate --headingPrefix '{}' --silent --config .variables.json
--input ".config/docs/{{.README_TEMPLATE}}"
- |
if [ -f docs/img/logo-full.png ]; then
sed -i 's/\/-\/raw\/master\/logo.png/\/-\/raw\/master\/docs\/img\/logo-full.png/' README.md
sed -i 's/width="148" height="148"/height="69"/' README.md
fi
- task: markdown:scrub
vars:
SCRUB_FILE: README.md
Expand Down
6 changes: 3 additions & 3 deletions .config/taskfiles/common/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ tasks:
sh: mktemp
cmds:
- |
curl -sSL '{{.MODEL_TASKFILE}}' > '{{.MODEL_TMP}}'
export ZXXXY="$(yq e '.' {{.MODEL_TMP}})"
curl -sSL '{{.MODEL_TASKFILE}}' > '{{.MODEL_TMP}}.yml'
export ZXXXY="$(yq e '.' {{.MODEL_TMP}}.yml)"
yq e -i '. | .vars = (env(ZXXXY) | .vars) | .env = (env(ZXXXY) | .env)' Taskfile.yml
yq eval-all -i 'select(fileIndex == 0) * select(fileIndex == 1)' '{{.MODEL_TMP}}' Taskfile.yml
yq eval-all -i 'select(fileIndex == 0) * select(fileIndex == 1)' '{{.MODEL_TMP}}.yml' Taskfile.yml
requirements:
deps:
Expand Down
4 changes: 2 additions & 2 deletions .config/taskfiles/fix/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,11 @@ tasks:
start: Running Prettier on {{if .CLI_ARGS}}`{{.CLI_ARGS}}`{{else}}project{{end}}
cmds:
- cmd: |
prettier --plugin node_modules/prettier-plugin-toml-fixed --ignore-path {{.PRETTIERIGNORE_CONFIG}} \
prettier --ignore-path {{.PRETTIERIGNORE_CONFIG}} \
--write {{if .CLI_ARGS}}{{.CLI_ARGS}}{{else}}.{{end}} || EXIT_CODE=$?
if [ -n "$EXIT_CODE" ]; then
.config/log warn 'Failed to run `prettier` - falling back to `prettier`'
prettier --plugin node_modules/prettier-plugin-toml-fixed --ignore-path {{.PRETTIERIGNORE_CONFIG}} \
prettier --ignore-path {{.PRETTIERIGNORE_CONFIG}} \
--write {{if .CLI_ARGS}}{{.CLI_ARGS}}{{else}}.{{end}}
fi
ignore_error: true
Expand Down
3 changes: 3 additions & 0 deletions .config/taskfiles/git/Taskfile-hook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ tasks:
# remote_ref -> refs/heads/master
# remote_sha -> 9901a2eb2f34d5744276a80c4b339a88a92a7b53
REMOTE_BRANCH="$(echo $remote_ref | sed 's/^[^\/]*\/[^\/]*\///')"
if [ "$(echo "$HOST" | cut -c1-8)" == 'https://' ]; then
HOST="$(echo "$HOST" | cut -c8)"
fi
.config/log star "Repository -----> https://$HOST/$ORG/$PROJECT"
if [ "$HOST" == 'gitlab.com' ]; then
if [ "$REMOTE_BRANCH" != 'master' ]; then
Expand Down
6 changes: 3 additions & 3 deletions .config/taskfiles/git/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ tasks:
- git init
- git remote add origin "{{.GITLAB_REPO}}"
- git add --all
- git commit --quiet -m "🧐 refactor(submodule): Adding folder/project to its own git repository."
- git commit --quiet -m "🧐 refactor(submodule) Adding folder/project to its own git repository."
- git push --quiet -u --no-progress origin master
- cd .. && rm -rf {{.BASENAME}}
- cd .. && git add {{.BASENAME}}
- cd .. && git commit --quiet -m "🧐 refactor(submodule): Removing folder which will now be a submodule."
- git commit --quiet -m "🧐 refactor(submodule) Removing folder which will now be a submodule."
- cd .. && git submodule add -b master "{{.GITLAB_REPO}}" {{.BASENAME}}
- cd .. && git add {{.BASENAME}}
- cd .. && git commit --quiet -m "🧐 refactor(submodule): Adding new submodule which was previously a directory."
- cd .. && git commit --quiet -m "🧐 refactor(submodule) Adding new submodule which was previously a directory."
- cd .. && git push --quiet -u --no-progress origin HEAD
preconditions:
- sh: '[[ ! $(git rev-parse --git-dir) =~ ".git/modules" ]]'
Expand Down
18 changes: 4 additions & 14 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ includes:
lint:prose:
taskfile: ./.config/taskfiles/lint/Taskfile-prose.yml
optional: true
localhost:
taskfile: ./../../Taskfile-localhost.yml
local:
taskfile: ./../../../Taskfile-local.yml
optional: true
log:
optional: true
Expand Down Expand Up @@ -558,7 +558,7 @@ tasks:
- |
task --list > /dev/null || (echo "ERROR: Invalid Taskfiles!" && exit 1)
git add --all
- "HUSKY=0 git commit -m '\U0001F527 chore(tweak)": quick minor update' --no-verify
- ".config/log info 'Bypassing git hooks for git commit'\nHUSKY=0 git commit -m \"\U0001F527 chore(tweak): quick minor update\" --no-verify\n"
- git push origin master
devcontainer:
deps:
Expand Down Expand Up @@ -840,7 +840,7 @@ tasks:
start: Publishing `semantic-release` update via `task publish:force`
success: Successfully published update via `task publish:force`
cmds:
- "HUSKY=0 git commit -a --allow-empty -m '\U0001F528 chore(bump): Forced semantic-release {{.UPDATE_LEVEL}}' -n\n"
- ".config/log info 'Bypassing git hooks for git commit'\nHUSKY=0 git commit -a --allow-empty -m '\U0001F528 chore(bump): Forced semantic-release {{.UPDATE_LEVEL}}' --no-verify\n"
- task: publish
pull:upstream:
desc: Pull from upstream repositories
Expand Down Expand Up @@ -1067,16 +1067,6 @@ tasks:
This task calls `npm run test` which functions differently based on the
definition made in `package.json` under the `.scripts.test` key.
## Ansible Project Functionality
For Ansible projects, this task wraps all the supported test methods for Ansible plays into a
convenient multi-question prompt system that supports:
1. Docker tests
2. Headless VirtualBox tests
3. VirtualBox Desktop tests which are not automatically destroyed
4. Running the play locally
5. Running the play over SSH on a remote target
vars:
NONINTERACTIVE_MISSING_TEST_CMD: There must be a `.scripts.test` definition in `package.json`!
cmds:
Expand Down
4 changes: 2 additions & 2 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
# ensure that the latest upstream changes are retrieved, that the project is
# properly generated with them, and that all the development dependencies are installed.
# Documentation on Taskfile.yml syntax can be found [here](https://taskfile.dev/).
git config url."https://gitlab.com/".insteadOf [email protected]:
git config url."https://github.com/".insteadOf [email protected]:

set -eo pipefail

# @description Initialize variables
Expand Down Expand Up @@ -487,6 +486,7 @@ function ensureTaskfiles() {
# shellcheck disable=SC2016
logger warn 'Something is wrong with the `Taskfile.yml` - grabbing main `Taskfile.yml`'
git checkout HEAD~1 -- Taskfile.yml
task --list || curl -sSL https://gitlab.com/megabyte-labs/common/shared/-/raw/master/Taskfile.yml
if ! task donothing; then
logger error 'Error appears to be with main Taskfile.yml'
else
Expand Down

0 comments on commit 838e69c

Please sign in to comment.