Skip to content

Commit

Permalink
Moved dev files to .scaffold directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Mar 16, 2024
1 parent 15c6ce0 commit d72bf1a
Show file tree
Hide file tree
Showing 24 changed files with 82 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ jobs:
- *step_setup_docker_network
- run:
name: Run CircleCI tests (long)
command: DREVOPS_DEV_VOLUMES_MOUNTED=0 DREVOPS_DEV_TEST_COVERAGE_DIR=/tmp/artifacts/coverage .drevops/tests/test.postbuild.sh
command: DREVOPS_DEV_VOLUMES_MOUNTED=0 DREVOPS_DEV_TEST_COVERAGE_DIR=/tmp/artifacts/coverage .scaffold/tests/test.postbuild.sh
- store_test_results:
path: *test_results
- store_artifacts:
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# Drupal provides its own .gitattributes so git normalisations are handled there.

/.gitattributes export-ignore
/.drevops export-ignore
/.scaffold export-ignore
/.github/FUNDING.yml export-ignore
8 changes: 4 additions & 4 deletions .github/workflows/drevops-publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ jobs:
uses: shivammathur/setup-php@v2

- name: Build site
working-directory: .drevops/docs
working-directory: .scaffold/docs
run: ahoy build

- name: Check spelling
working-directory: .drevops/docs
working-directory: .scaffold/docs
run: ahoy lint

- name: Run tests
working-directory: .drevops/docs
working-directory: .scaffold/docs
run: ahoy test

- name: Setup SSH private key
Expand All @@ -47,7 +47,7 @@ jobs:

- name: Publish docs
run: |
cd .drevops/docs
cd .scaffold/docs
export [email protected]:drevops/docs.git
export DOCS_PUBLISH_SRC_TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }}
export DOCS_PUBLISH_SRC_BRANCH=${{ github.ref_type == 'branch' && github.ref_name || '' }}
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/drevops-test-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
TEST_DOCKER_USER: ${{ secrets.TEST_DOCKER_USER }}
TEST_DOCKER_PASS: ${{ secrets.TEST_DOCKER_PASS }}
DREVOPS_DEV_VOLUMES_MOUNTED: 0
DREVOPS_DEV_TEST_COVERAGE_DIR: /tmp/.drevops-coverage-html
DREVOPS_DEV_TEST_COVERAGE_DIR: /tmp/.scaffold-coverage-html

steps:
- name: Checkout code
Expand All @@ -54,29 +54,29 @@ jobs:
- name: Install dependencies
run: npm ci
working-directory: .drevops/tests
working-directory: .scaffold/tests

- name: Lint code
run: |
./tests/lint.scripts.sh
./tests/lint.dockerfiles.sh
./tests/lint.spelling.sh
working-directory: .drevops
working-directory: .scaffold

- name: Run tests
run: ./tests/test.common.sh
working-directory: .drevops
working-directory: .scaffold

- name: Upload coverage report as an artifact
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}-code-coverage-report
path: /tmp/.drevops-coverage-html
path: /tmp/.scaffold-coverage-html

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
with:
directory: /tmp/.drevops-coverage-html
directory: /tmp/.scaffold-coverage-html
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -97,7 +97,7 @@ jobs:
TEST_DOCKER_USER: ${{ secrets.TEST_DOCKER_USER }}
TEST_DOCKER_PASS: ${{ secrets.TEST_DOCKER_PASS }}
DREVOPS_DEV_VOLUMES_MOUNTED: 0
DREVOPS_DEV_TEST_COVERAGE_DIR: /tmp/.drevops-coverage-html
DREVOPS_DEV_TEST_COVERAGE_DIR: /tmp/.scaffold-coverage-html
TEST_NODE_INDEX: ${{ matrix.batch }}

steps:
Expand All @@ -112,22 +112,22 @@ jobs:

- name: Install dependencies
run: npm ci
working-directory: .drevops/tests
working-directory: .scaffold/tests

- name: Run tests
run: ./tests/test.workflow.sh
working-directory: .drevops
working-directory: .scaffold

- name: Upload coverage report as an artifact
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}-${{ matrix.batch }}-code-coverage-report
path: /tmp/.drevops-coverage-html
path: /tmp/.scaffold-coverage-html

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
with:
directory: /tmp/.drevops-coverage-html
directory: /tmp/.scaffold-coverage-html
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -148,7 +148,7 @@ jobs:
TEST_DOCKER_USER: ${{ secrets.TEST_DOCKER_USER }}
TEST_DOCKER_PASS: ${{ secrets.TEST_DOCKER_PASS }}
DREVOPS_DEV_VOLUMES_MOUNTED: 0
DREVOPS_DEV_TEST_COVERAGE_DIR: /tmp/.drevops-coverage-html
DREVOPS_DEV_TEST_COVERAGE_DIR: /tmp/.scaffold-coverage-html
TEST_NODE_INDEX: ${{ matrix.batch }}

steps:
Expand All @@ -172,21 +172,21 @@ jobs:
- name: Install dependencies
run: npm ci
working-directory: .drevops/tests
working-directory: .scaffold/tests

