-
Notifications
You must be signed in to change notification settings - Fork 20
/
.probo.yaml
153 lines (153 loc) · 9.94 KB
/
.probo.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
image: proboci/ubuntu:22.04-php8.3
assets:
- test-credentials.sh
- migration.settings.php
- migration.sh
- terminus.sh
steps:
- name: Build Arizona Quickstart
plugin: Script
script:
- composer self-update
- if [ $(git ls-remote --heads https://github.com/az-digital/az-quickstart-scaffolding.git $BRANCH_NAME | wc -l) = 1 ]; then SCAFFOLD_BRANCH="$BRANCH_NAME"; else SCAFFOLD_BRANCH=main; fi
- if [ $(git ls-remote --heads https://github.com/az-digital/az-quickstart-dev.git $BRANCH_NAME | wc -l) = 1 ]; then DEV_PACKAGE_BRANCH="$BRANCH_NAME"; else DEV_PACKAGE_BRANCH=main; fi
- git clone --branch $SCAFFOLD_BRANCH https://github.com/az-digital/az-quickstart-scaffolding.git
- cd az-quickstart-scaffolding
- composer config repositories.az_quickstart vcs https://github.com/az-digital/az_quickstart.git
- composer config use-github-api false
- composer require --no-update az-digital/az_quickstart:dev-${BRANCH_NAME}
- composer require --no-update --dev az-digital/az-quickstart-dev:dev-${DEV_PACKAGE_BRANCH}
- composer install -o
- name: Run PHP_CodeSniffer coding standards checks
plugin: Shell
command: 'cd $SRC_DIR/az-quickstart-scaffolding ; ./vendor/bin/phpcs -sp --colors web/profiles/custom/az_quickstart'
- name: Run PHPStan code quality checks
plugin: Script
script:
- cd $SRC_DIR/az-quickstart-scaffolding
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/phpstan analyse --configuration web/profiles/custom/az_quickstart/phpstan.neon web/profiles/custom/az_quickstart
- name: Run ESLint
plugin: Script
script:
- sudo npm cache clean -f --silent --no-progress
- sudo npm install -g --no-progress yarn
- sudo npm install -g --no-progress n
- sudo n 20.13.0
- cd $SRC_DIR/az-quickstart-scaffolding/web/profiles/custom/az_quickstart
- yarn install
- yarn run eslint --color .
- name: Setup drush
plugin: Shell
command: 'ln -s $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush /usr/local/bin/drush'
- name: Install Arizona Quickstart
plugin: Drupal
drupalVersion: 10
subDirectory: az-quickstart-scaffolding/web
runInstall: true
profileName: az_quickstart
installArgs: "--site-name='Quickstart Review' --account-name=azadmin --account-pass=azadmin2024 --verbose --yes -n"
- name: Post-Installation Steps
plugin: Script
script:
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush -y -n pm:install az_demo
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush user:create azcontenteditor --password="azcontenteditor2024"
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush user:role:add az_content_editor azcontenteditor
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush user:create azcontentadmin --password="azcontentadmin2024"
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush user:role:add az_content_editor azcontentadmin
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush user:role:add az_content_admin azcontentadmin
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush user:create azuseradmin --password="azuseradmin2024"
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush user:role:add az_content_editor azuseradmin
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush user:role:add az_content_admin azuseradmin
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush user:role:add az_user_admin azuseradmin
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush user:create azhtmladmin --password="azhtmladmin2024"
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush user:role:add az_content_editor azhtmladmin
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush user:role:add az_content_admin azhtmladmin
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush user:role:add az_html_admin azhtmladmin
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush config:set -y az_cas.settings disable_login_form 0
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush config:set -y system.logging error_level "verbose"
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush cache:rebuild
- chown www-data:www-data -R /var/www/html/sites/default/files
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush -y -n pm:install environment_indicator
- chmod 777 /var/www/html/sites/default/settings.php
- echo -e "\$config['environment_indicator.indicator']['name'] = '$BRANCH_NAME (ProboCI)';\n\$config['environment_indicator.indicator']['bg_color'] = '#440027';" >> /var/www/html/sites/default/settings.php
- chmod 444 /var/www/html/sites/default/settings.php
- name: Check for PHP errors and notices
plugin: Script
script:
# Load some known demo URL paths
- curl -sS -o /dev/null http://localhost
- curl -sS -o /dev/null http://localhost/user
- curl -sS -o /dev/null http://localhost/people
- curl -sS -o /dev/null http://localhost/people-list
- curl -sS -o /dev/null http://localhost/pages/text
- curl -sS -o /dev/null http://localhost/pages/text-background
- curl -sS -o /dev/null http://localhost/pages/text-media
- curl -sS -o /dev/null http://localhost/pages/card-decks
- curl -sS -o /dev/null http://localhost/pages/accordions
- curl -sS -o /dev/null http://localhost/pages/photo-galleries
- curl -sS -o /dev/null http://localhost/page-grid
- curl -sS -o /dev/null http://localhost/page-list
- curl -sS -o /dev/null http://localhost/news
- curl -sS -o /dev/null http://localhost/calendar
- curl -sS -o /dev/null http://localhost/pages/annual-events
# Check for PHP watchdog entries
- if [ -z "$($SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush -n watchdog:show --count=100 --type=php)" ]; then echo "No PHP notices/errors logged."; else echo "PHP notices/errors found in log." >&2 && exit 1; fi
- name: Generate upgrade status report
plugin: Script
script:
# Enable upgrade_status module
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush -y -n pm:install upgrade_status
# Run report
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush upgrade_status:analyze az_quickstart
# Make upgrade_status folder in tmp directory accessible by www-data
- chown -R www-data:www-data /tmp/upgrade_status
- name: Run PHPUnit Tests
plugin: Script
script:
- mkdir -p /var/www/html/sites/simpletest
- chown www-data:www-data -R /var/www/html/sites/simpletest
- mkdir -p /var/www/html/sites/default/files/simpletest
- chown www-data:www-data -R /var/www/html/sites/default/files/simpletest
- sudo CHROMEDRIVER_VERSION=LATEST_$(/usr/bin/google-chrome --product-version | cut -d . -f 1-3) npm install --no-progress --unsafe-perm --global chromedriver
- sudo apt-get install daemonize
- source $ASSET_DIR/test-credentials.sh
- export SIMPLETEST_BASE_URL="http://localhost"
- export SIMPLETEST_DB="mysql://${TEST_DATABASE_USER}:${TEST_DATABASE_PASS}@localhost/${TEST_DATABASE_NAME}"
- export MINK_DRIVER_ARGS_WEBDRIVER='["chrome", {"browserName":"chrome","goog:chromeOptions":{"args":["--disable-gpu","--disable-dev-shm-usage","--headless","--no-sandbox"]}}, "http://localhost:9515"]'
- daemonize /usr/local/bin/chromedriver --log-path=/tmp/chromedriver.log --verbose --whitelisted-ips="127.0.0.1"
- cd /var/www/html/profiles/custom/az_quickstart
- export RUN_TESTS_CONCURRENCY=10
- mysqladmin create ${TEST_DATABASE_NAME}
- sudo -u www-data -E find $SRC_DIR/az-quickstart-scaffolding/web/profiles/custom/az_quickstart/ -name "*Test.php" | sudo -u www-data -E $SRC_DIR/az-quickstart-scaffolding/vendor/bin/fastest -p 10 -vvv "$SRC_DIR/az-quickstart-scaffolding/vendor/bin/phpunit {} --colors="always" --verbose --do-not-cache-result;"
- name: Install Terminus
plugin: Script
script:
- mkdir -p ~/terminus && cd ~/terminus
- curl -L https://github.com/pantheon-systems/terminus/releases/download/3.4.0/terminus.phar --output terminus
- chmod +x terminus
- ./terminus self:update
- ln -sf ~/terminus/terminus /usr/local/bin/terminus
- name: Log in to Terminus
command: 'source ${ASSET_DIR}/terminus.sh; terminus auth:login --machine-token=${TERMINUS_TOKEN}'
- name: Migration Tests
plugin: Script
script:
- set -e
- source ${ASSET_DIR}/migration.sh
- terminus connection:info ${MIGRATION_SOURCE_SITE_NAME}.dev --fields 'mysql_host,mysql_password,mysql_port,mysql_database,mysql_username' --format=json > /tmp/migration_config.json
- mkdir -p /var/www/html/sites/migration && cd /var/www/html/sites
- cp example.sites.php sites.php
- echo "\$sites['$BUILD_ID--site-migration.probo.build'] = 'migration';" >> sites.php
- cp ${ASSET_DIR}/migration.settings.php migration/settings.php
- cd migration
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush site:install az_quickstart --site-name='Quickstart Migration' --account-name=azadmin --account-pass=azadmin --verbose --yes -n
- chown www-data:www-data -R /var/www/html/sites/migration/files
- terminus env:wake ${MIGRATION_SOURCE_SITE_NAME}.dev
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush -y install az_migration
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush -y install az_paragraphs_html
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush -y cset az_migration.settings migrate_d7_protocol "https"
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush -y cset az_migration.settings migrate_d7_filebasepath "dev-${MIGRATION_SOURCE_SITE_NAME}.pantheonsite.io/"
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush -y cset az_migration.settings migrate_d7_public_path "sites/default/files"
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush -y cset az_cas.settings disable_login_form 0
- $SRC_DIR/az-quickstart-scaffolding/vendor/bin/drush mim --group=az_migration
- echo "https://${BUILD_ID}--site-migration.probo.build/"