Skip to content

Commit

Permalink
[#1259] Renamed .gitignore.deployment to .gitignore.artifact. (#1264
Browse files Browse the repository at this point in the history
)
  • Loading branch information
AlexSkrypnyk authored Apr 16, 2024
1 parent ce3331c commit 2caab7b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion .scaffold/docs/content/getting-started/architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ with addition of several configuration files and directories.
├── .env # Environment variables to control project workflow using DrevOps variables.
├── .env.local.default # Environment variables local overrides.
├── .gitignore # Intentionally untracked files to ignore in Git.
├── .gitignore.deployment # Intentionally untracked files to ignore in artifact deployment.
├── .gitignore.artifact # Intentionally untracked files to ignore in artifact deployment.
├── .lagoon.yml # Lagoon configuration file. Removed if not using Lagoon hosting.
├── .twig-cs-fixer.php # Twig CS Fixer configuration file.
├── behat.yml # Behat configuration file.
Expand Down
8 changes: 4 additions & 4 deletions .scaffold/docs/content/tools/git-artifact.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ https://github.com/drevops/git-artifact
Some hosting providers, like Acquia, restrict certain build operations, making
it necessary to develop and build your site elsewhere before deploying it. This
tool streamlines that process: it uses a `.gitignore.deployment` file to control
tool streamlines that process: it uses a `.gitignore.artifact` file to control
which files get transferred, and overwrites the destination repository's history
with each push, while preserving the source history.

Scaffold comes
with [pre-configured `.gitignore.deployment`](https://github.com/drevops/scaffold/blob/develop/.gitignore.deployment)
with [pre-configured `.gitignore.artifact`](https://github.com/drevops/scaffold/blob/develop/.gitignore.artifact)
file and [deployment script](https://github.com/drevops/scaffold/blob/develop/scripts/drevops/deploy-artifact.sh)
to build the artifact in CI and push it to the remote repository in Acquia.

Expand All @@ -21,14 +21,14 @@ This tool is used in CI and does not require any manual actions.

## Configuration

The deployment targets can be added to the `.gitignore.deployment` file: it will
The deployment targets can be added to the `.gitignore.artifact` file: it will
replace the standard `.gitignore` file in the artifact repository.

The file already contains all required targets to get the full site build with
production-only dependencies (dev-dependencies are excluded from the code
artifact during the CI build).

Modifying targets in the `.gitignore.deployment` file works just like updating
Modifying targets in the `.gitignore.artifact` file works just like updating
a regular `.gitignore` file.

It is required to set the following environment variables in CI:
Expand Down
2 changes: 1 addition & 1 deletion .scaffold/tests/bats/_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ assert_files_present_no_deployment() {

pushd "${dir}" >/dev/null || exit 1

assert_file_not_exists ".gitignore.deployment"
assert_file_not_exists ".gitignore.artifact"
assert_file_not_exists "docs/deployment.md"

# 'Required' files can be asserted for modifications only if they were not
Expand Down
2 changes: 1 addition & 1 deletion .scaffold/tests/bats/_helper.deployment.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ assert_deployment_files_present() {
assert_dir_not_exists .data
assert_dir_not_exists .docker
assert_dir_not_exists .github
assert_dir_not_exists .gitignore.deployment
assert_dir_not_exists .gitignore.artifact
assert_dir_not_exists node_modules
assert_dir_not_exists patches
assert_dir_not_exists .logs/screenshots
Expand Down
6 changes: 3 additions & 3 deletions scripts/drevops/deploy-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# an artifact in CI and then commit only required files to the destination
# repository.
#
# During deployment, the `.gitignore.deployment` file determines which files
# During deployment, the `.gitignore.artifact` file determines which files
# to exclude, using the `.gitignore` syntax. When preparing the artifact build,
# this file supersedes the existing `.gitignore`, and any specified files are
# excluded.
Expand Down Expand Up @@ -95,15 +95,15 @@ fi
# in deploy code source files.
cp -a "${DREVOPS_DEPLOY_ARTIFACT_ROOT}"/.git "${DREVOPS_DEPLOY_ARTIFACT_SRC}" || true
# Copying deployment .gitignore as it may not exist in deploy code source files.
cp -a "${DREVOPS_DEPLOY_ARTIFACT_ROOT}"/.gitignore.deployment "${DREVOPS_DEPLOY_ARTIFACT_SRC}" || true
cp -a "${DREVOPS_DEPLOY_ARTIFACT_ROOT}"/.gitignore.artifact "${DREVOPS_DEPLOY_ARTIFACT_SRC}" || true

note "Running artifact builder."
# Add --debug to debug any deployment issues.
"${HOME}/.composer/vendor/bin/git-artifact" "${DREVOPS_DEPLOY_ARTIFACT_GIT_REMOTE}" \
--root="${DREVOPS_DEPLOY_ARTIFACT_ROOT}" \
--src="${DREVOPS_DEPLOY_ARTIFACT_SRC}" \
--branch="${DREVOPS_DEPLOY_ARTIFACT_DST_BRANCH}" \
--gitignore="${DREVOPS_DEPLOY_ARTIFACT_SRC}"/.gitignore.deployment \
--gitignore="${DREVOPS_DEPLOY_ARTIFACT_SRC}"/.gitignore.artifact \
--log="${DREVOPS_DEPLOY_ARTIFACT_LOG}" \
-vvv

Expand Down

1 comment on commit 2caab7b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.