- name: Run tests
run: ./tests/test.deployment.sh
working-directory: .drevops
working-directory: .scaffold

- name: Upload coverage report as an artifact
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}-${{ matrix.batch }}-code-coverage-report
path: /tmp/.drevops-coverage-html
path: /tmp/.scaffold-coverage-html

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
with:
directory: /tmp/.drevops-coverage-html
directory: /tmp/.scaffold-coverage-html
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
14 changes: 7 additions & 7 deletions .github/workflows/drevops-test-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

env:
DREVOPS_DEV_TEST_COVERAGE_DIR: /tmp/.drevops-coverage-html
DREVOPS_DEV_TEST_COVERAGE_DIR: /tmp/.scaffold-coverage-html

steps:
- name: Checkout code
Expand All @@ -37,30 +37,30 @@ jobs:
uses: shivammathur/setup-php@v2

- name: Build site
working-directory: .drevops/docs
working-directory: .scaffold/docs
run: ahoy build

- name: Check spelling
working-directory: .drevops/docs
working-directory: .scaffold/docs
run: ahoy lint

- name: Run tests
working-directory: .drevops/docs
working-directory: .scaffold/docs
run: ahoy test-site

- name: Run tests
run: ./docs/.utils/test.sh
working-directory: .drevops
working-directory: .scaffold

- name: Upload coverage report as an artifact
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}-code-coverage-report
path: /tmp/.drevops-coverage-html
path: /tmp/.scaffold-coverage-html

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
with:
directory: /tmp/.drevops-coverage-html
directory: /tmp/.scaffold-coverage-html
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 4 additions & 0 deletions .scaffold/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Scaffold development

