Skip to content

Commit

Permalink
Merge pull request #350 from jhu-idc/move_to_scripts
Browse files Browse the repository at this point in the history
Move to scripts
  • Loading branch information
DonRichards authored Nov 23, 2022
2 parents 9900abc + 18a5898 commit cb0e20e
Show file tree
Hide file tree
Showing 25 changed files with 394 additions and 223 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/.git*
53 changes: 3 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,61 +28,14 @@ jobs:
run: |
echo '{"experimental": "enabled"}' > ~/.docker/config.json
# Temp fix for 9.4 switch to working tag
- name: Temp fix for 9.4 switch to working tag
run: git fetch --all --tags && git checkout cf17931c2bc5f8562ff8d26a7e642b3ca49cb92c codebase/

# Temp fix for 9.4 copy incremental_version_updater.sh to codebase
- name: Temp fix for 9.4 copy incremental_version_updater.sh to codebase
run: cp scripts/incremental_version_updater.sh codebase/incremental_version_updater.sh
# Build and Export image for push to github container registry
- name: Build and export drupal image
run: make static-drupal-image-export

# Build and run the static environment
- name: Build Static
run: make static-docker-compose.yml up

# Temp fix for 9.4 Add github token to composer
- name: Temp fix for 9.4 Add github token to composer
run: docker-compose exec -T drupal with-contenv bash -lc "composer config -g github-oauth.github.com ${{ secrets.GH_TOKEN }}"

# Temp fix for 9.4 run incremental_version_updater.sh
- name: Temp fix for 9.4 run incremental_version_updater.sh
run: docker-compose exec -T drupal bash -lc "cd /var/www/drupal && bash /var/www/drupal/incremental_version_updater.sh ${{ secrets.GH_TOKEN }}"

# Temp fix for 9.4 remove incremental_version_updater.sh in codebase
- name: Temp fix for 9.4 remove incremental_version_updater.sh in codebase
run: rm -f codebase/incremental_version_updater.sh

# Temp fix for 9.4 reset file permissions of codebase
- name: Temp fix for 9.4 reset file permissions of codebase
run: make set-codebase-owner

# Temp fix for 9.4 reset codebase
- name: Temp fix for 9.4 reset codebase
run: git checkout codebase/

# Temp fix for 9.4 run composer install
- name: Temp fix for 9.4 run composer install
run: make composer-install

# Run fix_permissions Script
- name: Run fix_permissions Script
run: docker-compose exec -T drupal bash /var/www/drupal/fix_permissions.sh /var/www/drupal/web nginx

# Run the updatedb command.
- name: Run Update Hooks
run: docker-compose exec -T drupal drush updatedb -y

# Rebuild the theme cache
- name: Rebuild Theme Cache
run: docker-compose exec -T drupal drush cc theme-registry

# Drush tests
- name: Drush test
run: docker-compose exec -T drupal drush -d status

- name: Export image
run: make static-drupal-image-export

- uses: actions/upload-artifact@v2
with:
name: drupal-image
Expand Down
17 changes: 14 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# syntax=docker/dockerfile:experimental
# Dockerfile for drupal-static build

ARG REPOSITORY
ARG TAG
FROM ${REPOSITORY}/drupal:${TAG}

