Skip to content

Commit

Permalink
2.x (#190)
Browse files Browse the repository at this point in the history
* 2.x: Using the right conditions to build binaries

* 2.x: Update RELEASE file

* 2.x: Fixed how the tags are identified to run a new build

* 2.x: Fixed tarballs, mising lib folder

* Updated install.sh scrip to get the latest version per branch. Fixed some localgov templates (#189)

* 2.x: Fixed some bits about localgov

* 2.x: Getting the latest release available per branch

---------

Co-authored-by: Dionisio Fernandez <[email protected]>
  • Loading branch information
gregharvey and DionisioFG authored Dec 3, 2024
1 parent 08294f0 commit 79f5ead
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 77 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ubuntu-build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: '2.x: Ubuntu - Build and push ce-dev and ce-dev-controller images'

# Run this workflow only on a push/merged PR to branch 1.x with valid tags
on:
push:
branches:
- 2.x
tags:
- 2.[0-9]+.[0-9]+
workflow_dispatch:
tags:
- 2.[0-9]+.[0-9]+

jobs:
build:
Expand Down
11 changes: 7 additions & 4 deletions RELEASE
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
2.0
2.0.0

## Changes since 1.24
## Changes since 1.2.4

* Docker images using Bookworm-slim
* Use of latest Typescript version (5.3.x)
* Docker images based on Bookworm-slim
* Docker image MariaDB used as database.
* Docker image codeenigma/ce-dev:2.x image used web image
* No more use of different predefined drupalX-web images, we rely on 'ce-dev provision'.
* Use of latest Typescript version (5.x.x)
* Binaries built with Emacs instead of Commonjs: Emacs can consume Commonjs modules,
but Commonjs can't consume Emacs modules. It means we can use more contrib modules
* src folder has been organised a bit better.
Expand Down
10 changes: 9 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@ fi

# Version is optional.
if [ -z "$VERSION" ]; then
VERSION=$( curl --silent "https://api.github.com/repos/codeenigma/ce-dev/releases/latest" | grep tag_name | cut -d \" -f 4)
API_URL="https://api.github.com/repos/codeenigma/ce-dev/releases"
VERSION=$(curl -s $API_URL | grep -Eo '"tag_name":\s*"2\.[^"]*"' | grep -Eo '2\.[^"]*' | sort -Vr | head -n 1)

# Check if we found a release
if [ -n "$VERSION" ]; then
echo "Downloading the latest 2.x version: $VERSION"
else
echo "No 2.x release found"
fi
fi

RELEASE=https://github.com/codeenigma/ce-dev/releases/download/$VERSION/ce-dev-v$VERSION-$PLATFORM-x64.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"lint": "eslint . --ext .ts",
"postpack": "shx rm -f oclif.manifest.json",
"posttest": "yarn lint",
"prepack": "oclif manifest && oclif readme",
"prepack": "shx rm -rf lib && tsc -b && oclif manifest && oclif readme",
"version": "oclif readme && git add README.md",
"renamedist": "renamer --chain renamedist.js dist/*"
},
Expand Down
2 changes: 1 addition & 1 deletion templates/drupal10/ce-dev/ansible/deploy.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# You can safely remove these steps once you have a working composer.json.
- name: Download composer file.
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/drupal/recommended-project/10.1.x/composer.json
url: https://raw.githubusercontent.com/drupal/recommended-project/10.3.x/composer.json
dest: "{{ deploy_path }}/composer.json"
force: false
- name: Install drush.
Expand Down
70 changes: 40 additions & 30 deletions templates/localgov/ce-dev/ansible/deploy.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,47 @@
# Template playbook for a local Drupal9 codebase.
- hosts: {{ project_name }}-web
vars:
- project_name: {{ project_name }}
- project_type: drupal8
- webroot: web
- build_type: local
- _env_type: dev
project_name: {{ project_name }}
project_type: drupal8
webroot: web
build_type: local
_env_type: dev
{% raw %}
- _domain_name: www.{{ project_name }}.local
_domain_name: www.{{ project_name }}.local
# Path to your project root. This must match the "volume" set in the docker compose template.
- deploy_path: /home/ce-dev/deploy/live.local
deploy_path: /home/ce-dev/deploy/live.local
# This actually does not take any backup, but is needed to populate settings.php.
- mysql_backup:
handling: none
credentials_handling: static
mysql_backup:
handling: none
credentials_handling: static
# A list of Drupal sites (for multisites).
- drupal:
sites:
- folder: "default"
public_files: "sites/default/files"
install_command: "-y si localgov"
# Toggle config import on/off. Disabled for initial passes.
config_import_command: ""
# config_import_command: "cim"
config_sync_directory: "config/sync"
sanitize_command: "sql-sanitize"
# Remove after initial pass, to avoid reinstalling Drupal.
force_install: true
base_url: "https://{{ _domain_name }}"
drupal:
sites:
- folder: "default"
public_files: "sites/default/files"
install_command: "-y si localgov"
# Toggle config import on/off. Disabled for initial passes.
config_import_command: ""
# config_import_command: "cim"
config_sync_directory: "config/sync"
sanitize_command: "sql-sanitize"
# Remove after initial pass, to avoid reinstalling Drupal.
force_install: true
base_url: "https://{{ _domain_name }}"
# Composer command to run.
- composer:
command: install
no_dev: false
working_dir: "{{ deploy_path }}"
apcu_autoloader: false
composer:
command: install
no_dev: false
working_dir: "{{ deploy_path }}"
apcu_autoloader: false
drush:
use_vendor: true
drush_bin: "{{ deploy_path }}/vendor/drush/drush/drush"
pre_tasks:
# You can safely remove these steps once you have a working composer.json.
- name: Download composer file.
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/drupal/recommended-project/9.1.x/composer.json
url: https://raw.githubusercontent.com/drupal/recommended-project/10.3.x/composer.json
dest: "{{ deploy_path }}/composer.json"
force: false
- name: Adding composer/installers plugin to composer config.
Expand Down Expand Up @@ -70,13 +73,20 @@
- name: Install drush.
community.general.composer:
command: require
arguments: drush/drush:10.*
arguments: drush/drush:12.*
working_dir: "{{ deploy_path }}"
- name: Install localgov.
community.general.composer:
command: require
arguments: localgovdrupal/localgov
working_dir: "{{ deploy_path }}"
post_tasks:
- name: "Symlink global Drush"
ansible.builtin.file:
src: "{{ drush_bin }}"
dest: "/usr/local/bin/drush"
state: link
become: yes
roles:
- _init # Sets some variables the deploy scripts rely on.
- composer # Composer install step.
Expand Down
78 changes: 41 additions & 37 deletions templates/localgov/ce-dev/ansible/provision.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,47 +19,49 @@
ce_provision:
local_dir: /home/ce-dev/ce-provision
{% raw %}
- nginx:
domains:
- server_name: "{{ _domain_name }}"
access_log: "/var/log/nginx-access.log"
error_log: "/var/log/nginx-error.log"
error_log_level: "notice"
webroot: "/home/ce-dev/deploy/live.local/web"
project_type: "drupal8"
ssl:
domain: "{{ _domain_name }}"
cert: "{{ _ce_dev_mkcert_base}}/{{ _domain_name }}.pem"
key: "{{ _ce_dev_mkcert_base}}/{{ _domain_name }}-key.pem"
handling: "unmanaged"
ratelimitingcrawlers: false
is_default: true
servers:
- port: 80
ssl: false
https_redirect: true
- port: 443
ssl: true
https_redirect: false
upstreams: []
- php:
version:
- 8.1
cli:
memory_limit: -1
_env_type: dev
fpm:
_env_type: dev
- xdebug:
cli: true
- nodejs:
version: 20.x
- apt_unattended_upgrades:
enable: false
nginx:
domains:
- server_name: "{{ _domain_name }}"
access_log: "/var/log/nginx-access.log"
error_log: "/var/log/nginx-error.log"
error_log_level: "notice"
webroot: "/home/ce-dev/deploy/live.local/web"
project_type: "drupal8"
ssl:
domain: "{{ _domain_name }}"
cert: "{{ _ce_dev_mkcert_base}}/{{ _domain_name }}.pem"
key: "{{ _ce_dev_mkcert_base}}/{{ _domain_name }}-key.pem"
handling: "unmanaged"
ratelimitingcrawlers: false
is_default: true
servers:
- port: 80
ssl: false
https_redirect: true
- port: 443
ssl: true
https_redirect: false
upstreams: []
php:
version:
- 8.1
cli:
memory_limit: -1
_env_type: dev
fpm:
_env_type: dev
xdebug:
cli: true
nodejs:
version: 20.x
apt_unattended_upgrades:
enable: false
{% endraw %}
tasks:
- apt:
update_cache: true
- import_role:
name: _init
- import_role:
name: _meta/common_base
- import_role:
Expand All @@ -70,3 +72,5 @@
name: debian/php-fpm
- import_role:
name: debian/nginx
- import_role:
name: _exit
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require __DIR__ . '/default.settings.php';
/**
* Include local dev settings.
*/
require DRUPAL_ROOT . '/sites/example.settings.local.php'
require DRUPAL_ROOT . '/sites/example.settings.local.php';

$databases['default']['default'] = array (
'database' => '{{ build_databases[0].name }}',
Expand Down

0 comments on commit 79f5ead

Please sign in to comment.