@webship.co/workspace-drupal-themes 0.0.0-stage → 1.0.0-alpha1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,42 @@
1
- # Temporary Holding Version
1
+ # @webship.co/workspace-drupal-themes
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The **Drupal themes** workspace of the [Webship Workspace](https://github.com/webship/workspace) dashboard:
4
+ the `themes/` folder (type `code`), its settings file (`core/config/workspace.themes.settings.yml`),
5
+ its commands and its docs, as a plugin.
6
+
7
+ ## Use it
8
+
9
+ ```bash
10
+ cd ~/workspace
11
+ bash core/scripts/plugins.sh --require github:webship/workspace-drupal-themes
12
+ bash core/scripts/plugins.sh --activate drupal-themes # puts `themes` on the workspaces list of settings.yml
13
+ bash core/scripts/plugins.sh --install drupal-themes # the folder, its settings file (once), its commands, its docs (once)
14
+ ```
15
+
16
+ The settings file and the docs are placed once and never overwritten: they hold what you put there.
17
+ `--deactivate` takes the workspace off the list; the folder and its content stay.
18
+
19
+ ## The commands
20
+
21
+ | Command |
22
+ | --- |
23
+ | `cmd-all-back-end-build-themes.sh` |
24
+ | `cmd-all-back-end-install-themes.sh` |
25
+ | `cmd-all-front-end-build-themes.sh` |
26
+ | `cmd-all-front-end-install-themes.sh` |
27
+ | `cmd-backup-theme.sh` |
28
+ | `cmd-build-admin-theme.sh` |
29
+ | `cmd-build-drupal-template.sh` |
30
+ | `cmd-build-theme.sh` |
31
+ | `cmd-install-admin-theme.sh` |
32
+ | `cmd-install-theme.sh` |
33
+ | `cmd-tools-checks.sh` |
34
+ | `cmd-tools-gitlab-ci-local.sh` |
35
+ | `cmd-tools-graphify.sh` |
36
+ | `cmd-tools-obsidian.sh` |
37
+ | `cmd-tools-ragify.sh` |
38
+ | `cmd-tools-reclaim.sh` |
39
+ | `cmd-tools-remove.sh` |
40
+ | `cmd-tools-update-all.sh` |
41
+
42
+ The bash functions these commands call live in the dashboard's `core/scripts/functions`.
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env bash
2
+
3
+ ARGPARSE_DESCRIPTION="Build every back-end admin theme listed in workspace.themes.settings.yml."
4
+
5
+ echo "*-----------------------------------------------------------*";
6
+ echo "| Build all Back-End admin themes |";
7
+ echo "*-----------------------------------------------------------*";
8
+ echo "| ${WORKSPACE_CONFIG}/workspace.themes.settings.yml";
9
+ echo "*-----------------------------------------------------------*"
10
+
11
+ current_path=$(pwd);
12
+
13
+ # Bootstrap.
14
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
15
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
16
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
17
+
18
+ # Load workspace settings and extra lists.
19
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
20
+
21
+ # Refuse to run with an empty name. `rm -rf ${WORKSPACE_ROOT}/themes/${name}` with an unset name
22
+ # deletes the whole themes workspace, which is what the old `vdo_`-prefixed settings key caused:
23
+ # it flattened to a different variable than the one read here, so this was empty every time.
24
+ if [ -z "${drupal_template_drupal_theme_name}" ] ; then
25
+ echo "drupal.template_drupal_theme_name is not set in core/config/workspace.themes.settings.yml — refusing to run." ;
26
+ exit 1 ;
27
+ fi
28
+
29
+
30
+ cd ${WORKSPACE_ROOT}/themes/ ;
31
+
32
+ # Delete old Admin themes.
33
+ for admin_theme_name in "${admin_themes[@]}"
34
+ do
35
+ sudo rm -rf ${WORKSPACE_ROOT}/themes/${admin_theme_name};
36
+ done
37
+
38
+
39
+ cd ${WORKSPACE_ROOT}/themes/ ;
40
+
41
+ sudo rm -rf ${WORKSPACE_ROOT}/themes/${drupal_template_drupal_theme_name} ;
42
+ composer create-project drupal/recommended-project:~9.0 ${drupal_template_drupal_theme_name} --stability dev --no-interaction ;
43
+
44
+
45
+ sudo chmod 775 -R ${WORKSPACE_ROOT}/themes/${drupal_template_drupal_theme_name} ;
46
+ sudo chown www-data:${USER} -R ${WORKSPACE_ROOT}/themes/${drupal_template_drupal_theme_name} ;
47
+
48
+
49
+ # Build all admin themes in the admin theme list.
50
+ for admin_theme_name in "${admin_themes[@]}"
51
+ do
52
+ cd ${WORKSPACE_ROOT}/themes/ ;
53
+ . cmd-build-admin-theme.sh ${admin_theme_name};
54
+ done
55
+
56
+ # Change file mod and owner.
57
+ sudo chmod 775 -R ${WORKSPACE_ROOT}/themes/ ;
58
+ sudo chown www-data:${USER} -R ${WORKSPACE_ROOT}/themes/ ;
59
+
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env bash
2
+
3
+ ARGPARSE_DESCRIPTION="Install every back-end admin theme listed in workspace.themes.settings.yml into the template project."
4
+
5
+ echo "*-----------------------------------------------------------*";
6
+ echo "| Install all Back-End admin themes |";
7
+ echo "*-----------------------------------------------------------*";
8
+ echo "| ${WORKSPACE_CONFIG}/workspace.themes.settings.yml";
9
+ echo "*-----------------------------------------------------------*"
10
+
11
+ current_path=$(pwd);
12
+
13
+ # Bootstrap.
14
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
15
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
16
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
17
+
18
+ # Load workspace settings and extra lists.
19
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
20
+
21
+ # Change file mod and owner.
22
+ sudo chmod 775 -R ${WORKSPACE_ROOT}/themes/ ;
23
+ sudo chown www-data:${USER} -R ${WORKSPACE_ROOT}/themes/ ;
24
+
25
+ # Install all admin themes in the admin theme list.
26
+ for admin_theme_name in "${admin_themes[@]}"
27
+ do
28
+ cd "${WORKSPACE_ROOT}/themes/" ;
29
+ . cmd-install-admin-theme.sh ${admin_theme_name} ;
30
+ done
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env bash
2
+
3
+ ARGPARSE_DESCRIPTION="Build every front-end theme listed in workspace.themes.settings.yml."
4
+
5
+ echo "*-----------------------------------------------------------*";
6
+ echo "| Build all Front-End themes |";
7
+ echo "*-----------------------------------------------------------*";
8
+ echo "| ${WORKSPACE_CONFIG}/workspace.themes.settings.yml";
9
+ echo "*-----------------------------------------------------------*"
10
+
11
+ current_path=$(pwd);
12
+
13
+ # Bootstrap.
14
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
15
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
16
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
17
+
18
+ # Load workspace settings and extra lists.
19
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
20
+
21
+ # Refuse to run with an empty name. `rm -rf ${WORKSPACE_ROOT}/themes/${name}` with an unset name
22
+ # deletes the whole themes workspace, which is what the old `vdo_`-prefixed settings key caused:
23
+ # it flattened to a different variable than the one read here, so this was empty every time.
24
+ if [ -z "${drupal_template_drupal_theme_name}" ] ; then
25
+ echo "drupal.template_drupal_theme_name is not set in core/config/workspace.themes.settings.yml — refusing to run." ;
26
+ exit 1 ;
27
+ fi
28
+
29
+
30
+ cd ${WORKSPACE_ROOT}/themes/ ;
31
+
32
+ # Delete old themes.
33
+ for theme_name in "${themes[@]}"
34
+ do
35
+ sudo rm -rf ${WORKSPACE_ROOT}/themes/${theme_name};
36
+ done
37
+
38
+ cd ${WORKSPACE_ROOT}/themes/ ;
39
+
40
+ sudo rm -rf ${WORKSPACE_ROOT}/themes/${drupal_template_drupal_theme_name} ;
41
+ composer create-project drupal/recommended-project:~9.0 ${drupal_template_drupal_theme_name} --stability dev --no-interaction ;
42
+
43
+
44
+ sudo chmod 775 -R ${WORKSPACE_ROOT}/themes/${drupal_template_drupal_theme_name} ;
45
+ sudo chown www-data:${USER} -R ${WORKSPACE_ROOT}/themes/${drupal_template_drupal_theme_name} ;
46
+
47
+ # Build all themes in the themes list.
48
+ for theme_name in "${themes[@]}"
49
+ do
50
+ cd ${WORKSPACE_ROOT}/themes/ ;
51
+ . cmd-build-theme.sh ${theme_name};
52
+ done
53
+
54
+ # Change file mod and owner.
55
+ sudo chmod 775 -R ${WORKSPACE_ROOT}/themes/ ;
56
+ sudo chown www-data:${USER} -R ${WORKSPACE_ROOT}/themes/ ;
57
+
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env bash
2
+
3
+ ARGPARSE_DESCRIPTION="Install every front-end theme listed in workspace.themes.settings.yml into the template project."
4
+
5
+ echo "*-----------------------------------------------------------*";
6
+ echo "| Install all Front-End themes |";
7
+ echo "*-----------------------------------------------------------*";
8
+ echo "| ${WORKSPACE_CONFIG}/workspace.themes.settings.yml";
9
+ echo "*-----------------------------------------------------------*"
10
+
11
+ current_path=$(pwd);
12
+
13
+ # Bootstrap.
14
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
15
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
16
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
17
+
18
+ # Load workspace settings and extra lists.
19
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
20
+
21
+ # Change file mod and owner.
22
+ sudo chmod 775 -R ${WORKSPACE_ROOT}/themes/ ;
23
+ sudo chown www-data:${USER} -R ${WORKSPACE_ROOT}/themes/ ;
24
+
25
+ # Install all themes in the themes list.
26
+ for theme_name in "${themes[@]}"
27
+ do
28
+ cd "${WORKSPACE_ROOT}/themes/" ;
29
+ . cmd-install-theme.sh ${theme_name} ;
30
+ done
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Bootstrap.
4
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
5
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
6
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
7
+
8
+ # Load workspace settings and extra lists.
9
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
10
+
11
+ ARGPARSE_DESCRIPTION="Backup a theme"
12
+ argparse "$@" <<EOF || exit 1
13
+ parser.add_argument('PROJECT_NAME',
14
+ help='The name of the theme.')
15
+ EOF
16
+
17
+ shift $#;
18
+ trim_project_name ; # "v11x00b1/" -> "v11x00b1" — see functions/fun-project-name.sh
19
+
20
+ backup_time=$( date '+%Y-%m-%d_%H-%M-%S' );
21
+ tar -cvzf ${backups}/${doc_name}/${doc_name}---${PROJECT_NAME}--${backup_time}.tar.gz ${PROJECT_NAME} ;
22
+ (cd ${PROJECT_NAME} && ddev export-db --file=${backups}/${doc_name}/${doc_name}---${PROJECT_NAME}--${backup_time}-db.sql.gz) ;
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # workspace-name: Admin Theme
4
+
5
+ # Bootstrap.
6
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
7
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
8
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
9
+
10
+ # Load workspace settings and extra lists.
11
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
12
+
13
+ # GET the project name argument.
14
+ if [ "$1" != "" ]; then
15
+ theme_name=$1;
16
+ else
17
+ echo "Please add the name of your theme.";
18
+ exit 1;
19
+ fi
20
+
21
+ echo "*-----------------------------------------------------------*";
22
+ echo "| Build ${theme_name}";
23
+ echo "*-----------------------------------------------------------*";
24
+
25
+ cp -r ${drupal_template_drupal_theme_name} ${WORKSPACE_ROOT}/themes/${theme_name} ;
26
+ cd ${WORKSPACE_ROOT}/themes/${theme_name} ;
27
+ composer require drupal/${theme_name} ;
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # workspace-name: Drupal template
4
+
5
+ echo "*-----------------------------------------------------------*";
6
+ echo "| Build Drupal template |";
7
+ echo "*-----------------------------------------------------------*";
8
+
9
+ current_path=$(pwd);
10
+
11
+ # Bootstrap.
12
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
13
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
14
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
15
+
16
+ # Load workspace settings and extra lists.
17
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
18
+
19
+ # Refuse to run with an empty name. `rm -rf ${WORKSPACE_ROOT}/themes/${name}` with an unset name
20
+ # deletes the whole themes workspace, which is what the old `vdo_`-prefixed settings key caused:
21
+ # it flattened to a different variable than the one read here, so this was empty every time.
22
+ if [ -z "${drupal_template_drupal_theme_name}" ] ; then
23
+ echo "drupal.template_drupal_theme_name is not set in core/config/workspace.themes.settings.yml — refusing to run." ;
24
+ exit 1 ;
25
+ fi
26
+
27
+
28
+ cd ${WORKSPACE_ROOT}/themes/ ;
29
+
30
+ sudo rm -rf ${WORKSPACE_ROOT}/themes/${drupal_template_drupal_theme_name} ;
31
+ composer create-project drupal/recommended-project:~9.0 ${drupal_template_drupal_theme_name} --stability dev --no-interaction ;
32
+
33
+
34
+ sudo chmod 775 -R ${WORKSPACE_ROOT}/themes/${drupal_template_drupal_theme_name} ;
35
+ sudo chown www-data:${USER} -R ${WORKSPACE_ROOT}/themes/${drupal_template_drupal_theme_name} ;
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # workspace-name: Theme
4
+
5
+ # Bootstrap.
6
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
7
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
8
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
9
+
10
+ # Load workspace settings and extra lists.
11
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
12
+
13
+ # GET the project name argument.
14
+ if [ "$1" != "" ]; then
15
+ theme_name=$1;
16
+ else
17
+ echo "Please add the name of your theme.";
18
+ exit 1;
19
+ fi
20
+
21
+ echo "*-----------------------------------------------------------*";
22
+ echo "| Build ${theme_name}";
23
+ echo "*-----------------------------------------------------------*";
24
+
25
+ cp -r ${drupal_template_drupal_theme_name} ${WORKSPACE_ROOT}/themes/${theme_name} ;
26
+ cd ${WORKSPACE_ROOT}/themes/${theme_name} ;
27
+ composer require drupal/${theme_name} ;
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Bootstrap.
4
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
5
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
6
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
7
+
8
+ # Load workspace settings and extra lists.
9
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
10
+
11
+ # GET the project name argument.
12
+ if [ "$1" != "" ]; then
13
+ theme_name=$1;
14
+ else
15
+ echo "Please add the name of your theme.";
16
+ exit 1;
17
+ fi
18
+
19
+ echo "*-----------------------------------------------------------*";
20
+ echo "| Install ${theme_name}";
21
+ echo "*-----------------------------------------------------------*";
22
+
23
+
24
+
25
+ cd "${WORKSPACE_ROOT}/themes/${theme_name}/web";
26
+
27
+ ddev drush site-install standard --yes \
28
+ --site-name="Theme ${theme_name}" \
29
+ --account-name="${account_name}" \
30
+ --account-pass="${account_pass}" \
31
+ --account-mail="${account_mail}" \
32
+ --db-url="mysql://db:db@db/db" ;
33
+
34
+ ddev drush config-set system.performance css.preprocess 0 --yes ;
35
+ ddev drush config-set system.performance js.preprocess 0 --yes ;
36
+ ddev drush config-set system.logging error_level all --yes ;
37
+ ddev drush cr ;
38
+
39
+ ddev drush theme-enable ${theme_name} ;
40
+ ddev drush config-set system.theme admin ${theme_name} --yes ;
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Bootstrap.
4
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
5
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
6
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
7
+
8
+ # Load workspace settings and extra lists.
9
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
10
+
11
+ # GET the project name argument.
12
+ if [ "$1" != "" ]; then
13
+ theme_name=$1;
14
+ else
15
+ echo "Please add the name of your theme.";
16
+ exit 1;
17
+ fi
18
+
19
+ echo "*-----------------------------------------------------------*";
20
+ echo "| Install ${theme_name}";
21
+ echo "*-----------------------------------------------------------*";
22
+
23
+
24
+
25
+ cd "${WORKSPACE_ROOT}/themes/${theme_name}/web";
26
+
27
+ ddev drush site-install standard --yes \
28
+ --site-name="Theme ${theme_name}" \
29
+ --account-name="${account_name}" \
30
+ --account-pass="${account_pass}" \
31
+ --account-mail="${account_mail}" \
32
+ --db-url="mysql://db:db@db/db" ;
33
+
34
+ ddev drush config-set system.performance css.preprocess 0 --yes ;
35
+ ddev drush config-set system.performance js.preprocess 0 --yes ;
36
+ ddev drush config-set system.logging error_level all --yes ;
37
+ ddev drush cr ;
38
+
39
+ ddev drush theme-enable ${theme_name} ;
40
+ ddev drush config-set system.theme default ${theme_name} --yes ;
41
+ ddev drush config-set system.theme admin seven --yes ;
42
+
43
+
44
+
45
+
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Run the code-quality checks a package in this workspace already declares in its package.json —
4
+ # lint:js, lint:css, lint:yaml, spellcheck, phpcs, and the browser suite — mapped onto one set of
5
+ # canonical names so the command means the same thing in every workspace.
6
+
7
+ # Bootstrap.
8
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
9
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
10
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
11
+
12
+ # Load workspace settings and extra lists.
13
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
14
+
15
+ ARGPARSE_DESCRIPTION="Run the code-quality checks a themes item already declares"
16
+ source ${WORKSPACE_SCRIPTS}/args/arg-checks.sh || exit 1 ;
17
+
18
+ shift $#;
19
+
20
+ checks_command ;
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Run a project's GitLab CI pipeline locally with gitlab-ci-local — the Webship
4
+ # green-gate before any push to git.drupalcode.org. Wires the
5
+ # drupal/gitlab_templates remote variables through the drupal-ci-local wrapper
6
+ # (installed on first run), checks Docker and SSH, and reports GREEN/RED.
7
+
8
+ # Bootstrap.
9
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
10
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
11
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
12
+
13
+ # Load workspace settings and extra lists.
14
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
15
+
16
+ ARGPARSE_DESCRIPTION="Run a themes project's GitLab CI pipeline locally (the green-gate)"
17
+ source ${WORKSPACE_SCRIPTS}/args/arg-gitlab-ci-local.sh || exit 1 ;
18
+
19
+ shift $#;
20
+
21
+ if [ "${DOCTOR}" == 'yes' ] ; then
22
+ gitlab_ci_local_doctor && echo "Everything a green-gate run needs is in place." ;
23
+ else
24
+ gitlab_ci_local_run ;
25
+ fi
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Map a project in this workspace into a queryable knowledge graph with
4
+ # graphify (https://github.com/Graphify-Labs/graphify), or ask an existing
5
+ # graph a question.
6
+
7
+ # Bootstrap.
8
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
9
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
10
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
11
+
12
+ # Load workspace settings and extra lists.
13
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
14
+
15
+ ARGPARSE_DESCRIPTION="Build or query the knowledge graph of a project in the themes workspace"
16
+ source ${WORKSPACE_SCRIPTS}/args/arg-graphify.sh || exit 1 ;
17
+
18
+ shift $#;
19
+
20
+ if [ ! "${STORE}" == '_none_' ] ; then
21
+ ensure_graphify || exit 1 ;
22
+ graphify_store_url "${WORKSPACE_ROOT}/${doc_name}/${PROJECT_NAME}" "${STORE}" ;
23
+ elif [ -n "${QUERY}" ] ; then
24
+ graphify_query_project ;
25
+ else
26
+ graphify_project ;
27
+ fi
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Turn a project's knowledge graph into an Obsidian vault — one note per entity,
4
+ # a [[wikilink]] per relation, and a JSON Canvas of the map. Written next to the
5
+ # graph in graphs/themes/<project>/obsidian/.
6
+ #
7
+ # Build the graph first with cmd-tools-graphify.sh: this reads what that wrote
8
+ # rather than parsing the project a second time.
9
+
10
+ # Bootstrap.
11
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
12
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
13
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
14
+
15
+ # Load workspace settings and extra lists.
16
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
17
+
18
+ ARGPARSE_DESCRIPTION="Build an Obsidian vault from the knowledge graph of a project in the themes workspace"
19
+ source ${WORKSPACE_SCRIPTS}/args/arg-obsidian.sh || exit 1 ;
20
+
21
+ shift $#;
22
+
23
+ export MAX_CANVAS_NODES="${MAX_CANVAS_NODES}";
24
+
25
+ if [ "${REMOVE}" == 'yes' ] ; then
26
+ obsidian_remove ;
27
+ elif [ "${STATUS}" == 'yes' ] ; then
28
+ obsidian_status ;
29
+ else
30
+ obsidian_project ;
31
+ fi
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Index a project in this workspace into the Milvus vector database
4
+ # (https://github.com/milvus-io/milvus) held in ~/workspace/rag, or ask an
5
+ # existing index a question.
6
+ #
7
+ # The RAG counterpart of cmd-tools-graphify.sh: graphify parses the CODE into a
8
+ # graph and reads no Markdown, Twig, *.module hooks or Drupal wiring YAML — this
9
+ # indexes the text of exactly those and retrieves passages from them.
10
+
11
+ # Bootstrap.
12
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
13
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
14
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
15
+
16
+ # Load workspace settings and extra lists.
17
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
18
+
19
+ ARGPARSE_DESCRIPTION="Build or query the Milvus RAG index of a project in the themes workspace"
20
+ source ${WORKSPACE_SCRIPTS}/args/arg-ragify.sh || exit 1 ;
21
+
22
+ shift $#;
23
+
24
+ if [ -n "${QUERY}" ] ; then
25
+ ragify_query_project ;
26
+ else
27
+ ragify_project ;
28
+ fi
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Reclaim the disk that REMOVED projects left behind — their DDEV databases, snapshots, built images
4
+ # and containers. A project whose folder is still on disk is never touched, stopped or not.
5
+ #
6
+ # The sweep is machine-wide wherever you run it: it takes no project name, reads WORKSPACE_ROOT, and
7
+ # protects every project folder in the tree — so this copy behaves identically to the one in any other
8
+ # workspace. It ships in each workspace that leans on DDEV, graphify or RAG for the same reason
9
+ # cmd-tools-graphify.sh does: the folder you are standing in is where you look for a cmd-tools-*.
10
+
11
+ # Bootstrap.
12
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
13
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
14
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
15
+
16
+ # Load workspace settings and extra lists.
17
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
18
+
19
+ ARGPARSE_DESCRIPTION="Reclaim disk from projects that no longer have a folder — dry run unless --apply"
20
+ source ${WORKSPACE_SCRIPTS}/args/arg-reclaim.sh || exit 1 ;
21
+
22
+ shift $#;
23
+
24
+ reclaim_command ;
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Bootstrap.
4
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
5
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
6
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
7
+
8
+ # Load workspace settings and extra lists.
9
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
10
+
11
+
12
+ ARGPARSE_DESCRIPTION="Remove a project"
13
+ argparse "$@" <<EOF || exit 1
14
+ parser.add_argument('PROJECT_NAME',
15
+ default='_none_',
16
+ nargs='?',
17
+ help='The name of the project.')
18
+ parser.add_argument('-f', '--force',
19
+ action='store_true',
20
+ default=False,
21
+ help='Remove even when the folder is the main git checkout other worktrees depend on, or holds commits and changes that are on no remote. Both are refused without it.')
22
+ parser.add_argument('-o', '--orphans',
23
+ action='store_true',
24
+ default=False,
25
+ help='List DDEV entries whose project directory is gone, instead of removing anything.')
26
+ EOF
27
+
28
+ shift $#;
29
+ trim_project_name ; # "v11x00b1/" -> "v11x00b1" — see functions/fun-project-name.sh
30
+
31
+
32
+ # Change directory to the workspace for this full operation.
33
+ cd ${WORKSPACE_ROOT}/${doc_name};
34
+
35
+ if [ "${ORPHANS}" == 'yes' ] ; then
36
+ report_orphans ;
37
+ elif [ "${PROJECT_NAME}" == '_none_' ] ; then
38
+ echo "Name the project to remove, or pass --orphans to see DDEV entries with no directory." ;
39
+ exit 1 ;
40
+ else
41
+ remove_project "${PROJECT_NAME}" || exit 1 ;
42
+ fi
@@ -0,0 +1,17 @@
1
+ # Bootstrap.
2
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
3
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
4
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
5
+
6
+ # Load workspace settings and extra lists.
7
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.themes.settings.yml);
8
+
9
+ for project in *; do
10
+ if [ -d "$project" ]; then
11
+ echo "===========================================";
12
+ echo " $project";
13
+ echo "===========================================";
14
+ cd ${WORKSPACE_ROOT}/${doc_name}/${project};
15
+ composer update --no-interaction ;
16
+ fi
17
+ done