Skip to content

Commit 26fee00

Browse files
author
Neil Hastings
authored
VACMS-5193 Content Build Separation work (#5199)
* Add content-build to composer package * Change the symlink for web to content build * Update build script file * VACMS-5193: Update comment referencing va-gov/web * Reapply content repoe move * PHPCS fixes * VACMS-5005: Update content build to use new jobs * Change job to correct prefix * Update tugboat build scripts in content-build repo * Update static symlink to new content-build repo * update composer build * Composer lock update * Clean up full commands since we will not be building assets anymore. * Change the branch/PR autocomplete repo
1 parent 7235bdc commit 26fee00

File tree

11 files changed

+41
-53
lines changed

11 files changed

+41
-53
lines changed

.tugboat/config.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ services:
157157
- if [ "$TUGBOAT_PREVIEW_TYPE" = "pullrequest" ]; then bash -lc 'task --taskfile=tests.yml'; fi
158158

159159
# Set file permissions so web based build calls work. This must run after all web builds are done in tests.
160-
- chown -R www-data:www-data "${DOCROOT}/vendor/va-gov/web"
161-
- find "${DOCROOT}/vendor/va-gov/web" -type d -exec chmod 2775 {} \+
162-
- find "${DOCROOT}/vendor/va-gov/web" -type f -exec chmod 0664 {} \+
163-
- find "${DOCROOT}/vendor/va-gov/web/node_modules/.bin" -type f -exec chmod +x {} \+
164-
- find "${DOCROOT}/vendor/va-gov/web/script" -type f -exec chmod +x {} \+
160+
- chown -R www-data:www-data "${DOCROOT}/vendor/va-gov/content-build"
161+
- find "${DOCROOT}/vendor/va-gov/content-build" -type d -exec chmod 2775 {} \+
162+
- find "${DOCROOT}/vendor/va-gov/content-build" -type f -exec chmod 0664 {} \+
163+
- find "${DOCROOT}/vendor/va-gov/content-build/node_modules/.bin" -type f -exec chmod +x {} \+
164+
- find "${DOCROOT}/vendor/va-gov/content-build/script" -type f -exec chmod +x {} \+
165165

166166
memcache:
167167
image: tugboatqa/memcached:1.6

composer.json

+5-12
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
"symfony/finder": "^3",
151151
"symfony/phpunit-bridge": "^5.1",
152152
"traviscarden/behat-table-comparison": "~0.2",
153-
"va-gov/web": "^0.1",
153+
"va-gov/content-build": "^0.0.34",
154154
"vlucas/phpdotenv": "^5.3",
155155
"webflo/drupal-finder": "^1.0.0",
156156
"webmozart/path-util": "^2.3",
@@ -502,18 +502,11 @@
502502
"@va:web:watch"
503503
],
504504
"va:web:build": [
505-
"rm -rf docroot/vendor/va-gov/web/build/vagovdev",
506-
"cd web && echo \"Downloading assets for vets-website ref $(git rev-parse --verify HEAD)\" ",
507-
"cd web && NODE_ENV=production yarn build:content --pull-drupal --no-drupal-proxy --buildtype=vagovdev --api=https://dev-api.va.gov --asset-source=$(git rev-parse --verify HEAD)",
505+
"rm -rf docroot/vendor/va-gov/content-build/build/vagovdev",
506+
"cd docroot/vendor/va-gov/vets-website && echo \"Downloading assets for vets-website for vagovdev\" ",
507+
"cd web && INSTALL_HOOKS=no NODE_ENV=production yarn build --pull-drupal --no-drupal-proxy --buildtype=vagovdev --api=https://dev-api.va.gov",
508508
"echo 'Replace s3 address with local in generated files'",
509-
"find ./docroot/vendor/va-gov/web/build/vagovdev/generated -type f -exec sed -i \"s#https://dev-va-gov-assets\\.s3-us-gov-west-1\\.amazonaws\\.com##g\" {} \\+"
510-
],
511-
"va:web:build:full": [
512-
"rm -rf docroot/vendor/va-gov/web/build/vagovdev",
513-
"cd web && echo \"Building assets for vets-website ref $(git rev-parse --verify HEAD)\" ",
514-
"cd web && NODE_ENV=production yarn build --pull-drupal --no-drupal-proxy --buildtype=vagovdev --api=https://dev-api.va.gov --force-content-build",
515-
"echo 'Replace s3 address with local in generated files'",
516-
"find ./docroot/vendor/va-gov/web/build/vagovdev/generated -type f -exec sed -i \"s#https://dev-va-gov-assets\\.s3-us-gov-west-1\\.amazonaws\\.com##g\" {} \\+"
509+
"find ./docroot/vendor/va-gov/content-build/build/vagovdev/generated -type f -exec sed -i \"s#https://dev-va-gov-assets\\.s3-us-gov-west-1\\.amazonaws\\.com##g\" {} \\+"
517510
],
518511
"va:web:test": [
519512
"echo 'drupal address: ' $DRUPAL_ADDRESS"

composer.lock

+13-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docroot/modules/custom/va_gov_build_trigger/src/Controller/FrontEndBranchAutocompleteController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct(GithubInterface $githubClient, GitInterface $git, Lo
5454
public static function create(ContainerInterface $container) {
5555
return new static(
5656
$container->get('va_gov.consumers.github.factory')->get(
57-
'department-of-veterans-affairs/vets-website',
57+
'department-of-veterans-affairs/content-build',
5858
'va_cms_bot_github_auth_token'
5959
),
6060
Git::get($container->get('va_gov.build_trigger.web_build_command_builder')->getPathToWebRoot()),

docroot/modules/custom/va_gov_build_trigger/src/WebBuildCommandBuilder.php

+10-19
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ public function buildCommands(string $front_end_git_ref = NULL, string $unique_k
6565
$repo_root = $this->getPathToWebRoot();
6666

6767
if (!$front_end_git_ref) {
68-
// If no git reference is passed, reset va-gov/web to the default tag. We
69-
// do this to ensure that the default tag is used even if a branch or PR
70-
// was checked out earlier.
68+
// If no git reference is passed, reset va-gov/content-build
69+
// to the default tag. We do this to ensure that the default tag is used
70+
// even if a branch or PR was checked out earlier.
7171
$commands += $this->getFrontEndReinstallCommands($repo_root);
7272
}
7373
else {
74-
// If we are checking out a branch or PR, reset all files in va-gov/web
75-
// to their default state. We do this to avoid having the checkout fail
76-
// if there are modified files.
74+
// If we are checking out a branch or PR, reset all files in
75+
// va-gov/content-build to their default state. We do this to avoid
76+
// having the checkout fail if there are modified files.
7777
$commands[] = $this->getFrontEndResetCommand($repo_root);
7878
}
7979

@@ -98,20 +98,11 @@ public function buildComposerCommand(string $composer_command) : string {
9898
/**
9999
* The name of the composer command to run.
100100
*
101-
* @param string|null $front_end_git_ref
102-
* Front end git reference to build (branch name or PR number)
103-
*
104101
* @return string
105102
* The name of the composer command to run
106103
*/
107-
protected function commandName(string $front_end_git_ref = NULL) : string {
108-
$command = 'va:web:build';
109-
110-
if ($front_end_git_ref) {
111-
$command .= ':full';
112-
}
113-
114-
return $command;
104+
protected function commandName() : string {
105+
return 'va:web:build';
115106
}
116107

117108
/**
@@ -158,13 +149,13 @@ protected function getFrontEndReinstallCommands(string $repo_root) : array {
158149
}
159150

160151
/**
161-
* Build the command to reset va-gov/web files to their default state.
152+
* Build a command to reset va-gov/content-build files to their default state.
162153
*
163154
* @param string $repo_root
164155
* The path to the repository root.
165156
*
166157
* @return string
167-
* The command to run to reset va-gov/web files.
158+
* The command to run to reset va-gov/content-build files.
168159
*/
169160
protected function getFrontEndResetCommand(string $repo_root) : string {
170161
return "cd {$repo_root} && git reset --hard HEAD";

docroot/sites/default/settings/settings.dev.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
include dirname(__FILE__) . '/settings.brd_common.php';
66

7-
$settings['jenkins_build_job_path'] = '/job/builds/job/vets-website-content-vagov' . $settings['jenkins_build_env'];
7+
$settings['jenkins_build_job_path'] = '/job/builds/job/content-build-content-only-vagov' . $settings['jenkins_build_env'];
88
$settings['jenkins_build_job_params'] = '/buildWithParameters?deploy=true';
99
$settings['jenkins_build_job_url'] = $settings['jenkins_build_job_host'] . $settings['jenkins_build_job_path'] . $settings['jenkins_build_job_params'];
1010

docroot/sites/default/settings/settings.prod.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
include dirname(__FILE__) . '/settings.brd_common.php';
66

7-
$settings['jenkins_build_job_path'] = '/job/deploys/job/vets-gov-autodeploy-vets-website';
7+
$settings['jenkins_build_job_path'] = '/job/deploys/job/vets-gov-autodeploy-content-build';
88
$settings['jenkins_build_job_params'] = '/buildWithParameters?' . 'release_wait=0' . '&' . 'use_latest_release=true';
99
$settings['jenkins_build_job_url'] = $settings['jenkins_build_job_host'] . $settings['jenkins_build_job_path'] . $settings['jenkins_build_job_params'];
1010

docroot/sites/default/settings/settings.staging.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
include dirname(__FILE__) . '/settings.brd_common.php';
66

7-
$settings['jenkins_build_job_path'] = '/job/builds/job/vets-website-content-vagov' . $settings['jenkins_build_env'];
7+
$settings['jenkins_build_job_path'] = '/job/builds/job/content-build-content-only-vagov' . $settings['jenkins_build_env'];
88
$settings['jenkins_build_job_params'] = '/buildWithParameters?deploy=true';
99
$settings['jenkins_build_job_url'] = $settings['jenkins_build_job_host'] . $settings['jenkins_build_job_path'] . $settings['jenkins_build_job_params'];
1010

docroot/static

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
vendor/va-gov/web/build/vagovdev
1+
vendor/va-gov/content-build/build/vagovdev

tests/phpunit/FrontendBuild/WebBuildCommandBuilderTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function testBuildCommandsGraphQl() {
7272
);
7373

7474
self::assertEquals(
75-
"cd /app/root && COMPOSER_HOME=/composer/home /composer/file/here --no-cache va:web:build:full",
75+
"cd /app/root && COMPOSER_HOME=/composer/home /composer/file/here --no-cache va:web:build",
7676
$commands[3],
7777
'Web Command Build with commit and GraphQL composer command'
7878
);
@@ -98,7 +98,7 @@ public function testBuildCommandsGraphQl() {
9898
);
9999

100100
self::assertEquals(
101-
"cd /app/root && COMPOSER_HOME=/composer/home /composer/file/here --no-cache va:web:build:full",
101+
"cd /app/root && COMPOSER_HOME=/composer/home /composer/file/here --no-cache va:web:build",
102102
$commands[3],
103103
'Web command build with branch and GraphQL composer command'
104104
);

web

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
docroot/vendor/va-gov/web/
1+
docroot/vendor/va-gov/content-build

0 commit comments

Comments
 (0)