-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-project.sh
executable file
·83 lines (74 loc) · 3.88 KB
/
build-project.sh
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
#!/bin/bash
set -e
## changes ownership of the current directory to the current $USER
if [ -n "$TRAVIS" ]; then
sudo chown -R $USER ~/
fi
## Downloads the drupal-composer/drupal-project as a zip file and unzips it.
curl -o drupal.zip https://codeload.github.com/drupal-composer/drupal-project/zip/8.x
unzip drupal.zip
rm drupal.zip
mv drupal-project-8.x drupal
## Modify original composer.json file from above project.
php build-composer-file.php
## Replace all occurrences of "web" with "docroot" in the .gitignore file.
sed -i 's/web/docroot/' drupal/.gitignore
## Add packages to composer.json file for this project.
composer require "behat/mink-selenium2-driver:1.4.x-dev as 1.3.x-dev" --dev --working-dir=drupal --no-update
composer require "drupal/drupal-extension:^4.0@beta" --dev --working-dir=drupal --no-update
composer require "guzzlehttp/guzzle:^6.0@dev" --dev --working-dir=drupal --no-update
composer require "phpunit/phpunit:>=4.8.24" --dev --working-dir=drupal --no-update
composer require "roave/security-advisories:dev-master" --dev --working-dir=drupal --no-update
composer require "vanare/behat-cucumber-json-formatter:~1.1.1" --dev --working-dir=drupal --no-update
composer require "php:>=7.2" --working-dir=drupal --no-update
composer require "drupal/config_split:^1.4" --working-dir=drupal --no-update
composer require "drupal/ctools:^3.2" --working-dir=drupal --no-update
composer require "drupal/devel:~2.0" --working-dir=drupal --no-update
composer require "drupal/diff:^1.0@RC" --working-dir=drupal --no-update
composer require "drupal/environment_indicator:^3.6" --working-dir=drupal --no-update
composer require "drupal/module_filter:^3.1" --working-dir=drupal --no-update
composer require "drupal/paragraphs:^1.5" --working-dir=drupal --no-update
composer require "drupal/pathauto:^1.3" --working-dir=drupal --no-update
composer require "drupal/redirect:^1.3" --working-dir=drupal --no-update
composer require "drupal/styleguide:^1.0@alpha" --working-dir=drupal --no-update
composer require "mglaman/drupal-check" --dev --working-dir=drupal --no-update
composer require "genesis/behat-fail-aid:^2.1" --dev --working-dir=drupal --no-update
## Copy the README.md to the drupal directory
cp docs/README.md drupal/README.md
## Get the .env.example file.
cp docs/.env.example drupal/.env.example
## Start creating repo commit
## Downloads the codementality/drupal-project-docker as a zipfile and unzips it.
curl -o develop.zip https://codeload.github.com/codementality/drupal-project-docker/zip/develop
unzip develop.zip
rm develop.zip
mv drupal-project-docker-develop/docker drupal/docker
mv drupal-project-docker-develop/tests drupal/tests
mv drupal-project-docker-develop/Makefile drupal/Makefile
mv drupal-project-docker-develop/docker-compose.yml drupal/docker-compose.yml
mv drupal-project-docker-develop/docker-compose-travis.yml drupal/docker-compose-travis.yml
mv drupal-project-docker-develop/drupal drupal/drupal
mv drupal-project-docker-develop/config drupal/config
mv drupal-project-docker-develop/.travis.yml drupal/.travis.yml
rm -Rf drupal/drush
mv drupal-project-docker-develop/drush drupal/drush
rm -Rf drupal-project-docker-develop
## Create directory structure for custom code
mkdir -p drupal/docroot/modules/custom
touch drupal/docroot/modules/custom/.gitkeep
mkdir -p drupal/docroot/themes/custom
touch drupal/docroot/themes/custom/.gitkeep
mkdir -p drupal/docroot/profiles/custom
touch drupal/docroot/profiles/custom/.gitkeep
cd drupal
git init
## set user name and email
git config user.email "[email protected]"
git config user.name "Lisa Ridley"
git add .
git commit -m 'Build Commit from Travis Build'
git checkout -b 8.x
git remote add origin https://github.com/codementality/drupal-project.git
if [ -n "$GITHUB_API_KEY" ] && [ "$TRAVIS_BRANCH" = "develop" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
git push -f -q https://$GITHUB_USER:[email protected]/codementality/drupal-project 8.x
fi