Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2a39df4

Browse files
authoredJun 20, 2025··
Don't preinstall Blocks Cloner, allow installing concrete-cif (#80)
* Don't preinstall Blocks Cloner, allow installing concrete-cif * Test installing Blocks Cloner and concrete-cif * Ensure DB is started when installing Blocks Cloner * More system cleanup, fix concrete-cif launcher * Don't install openjdk recommendations
1 parent c410f51 commit 2a39df4

File tree

11 files changed

+78
-24
lines changed

11 files changed

+78
-24
lines changed
 

‎.github/workflows/build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ jobs:
182182
--build-arg CCM_C5_ARCHIVE=${{ matrix.data.c5_archive }} \
183183
--build-arg CCM_STARTING_POINT=${{ matrix.data.c5_startingpoint }} \
184184
--build-arg CCM_PATCH_ENVIRONMENT_ONLY=${{ matrix.data.patch_environment_only }} \
185-
--build-arg CCM_INSTALL_BLOCKS_CLONER=${{ matrix.data.install_blocks_cloner }} \
186185
--tag ghcr.io/concrete5-community/docker5:${{ matrix.data.image_tag }} \
187186
./installed
188187
for additional_tag in ${{ matrix.data.additional_tags }}; do
@@ -191,6 +190,14 @@ jobs:
191190
-
192191
name: Check that MariaDB works
193192
run: docker run --rm --entrypoint='' ghcr.io/concrete5-community/docker5:${{ matrix.data.image_tag }} ccm-service start db
193+
-
194+
name: Install Blocks Cloner
195+
if: needs.check_envoronment.outputs.action == 'build' && matrix.data.image_tag == '9.4.1'
196+
run: docker run --rm --entrypoint='' ghcr.io/concrete5-community/docker5:${{ matrix.data.image_tag }} ccm-install blocks_cloner
197+
-
198+
name: Install concrete-cif
199+
if: needs.check_envoronment.outputs.action == 'build' && matrix.data.image_tag == '9.4.1'
200+
run: docker run --rm --entrypoint='' ghcr.io/concrete5-community/docker5:${{ matrix.data.image_tag }} ccm-install concrete-cif
194201
-
195202
name: Remove base Docker image
196203
if: needs.check_envoronment.outputs.action == 'publish'

‎.github/workflows/generate-matrix

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ readonly class Version
121121

122122
public bool $patchEnvironmentOnly;
123123

124-
public bool $installBlocksCloner;
125-
126124
public function __construct(public string $version, public string $archiveUrl)
127125
{
128126
$matches = null;
@@ -185,12 +183,6 @@ readonly class Version
185183
} else {
186184
$this->patchEnvironmentOnly = false;
187185
}
188-
189-
if (version_compare($this->comparableVersion, '8.5.4') >= 0) {
190-
$this->installBlocksCloner = true;
191-
} else {
192-
$this->installBlocksCloner = false;
193-
}
194186
}
195187

196188
public function serialize(array &$result, array &$alreadySerializedVersions): void
@@ -239,7 +231,6 @@ readonly class Version
239231
'c5_archive' => $this->archiveUrl,
240232
'c5_startingpoint' => $full ? $this->fullStartingPoint : $this->blankStartingPoint,
241233
'patch_environment_only' => $this->patchEnvironmentOnly ? 'Y' : 'N',
242-
'install_blocks_cloner' => $this->installBlocksCloner ? 'Y' : 'N',
243234
'image_tag' => array_shift($versions),
244235
'additional_tags' => implode(' ', $versions),
245236
];

‎.github/workflows/ongoing-branch.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ jobs:
6464
--build-arg CCM_C5_ARCHIVE=https://codeload.github.com/concretecms/concretecms/tar.gz/${{ steps.check.outputs.BUILD_SHA1 }} \
6565
--build-arg CCM_STARTING_POINT=${{ matrix.data.c5_startingpoint }} \
6666
--build-arg CCM_PATCH_ENVIRONMENT_ONLY=${{ matrix.data.patch_environment_only }} \
67-
--build-arg CCM_INSTALL_BLOCKS_CLONER=${{ matrix.data.install_blocks_cloner }} \
6867
--tag ghcr.io/concrete5-community/docker5:${{ matrix.data.image_tag }} \
6968
./installed
7069
for additional_tag in ${{ matrix.data.additional_tags }}; do