RUN --mount=type=bind,source=codebase,target=/build \
cp -r /build/* /var/www/drupal && \
bash /var/www/drupal/fix_permissions.sh /var/www/drupal/web nginx
USER nginx

# Run composer install as application user:
# Normal startup (via /init) must also happen as root
USER root
COPY --chown=nginx:www-data codebase /var/www/drupal/
COPY --chown=0:0 rootfs /

RUN COMPOSER_MEMORY_LIMIT=-1 COMPOSER_DISCARD_CHANGES=true composer install --no-interaction --no-progress && \
chmod 0750 /var/www/drupal/fix_permissions.sh && \
/var/www/drupal/fix_permissions.sh /var/www/drupal/web nginx

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ remove_standard_profile_references_from_config:
.PHONY: config-export
.SILENT: config-export
config-export:
docker-compose exec drupal bash -lc "bash /var/www/drupal/fix_permissions.sh /var/www/drupal/web nginx"
$(MAKE) set-codebase-owner
-rm -rf ./codebase/config/sync/*
git checkout $(CURDIR)/codebase/config/sync/
docker-compose exec drupal drush -l $(SITE) config:export -y
Expand Down
1 change: 1 addition & 0 deletions codebase/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"composer/installers": "^1.2",
"cweagans/composer-patches": "^1.6.5",
"drupal/admin_toolbar": "^2.0",
"drupal/at_tool": "^2.0",
"drupal/auto_entitylabel": "^3.0@beta",
"drupal/captcha": "^1.1",
"drupal/console": "~1.0",
Expand Down
97 changes: 96 additions & 1 deletion codebase/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 7 additions & 17 deletions codebase/config/sync/block.block.contactblock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,18 @@ settings:
provider: contact_block
contact_form: collection_contact
visibility:
view_inclusion:
id: view_inclusion
negate: false
context_mapping: { }
view_inclusion: { }
request_path_exclusion:
id: request_path_exclusion
negate: true
context_mapping: { }
pages: ''
media_source_mimetype:
id: media_source_mimetype
mimetype: ''
negate: false
context_mapping: { }
'entity_bundle:node':
id: 'entity_bundle:node'
negate: false
context_mapping:
node: '@node.node_route_context:node'
bundles:
collection_object: collection_object
context_all:
id: context_all
negate: null
Expand All @@ -58,10 +55,3 @@ visibility:
own_page_true: '0'
field_value: '0'
user_fields: uid
'entity_bundle:node':
id: 'entity_bundle:node'
negate: false
context_mapping:
node: '@node.node_route_context:node'
bundles:
collection_object: collection_object
24 changes: 7 additions & 17 deletions codebase/config/sync/block.block.contactblock_2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,18 @@ settings:
provider: contact_block
contact_form: repository_item_contact
visibility:
view_inclusion:
id: view_inclusion
negate: false
context_mapping: { }
view_inclusion: { }
request_path_exclusion:
id: request_path_exclusion
negate: true
context_mapping: { }
pages: ''
media_source_mimetype:
id: media_source_mimetype
mimetype: ''
negate: false
context_mapping: { }
'entity_bundle:node':
id: 'entity_bundle:node'
negate: false
context_mapping:
node: '@node.node_route_context:node'
bundles:
islandora_object: islandora_object
context_all:
id: context_all
negate: null
Expand All @@ -58,10 +55,3 @@ visibility:
own_page_true: '0'
field_value: '0'
user_fields: uid
'entity_bundle:node':
id: 'entity_bundle:node'
negate: false
context_mapping:
node: '@node.node_route_context:node'
bundles:
islandora_object: islandora_object
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,24 @@ content:
weight: 0
region: content
display_media_entity_view_1:
weight: 10
settings: { }
third_party_settings: { }
weight: 10
region: content
display_media_entity_view_2:
weight: 10
settings: { }
third_party_settings: { }
weight: 10
region: content
display_media_service_file:
weight: 10
settings: { }
third_party_settings: { }
weight: 10
region: content
display_media_thumbnail:
weight: 10
settings: { }
third_party_settings: { }
weight: 10
region: content
field_image:
type: image
Expand All @@ -72,34 +72,34 @@ content:
weight: 100
region: content
openseadragon_media_evas_entity_view_1:
weight: 10
settings: { }
third_party_settings: { }
weight: 10
region: content
openseadragon_media_evas_entity_view_2:
weight: 10
settings: { }
third_party_settings: { }
weight: 10
region: content
openseadragon_media_evas_service_file:
weight: 10
settings: { }
third_party_settings: { }
weight: 10
region: content
pdfjs_media_evas_entity_view_1:
weight: 10
settings: { }
third_party_settings: { }
weight: 10
region: content
pdfjs_media_evas_entity_view_2:
weight: 10
settings: { }
third_party_settings: { }
weight: 10
region: content
pdfjs_media_evas_service_file:
weight: 10
settings: { }
third_party_settings: { }
weight: 10
region: content
hidden:
comment: true
Expand Down
Loading

0 comments on commit cb0e20e

Please sign in to comment.