-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
106 lines (106 loc) · 4.43 KB
/
action.yml
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
name: 'Setup Tripal'
description: 'Setup a basic Tripal site.'
inputs:
postgres_user:
description: The user for your postgresql service.
required: true
postgres_pass:
description: The password for your postgresql user.
required: true
postgres_db:
description: The name of the database to install Tripal in.
required: true
account_name:
description: The name of the administrative user for your Drupal/Tripal site.
required: true
default: tripaladmin
account_pass:
description: The password for your Drupal/Tripal administrative user.
required: true
default: somereallysecurepassword
tripal_version:
description: The version of Tripal to download.
required: true
default: 7.x-3.4
outputs:
drush_path:
description: "The Path to the Drush Executable."
value: ${{ steps.drush.outputs.path }}
drupal_root:
description: "The Path to the Drupal installation."
value: ${{ steps.drupal.outputs.path }}
runs:
using: "composite"
steps:
# Install Drush 8.x globally
# NOTE: `drush` is not available without the full path.
# I tried adding it to the path but that broke other things.
- name: Install Drush
id: drush
shell: bash
run: |
composer global require "drush/drush:~8" --quiet
/home/runner/.composer/vendor/bin/drush --version
git config --global advice.detachedHead false
echo "::set-output name=path::/home/runner/.composer/vendor/bin/drush"
# Install Drupal and Drupal module dependencies for Tripal.
# It also patches Drupal.
- name: Install Drupal
id: drupal
shell: bash
env:
DRUSH: ${{ steps.drush.outputs.path }}
DRUPAL_ROOT: "/home/runner/work/drupal"
POSTGRES_CONNECTION_STRING: pgsql://${{ inputs.postgres_user }}:${{ inputs.postgres_pass }}@localhost:5432/${{ inputs.postgres_db }}
ACCOUNT_NAME: ${{ inputs.account_name }}
ACCOUNT_PASS: ${{ inputs.account_pass }}
run: |
echo "::set-output name=path::$DRUPAL_ROOT"
echo "==> Downloading Drupal"
cd /home/runner/work
$DRUSH dl drupal-7 -y
mv drupal-7* drupal
echo "==> Installing Drupal"
cd $DRUPAL_ROOT
$DRUSH si -y --root=$DRUPAL_ROOT \
--db-url=$POSTGRES_CONNECTION_STRING \
--account-name=$ACCOUNT_NAME \
--account-pass=$ACCOUNT_PASS \
--site-name=Tripal3
echo "==> Downloading dependencies"
$DRUSH dl -y --quiet views ctools entity redirect date ds field_group field_group_table
echo "==> Enabling Dependencies"
$DRUSH en -y --quiet views ctools entity redirect date ds field_group field_group_table
echo "==> Apply Drupal Patch"
cd $DRUPAL_ROOT
wget --no-check-certificate https://www.drupal.org/files/drupal.pgsql-bytea.27.patch
patch -p1 < drupal.pgsql-bytea.27.patch
wget --no-check-certificate https://www.drupal.org/files/issues/2022-06-20/3284424-7.patch
patch -p1 < 3284424-7.patch
# Install Tripal, Chado and prepares the Drupal/Chado databases
# Also patches views.
- name: Install Tripal
id: tripal
shell: bash
env:
DRUSH: ${{ steps.drush.outputs.path }}
DRUPAL_ROOT: ${{ steps.drupal.outputs.path }}
ACCOUNT_NAME: ${{ inputs.account_name }}
ACCOUNT_PASS: ${{ inputs.account_pass }}
run: |
echo "==> Download Tripal"
cd $DRUPAL_ROOT/sites/all/modules
git clone https://github.com/tripal/tripal.git --quiet --depth 1 --branch ${{ inputs.tripal_version }}
echo "==> Apply Views Patch"
cd $DRUPAL_ROOT/sites/all/modules/views
patch --quiet -p1 < ../tripal/tripal_chado_views/views-sql-compliant-three-tier-naming-1971160-30.patch
echo "==> Install Tripal"
cd $DRUPAL_ROOT
$DRUSH en -y --quiet tripal tripal_chado tripal_chado_views tripal_ws tripal_ds
echo "==> Install Chado"
$DRUSH eval "module_load_include('inc', 'tripal_chado', 'includes/tripal_chado.install'); tripal_chado_load_drush_submit('Install Chado v1.3');"
$DRUSH trp-run-jobs --quiet --username=$ACCOUNT_NAME
echo "==> Prepare Chado"
$DRUSH eval "module_load_include('inc', 'tripal_chado', 'includes/setup/tripal_chado.setup'); tripal_chado_prepare_drush_submit();"
$DRUSH trp-run-jobs --quiet --username=$ACCOUNT_NAME