‎README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,25 @@ Source repository: https://github.com/concrete5-community/docker5
141141
docker5 images come with some service CLI commands.
142142
You can get a list of them by running the `ccm-help` CLI command.
143143

144-
## Preinstalled Concrete packages
144+
## Installing additional components
145145

146-
Images with concrete5/ConcreteCMS version 8.5.4 or later come with [Blocks Cloner](https://github.com/concrete5-community/blocks_cloner) preinstalled.
146+
You can install additional components with the `ccm-install` CLI command.
147+
148+
### Blocks Cloner
149+
150+
You can install [Blocks Cloner](https://github.com/concrete5-community/blocks_cloner) in a concrete5/ConcreteCMS version 8.5.4 or later come with:
151+
152+
```sh
153+
ccm-install blocks_cloner
154+
```
155+
156+
### Validator of CIF files
157+
158+
You can install [concrete-cif](https://github.com/concretecms/concrete-cif) with:
159+
160+
```sh
161+
ccm-install concrete-cif
162+
```
147163

148164
## PHP Versions
149165

‎base/assets/bashrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ complete -F _ccm_service ccm-service
1818
_ccm_install() {
1919
case $COMP_CWORD in
2020
1)
21-
COMPREPLY=( $(compgen -W 'blocks_cloner' -- "${COMP_WORDS[COMP_CWORD]}") )
21+
COMPREPLY=( $(compgen -W 'blocks_cloner concrete-cif' -- "${COMP_WORDS[COMP_CWORD]}") )
2222
;;
2323
*)
2424
COMPREPLY=()

‎base/assets/ccm-help

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ docker5 images come with the following CLI commands:
1212
Invoke it without arguments to get some help.
1313
1414
- ccm-install: install or update additional stuff
15-
(for example: Blocks Cloner).
15+
(for example: Blocks Cloner, concrete-cif).
1616
1717
- switch-composer: change the composer version to be used.
1818
Invoke it without arguments to get some help.

‎base/assets/ccm-install

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,30 @@ set -o errexit
66
script_name=$0
77

88
exitWithSyntax() {
9-
printf 'Syntax: %s <blocks_cloner>\n\nInstall or update additional stuff\n\n' "$script_name" >&2
9+
printf 'Syntax: %s <blocks_cloner|concrete-cif>\n\nInstall or update additional stuff\n\n' "$script_name" >&2
1010
exit 1
1111
}
1212

13+
installJava() {
14+
if command -v java >/dev/null 2>&1; then
15+
return
16+
fi
17+
installJava_cleanupApk=1
18+
if [ -d "/var/lib/apt/lists" ]; then
19+
if find "/var/lib/apt/lists" -maxdepth 1 -mindepth 1 -print -quit | grep -q .; then
20+
installJava_cleanupApk=0
21+
fi
22+
fi
23+
printf 'Installing Java...\n'
24+
apt-get update -qy
25+
apt-get install -qy --no-install-recommends openjdk-21-jdk-headless
26+
java -version
27+
if [ $installJava_cleanupApk -eq 1 ]; then
28+
apt-get clean -qy
29+
rm -rf /var/lib/apt/lists/* || true
30+
fi
31+
}
32+
1333
installBlocksCloner() {
1434
printf 'Installing Blocks Cloner...\n'
1535
if [ -d "/app/packages/blocks_cloner" ]; then
@@ -47,20 +67,38 @@ installBlocksCloner() {
4767
printf -- '- extracting... '
4868
if ! sudo -u www-data unzip -q -o "$installBlocksCloner_tmpFile" -d /app/packages; then
4969
rm -f "$installBlocksCloner_tmpFile" || true
70+
if [ $installBlocksCloner_upgrading -eq 0 ]; then
71+
rm -rf /app/packages/blocks_cloner || true
72+
fi
5073
echo "Failed to extract Blocks Cloner." >&2
5174
exit 1
5275
fi
5376
rm -f "$installBlocksCloner_tmpFile" || true
5477
printf 'done\n'
78+
ccm-service start db
5579
cd /app
5680
if [ $installBlocksCloner_upgrading -eq 1 ]; then
5781
c5 c5:update-package blocks_cloner
5882
else
59-
c5 c5:install-package blocks_cloner
83+
if ! c5 c5:install-package blocks_cloner; then
84+
rm -rf /app/packages/blocks_cloner || true
85+
cd - >/dev/null || true
86+
exit 1
87+
fi
6088
fi
6189
cd - >/dev/null || true
6290
}
6391

92+
installConcreteCIF() {
93+
installJava
94+
printf 'Downloading Concrete CIF...\n'
95+
curl -sSfL -o /usr/local/lib/concrete-cif.jar https://github.com/concretecms/concrete-cif/releases/latest/download/concrete-cif.jar
96+
printf '#!/bin/sh\nexec java -jar /usr/local/lib/concrete-cif.jar "$@"\n' >/usr/local/bin/concrete-cif
97+
chmod +x /usr/local/bin/concrete-cif
98+
printf 'concrete-cif version: '
99+
concrete-cif --version
100+
}
101+
64102
subject=
65103
while :; do
66104
if test $# -lt 1; then
@@ -73,6 +111,12 @@ while :; do
73111
fi
74112
subject=$1
75113
;;
114+
concrete-cif)
115+
if [ -n "$subject" ]; then
116+
exitWithSyntax
117+
fi
118+
subject=$1
119+
;;
76120
*)
77121
exitWithSyntax
78122
;;
@@ -87,4 +131,7 @@ case "$subject" in
87131
blocks_cloner)
88132
installBlocksCloner
89133
;;
134+
concrete-cif)
135+
installConcreteCIF
136+
;;
90137
esac

‎base/build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ apt-get remove -qy --autoremove --purge software-properties-common
9898
mkdir /app
9999
chown www-data:www-data /app
100100
ccm-service stop
101+
apt-get clean -qy
101102
rm -rf /var/lib/apt/lists/*
102103
npm cache clean --force
103104
rm -rf $HOME/.npm/_logs/*.log

‎gh-pages/src/Matrix.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ interface RawEntry {
99
c5_archive: string;
1010
c5_startingpoint: string;
1111
patch_environment_only: YN;
12-
install_blocks_cloner: YN;
1312
image_tag: string;
1413
additional_tags?: string;
1514
repo_branch?: string;

‎installed/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ ARG CCM_PHPUNIT_VERSION=8
66
ARG CCM_C5_ARCHIVE=https://github.com/concretecms/concretecms/archive/master.tar.gz
77
ARG CCM_STARTING_POINT=atomik_full
88
ARG CCM_PATCH_ENVIRONMENT_ONLY=N
9-
ARG CCM_INSTALL_BLOCKS_CLONER=N
109

1110
COPY assets/app-patch /tmp/
1211
COPY assets/start-patch /tmp/

‎installed/build

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ c5 c5:install \
6969

7070
sudo -u www-data -- mkdir --mode=0755 -p /app/application/languages/site
7171

72-
if [ "${CCM_INSTALL_BLOCKS_CLONER:-}" = Y ]; then
73-
printTitle 'Installing Blocks Cloner'
74-
ccm-install blocks_cloner
75-
fi
76-
7772
c5 c5:config set -g concrete.seo.url_rewriting true
7873
c5 c5:config set -g concrete.mail.method smtp
7974
c5 c5:config set -g concrete.mail.methods.smtp.server 127.0.0.1

0 commit comments

Comments
 (0)
Please sign in to comment.