Skip to content

Commit 45388d3

Browse files
authored
Migrate Travis CI scripts to Fooman mirrors (#54)
* 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
1 parent bc70f62 commit 45388d3

File tree

2 files changed

+31
-16
lines changed

2 files changed

+31
-16
lines changed

.travis.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
11
language: php
2-
php:
3-
- 7.4
4-
- 7.3
2+
53
env:
6-
- M2_VERSION=2.4.2
7-
- M2_VERSION=2.4.1
8-
- M2_VERSION=2.4.0
4+
global:
5+
- COMPOSER_MEMORY_LIMIT=-1
6+
- COMPOSER_CHANNEL=stable
7+
98
jobs:
109
include:
10+
- php: 7.4
11+
env: M2_VERSION=2.4.2
12+
- php: 7.4
13+
env: M2_VERSION=2.4.1-p1 COMPOSER_CHANNEL=1
14+
- php: 7.4
15+
env: M2_VERSION=2.4.0-p1 COMPOSER_CHANNEL=1
1116
- php: 7.3
12-
env: M2_VERSION=2.3.6-p1
17+
env: M2_VERSION=2.4.2
1318
- php: 7.3
14-
env: M2_VERSION=2.3.5
19+
env: M2_VERSION=2.4.1-p1 COMPOSER_CHANNEL=1
20+
- php: 7.3
21+
env: M2_VERSION=2.4.0-p1 COMPOSER_CHANNEL=1
22+
- php: 7.3
23+
env: M2_VERSION=2.3.6-p1 COMPOSER_CHANNEL=1
24+
25+
before_install:
26+
- composer --verbose self-update --$COMPOSER_CHANNEL
27+
1528
cache:
1629
directories:
1730
- $HOME/.composer/cache
31+
1832
script:
1933
- dev/ci/build.sh

dev/ci/build.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ fi
1818
for envkey in \
1919
MODULE_NAME \
2020
MODULE_SRC_DIR \
21-
M2_VERSION \
22-
M2_REPO_USERNAME \
23-
M2_REPO_PASSWORD
21+
M2_VERSION
2422
do
2523
if [ -z "$(eval echo \$$envkey)" ]
2624
then
@@ -40,20 +38,23 @@ then
4038
MODULE_DST_DIR="$BUILD_DIR/app/code/$(echo $MODULE_NAME | sed 's/_/\//')"
4139
fi
4240

43-
# Set composer authentication params
44-
"$COMPOSER_BIN" config --global \
45-
"http-basic.repo.magento.com" "$M2_REPO_USERNAME" "$M2_REPO_PASSWORD"
46-
4741
set -x
4842

4943
# Fetch Magento 2 source
5044
"$COMPOSER_BIN" create-project \
45+
--repository=https://repo-magento-mirror.fooman.co.nz/ \
46+
--add-repository \
5147
--quiet \
5248
--ignore-platform-reqs \
53-
--repository-url=https://repo.magento.com/ \
49+
--no-install \
5450
magento/project-community-edition \
5551
"$BUILD_DIR" "$M2_VERSION"
5652

53+
cd "$BUILD_DIR"
54+
"$COMPOSER_BIN" config --unset repo.0
55+
"$COMPOSER_BIN" config repositories.foomanmirror composer https://repo-magento-mirror.fooman.co.nz/
56+
"$COMPOSER_BIN" update
57+
5758
# Copy module into Magento
5859
mkdir -p "$(dirname "$MODULE_DST_DIR")"
5960
cp -r "$MODULE_SRC_DIR" "$MODULE_DST_DIR"

0 commit comments

Comments
 (0)