Skip to content

Commit

Permalink
Migrate Travis CI scripts to Fooman mirrors (#54)
Browse files Browse the repository at this point in the history
* Use Fooman-mirror for Travis installation to avoid requiring credentials (see https://fooman.com/blog/no-authentication-needed-magento-2-mirror.html and #51)

* Use --add-repository CLI flag to stick to fooman mirror

* Stick to https://repo-magento-mirror.fooman.co.nz/ mirror on installation

* Downgrade to composer v1 in Travis job matrix

* Downgrade to composer v1 in Travis job matrix

* Install dev-dependencies in 2nd step

* Work around memory limit

* Set composer version in environment variable

* Use latest versions of 2.3.3, 2.3.4, and 2.3.5

* Remove pre-2.3.6 Magento versions from Travis CI matrix
  • Loading branch information
fnogatz authored May 11, 2021
1 parent bc70f62 commit 45388d3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 16 deletions.
30 changes: 22 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
language: php
php:
- 7.4
- 7.3

env:
- M2_VERSION=2.4.2
- M2_VERSION=2.4.1
- M2_VERSION=2.4.0
global:
- COMPOSER_MEMORY_LIMIT=-1
- COMPOSER_CHANNEL=stable

jobs:
include:
- php: 7.4
env: M2_VERSION=2.4.2
- php: 7.4
env: M2_VERSION=2.4.1-p1 COMPOSER_CHANNEL=1
- php: 7.4
env: M2_VERSION=2.4.0-p1 COMPOSER_CHANNEL=1
- php: 7.3
env: M2_VERSION=2.3.6-p1
env: M2_VERSION=2.4.2
- php: 7.3
env: M2_VERSION=2.3.5
env: M2_VERSION=2.4.1-p1 COMPOSER_CHANNEL=1
- php: 7.3
env: M2_VERSION=2.4.0-p1 COMPOSER_CHANNEL=1
- php: 7.3
env: M2_VERSION=2.3.6-p1 COMPOSER_CHANNEL=1

before_install:
- composer --verbose self-update --$COMPOSER_CHANNEL

cache:
directories:
- $HOME/.composer/cache

script:
- dev/ci/build.sh
17 changes: 9 additions & 8 deletions dev/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ fi
for envkey in \
MODULE_NAME \
MODULE_SRC_DIR \
M2_VERSION \
M2_REPO_USERNAME \
M2_REPO_PASSWORD
M2_VERSION
do
if [ -z "$(eval echo \$$envkey)" ]
then
Expand All @@ -40,20 +38,23 @@ then
MODULE_DST_DIR="$BUILD_DIR/app/code/$(echo $MODULE_NAME | sed 's/_/\//')"
fi

# Set composer authentication params
"$COMPOSER_BIN" config --global \
"http-basic.repo.magento.com" "$M2_REPO_USERNAME" "$M2_REPO_PASSWORD"

set -x

# Fetch Magento 2 source
"$COMPOSER_BIN" create-project \
--repository=https://repo-magento-mirror.fooman.co.nz/ \
--add-repository \
--quiet \
--ignore-platform-reqs \
--repository-url=https://repo.magento.com/ \
--no-install \
magento/project-community-edition \
"$BUILD_DIR" "$M2_VERSION"

cd "$BUILD_DIR"
"$COMPOSER_BIN" config --unset repo.0
"$COMPOSER_BIN" config repositories.foomanmirror composer https://repo-magento-mirror.fooman.co.nz/
"$COMPOSER_BIN" update

# Copy module into Magento
mkdir -p "$(dirname "$MODULE_DST_DIR")"
cp -r "$MODULE_SRC_DIR" "$MODULE_DST_DIR"
Expand Down

0 comments on commit 45388d3

Please sign in to comment.