This directory contains development files for the scaffold itself.
This directory is removed by the installer or can be deleted manually.
2 changes: 1 addition & 1 deletion .scaffold/docs/.utils/tests/bats/_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ setup() {
# The root directory of the project.
export ROOT_DIR="$(dirname "$(cd "$(dirname "${BATS_TEST_DIRNAME}")/../../.." && pwd)")"

[ ! -d "${ROOT_DIR}/.drevops" ] && echo 'ERROR: The test should be run from the ".drevops" directory.' && exit 1
[ ! -d "${ROOT_DIR}/.scaffold" ] && echo 'ERROR: The test should be run from the ".scaffold" directory.' && exit 1

# Register a path to libraries.
export BATS_LIB_PATH="${BATS_TEST_DIRNAME}/../node_modules"
Expand Down
8 changes: 4 additions & 4 deletions .scaffold/docs/.utils/tests/bats/docs.bats
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export BATS_FIXTURE_EXPORT_CODEBASE_ENABLED=1
prepare_remote_docs_repo

# The test itself.
pushd "${LOCAL_REPO_DIR}/.drevops/docs" >/dev/null || exit 1
pushd "${LOCAL_REPO_DIR}/.scaffold/docs" >/dev/null || exit 1

substep "Test 1: Publish from branch."
export DOCS_PUBLISH_SRC_BRANCH="feature/test-branch-first"
Expand Down Expand Up @@ -89,10 +89,10 @@ assert_version() {
}

update_local_repo() {
# Need to do this as '.drevops' dir is excluded in .gitattributes.
# Need to do this as '.scaffold' dir is excluded in .gitattributes.
substep "Copying docs to ${LOCAL_REPO_DIR}."
mkdir -p "${LOCAL_REPO_DIR}/.drevops/docs"
cp -r "${ROOT_DIR}/.drevops/docs/." "${LOCAL_REPO_DIR}/.drevops/docs"
mkdir -p "${LOCAL_REPO_DIR}/.scaffold/docs"
cp -r "${ROOT_DIR}/.scaffold/docs/." "${LOCAL_REPO_DIR}/.scaffold/docs"
}

prepare_remote_docs_repo() {
Expand Down
14 changes: 7 additions & 7 deletions .scaffold/docs/.utils/update-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Update docs.
#
# @usage
# cd .drevops/docs && ./update-docs.sh
# cd .scaffold/docs && ./update-docs.sh
#
# shellcheck disable=SC2129

Expand Down Expand Up @@ -42,9 +42,9 @@ echo >>"${OUTPUT_FILE}"
../../scripts/custom \
>>"${OUTPUT_FILE}"

sed "${sed_opts[@]}" "s/.drevops\/docs\/.utils\/variables\/extra\/environment.variables.sh/ENVIRONMENT/g" "${OUTPUT_FILE}"
sed "${sed_opts[@]}" "s/.drevops\/docs\/.utils\/variables\/extra\/acquia.variables.sh/ACQUIA ENVIRONMENT/g" "${OUTPUT_FILE}"
sed "${sed_opts[@]}" "s/.drevops\/docs\/.utils\/variables\/extra\/lagoon.variables.sh/LAGOON ENVIRONMENT/g" "${OUTPUT_FILE}"
sed "${sed_opts[@]}" "s/.drevops\/docs\/.utils\/variables\/extra\/.env.local.default.variables.sh/.env.local.default/g" "${OUTPUT_FILE}"
sed "${sed_opts[@]}" "s/.drevops\/docs\/.utils\/variables\/extra\/.env.variables.sh/.env/g" "${OUTPUT_FILE}"
sed "${sed_opts[@]}" "s/.drevops\/docs\/.utils\/variables\/extra\/ci.variables.sh/CI config/g" "${OUTPUT_FILE}"
sed "${sed_opts[@]}" "s/.scaffold\/docs\/.utils\/variables\/extra\/environment.variables.sh/ENVIRONMENT/g" "${OUTPUT_FILE}"
sed "${sed_opts[@]}" "s/.scaffold\/docs\/.utils\/variables\/extra\/acquia.variables.sh/ACQUIA ENVIRONMENT/g" "${OUTPUT_FILE}"
sed "${sed_opts[@]}" "s/.scaffold\/docs\/.utils\/variables\/extra\/lagoon.variables.sh/LAGOON ENVIRONMENT/g" "${OUTPUT_FILE}"
sed "${sed_opts[@]}" "s/.scaffold\/docs\/.utils\/variables\/extra\/.env.local.default.variables.sh/.env.local.default/g" "${OUTPUT_FILE}"
sed "${sed_opts[@]}" "s/.scaffold\/docs\/.utils\/variables\/extra\/.env.variables.sh/.env/g" "${OUTPUT_FILE}"
sed "${sed_opts[@]}" "s/.scaffold\/docs\/.utils\/variables\/extra\/ci.variables.sh/CI config/g" "${OUTPUT_FILE}"
12 changes: 6 additions & 6 deletions .scaffold/docs/content/contributing/maintenance/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ There are 2 types of the documentation that DrevOps provides:
## docs.drevops.com

The Documentation (this site) is written in Markdown and located in
[`.drevops/docs`](../../../../.drevops/docs) directory. This is
[`.scaffold/docs`](../../../../.scaffold/docs) directory. This is
removed when you install DrevOps for a
consumer site.

### Local build

```bash
cd .drevops/docs
cd .scaffold/docs
ahoy build
```

Parts of the documentation is generated automatically from the codebase.
To update it, run:

```bash
composer -d .drevops/docs/.utils install
cd .drevops/docs
composer -d .scaffold/docs/.utils install
cd .scaffold/docs
ahoy update
```

Expand All @@ -35,11 +35,11 @@ immediately.
### Check spelling and links

```bash
cd .drevops/docs
cd .scaffold/docs
ahoy test
```

If required, add spelling exclusions to `.drevops/tests/.aspell.en.pws`
If required, add spelling exclusions to `.scaffold/tests/.aspell.en.pws`
file.

### Publishing
Expand Down
12 changes: 6 additions & 6 deletions .scaffold/docs/content/contributing/maintenance/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ See [Bats documentation](https://bats-core.readthedocs.io/) for more information
## Installation

```bash
npm install --prefix .drevops/tests
npm install --prefix .scaffold/tests
```

## Usage

```bash
# Run a single test.
bats .drevops/tests/bats/helpers.bats
bats .scaffold/tests/bats/helpers.bats

# Some tests require Composer and Docker Hub tokens.
TEST_GITHUB_TOKEN=<yourtoken> TEST_DOCKER_USER=<youruser> TEST_DOCKER_PASS=<yourpass> bats .drevops/tests/bats/workflow.smoke.bats
TEST_GITHUB_TOKEN=<yourtoken> TEST_DOCKER_USER=<youruser> TEST_DOCKER_PASS=<yourpass> bats .scaffold/tests/bats/workflow.smoke.bats

# To preserve test run directory.
bats --no-tempdir-cleanup .drevops/tests/bats/helpers.bats
bats --no-tempdir-cleanup .scaffold/tests/bats/helpers.bats

# To override Bats temporary directory where tests are ran (required for Docker tests).
mkdir -p $HOME/.bats-tmp # run once
TMPDIR=$HOME/.bats-tmp bats .drevops/tests/bats/helpers.bats
TMPDIR=$HOME/.bats-tmp bats .scaffold/tests/bats/helpers.bats

# Run all tests, preserving the temporary directory.
TEST_GITHUB_TOKEN=<yourtoken> \
TEST_DOCKER_USER=<youruser> \
TEST_DOCKER_PASS=<yourpass> \
TMPDIR=$HOME/.bats-tmp \
bats --no-tempdir-cleanup .drevops/tests/bats/*.bats
bats --no-tempdir-cleanup .scaffold/tests/bats/*.bats
```

## Updating test assets
Expand Down
2 changes: 1 addition & 1 deletion .scaffold/docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ site_url: https://docs.drevops.com
# Repository
repo_name: drevops/scaffold
repo_url: https://github.com/drevops/scaffold
edit_uri: edit/main/.drevops/docs/content
edit_uri: edit/main/.scaffold/docs/content
# Copyright
copyright: 'Copyright &copy;2023 DrevOps<sup>&reg;</sup><br/><strong><a href="https://drupal.org">Drupal</a></strong> is a registered trademark of <a href="http://buytaert.net/">Dries Buytaert</a>'

Expand Down
Loading

0 comments on commit d72bf1a

Please sign in to comment.