Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make working distrib building of 3.x branch #14484

Open
wants to merge 3 commits into
base: 3.x
from

Conversation

Projects
None yet
6 participants
@Alroniks
Copy link
Collaborator

commented Mar 12, 2019

What does it do?

It adds an intermediate step in the build process (in Phing configuration file) for installing composer dependencies of the core.

Why is it needed?

To make build process working again. Now, vendor dir is missed in the build and build becomes totally broken.

Related issue(s)/PR(s)

N/A

@Alroniks Alroniks requested review from Mark-H and opengeek as code owners Mar 12, 2019

@Ibochkarev
Copy link
Contributor

left a comment

I checked the build and got errors:

Installation report
Problem detected. Please check the pre-installation test results below. Correct the errors, then click "Test" again.

Checking the possibility of writing to the directory /Users/i.bochkarev/Downloads/modx-3.0.0-dev/core/packages: Error!

Checking the possibility of writing to the directory /Users/i.bochkarev/Downloads/modx-3.0.0-dev/core/packages: Error!

photo_2019-03-15 15 07 04

I press repeat:

Warning: array_merge(): Argument #2 is not an array in /Users/i.bochkarev/Downloads/modx-3.0.0-dev/core/vendor/xpdo/xpdo/src/xPDO/xPDO.php on line 302

Fatal error: Uncaught Error: Class '\xPDO\Om\\xPDODriver' not found in /Users/i.bochkarev/Downloads/modx-3.0.0-dev/core/vendor/xpdo/xpdo/src/xPDO/xPDO.php:1867 
Stack trace: 
#0 /Users/i.bochkarev/Downloads/modx-3.0.0-dev/core/vendor/xpdo/xpdo/src/xPDO/xPDO.php(303): xPDO\xPDO->getDriver() 
#1 /Users/i.bochkarev/Downloads/modx-3.0.0-dev/setup/includes/modinstall.class.php(462): xPDO\xPDO->__construct(NULL, NULL, NULL, Array, Array) 
#2 /Users/i.bochkarev/Downloads/modx-3.0.0-dev/setup/includes/modinstall.class.php(169): modInstall->_connect(NULL, NULL, NULL, NULL, Array) 
#3 /Users/i.bochkarev/Downloads/modx-3.0.0-dev/setup/includes/test/modinstalltest.class.php(315): modInstall->getConnection() 
#4 /Users/i.bochkarev/Downloads/modx-3.0.0-dev/setup/includes/test/modinstalltest.class.php(51): modInstallTest->_checkDatabase() #5 /Users/i.bochkarev/Downloads/modx-3.0.0-dev/setup/includes/modinstall.class.php(238): modInstallTest->run(NULL) 
#6 /Users/i.bochkarev/Downloads/modx-3.0.0-dev/setup/controllers/summary.php(25): modInstall in /Users/i.bochkarev/Downloads/modx-3.0.0-dev/core/vendor/xpdo/xpdo/src/xPDO/xPDO.php on line 1867
@Mark-H

This comment has been minimized.

Copy link
Collaborator

commented Mar 15, 2019

Maybe you should add the packages directory manually as that appears to be missing from your screenshot?

@opengeek

This comment has been minimized.

Copy link
Member

commented Mar 15, 2019

The packages directory is part of the core. ???

@Ibochkarev
Copy link
Contributor

left a comment

Now everything is ok!

MODX Revolution 3 0 0-pl » Install 2019-03-25 19-27-32

@Mark-H

This comment has been minimized.

Copy link
Collaborator

commented Apr 25, 2019

I'm inclined to approve this but have never dealt with phing myself. @opengeek can you do the honours?

@OptimusCrime

This comment has been minimized.

Copy link
Contributor

commented Apr 29, 2019

Can someone document how to run this on their own? Can you run this from the command line? What programs are required?

@Ibochkarev

This comment has been minimized.

Copy link
Contributor

commented Apr 29, 2019

@Alroniks

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 30, 2019

@OptimusCrime I have such script at https://nightly.modx.by/

For you interesting only command cd _build && ../../phing

I use custom build.xml (from this pull request) but code from the main branch, so I have to apply it every time after the pull, you don't need that.

#!/bin/bash

cd modx && git pull origin 3.x --ff-only

echo "Fetching the hash of commit..."
git rev-parse HEAD > ../logs/$(date +%Y-%m-%d).hash

echo "Applying proper build config..."
yes | cp -rf ~/conf/build.xml ~/modx/_build/build.xml

echo "Checking if proper config applied..."
git status

echo "Building distribution..."
cd _build && ../../phing

echo "Copying files to download folder..."
yes | cp -rf distrib/* ~/www/download/

echo "Cleaning up..."
cd ../ && git checkout -- _build

cd ../../

Also, you need Phing installed (phar file).

And my file build.properties in _build folder:

custom = true
debug = on

# PHP related properties (set your local paths here)
php.command = /opt/local/bin/php

# Git related properties (set your local path here)
git.command = git

# Composer related properties (set you local path here)
composer.command = /usr/local/bin/composer

# Override to set the version and release strings
modx.core.version = 3.0.0
modx.core.release = dev

# these properties require a local Git clone in order to produce distributions
# Set this property to produce distribution packages from a Git archive
build.distrib = true

# Set this property to skip phpdoc generation
build.nodocs = false

# Set this property to skip js/css compression and concatenation (WARNING: for use without build.distrib set ONLY!)
build.nominify = false

# Override to turn off the additional of timestamps to the distribution packages (used for nightlies)
build.timestamp = true
@opengeek

This comment has been minimized.

Copy link
Member

commented Apr 30, 2019

@Alroniks why are you not building with the nightly timestamps?

@Alroniks

This comment has been minimized.

Copy link
Collaborator Author

commented May 2, 2019

@opengeek What do you mean? Phing has very limited options for timestamps (according to this docs https://www.phing.info/phing/guide/en/output/chunkhtml/TstampTask.html)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.