Skip to content

Commit

Permalink
Merge branch 'master' into feature/repman-http-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
ymorocutti authored May 2, 2023
2 parents 1e7caef + ef867e6 commit 283ec36
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 24 deletions.
28 changes: 10 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,17 @@ SHELL ["sh", "-eo", "pipefail", "-c"]
# install composer and extensions: pdo_pgsql, intl, zip
RUN apk update && \
apk add --no-cache -q \
$PHPIZE_DEPS \
bash \
git \
subversion \
zip \
unzip \
postgresql-dev \
icu-dev \
libzip-dev \
openssh-client \
&& \
curl -sS https://getcomposer.org/installer | \
php -- --install-dir=/usr/local/bin --filename=composer && \
docker-php-ext-configure pdo_pgsql --with-pdo-pgsql && \
docker-php-ext-configure intl && \
docker-php-ext-configure zip && \
docker-php-ext-install pdo_pgsql && \
docker-php-ext-install intl && \
docker-php-ext-install zip && \
rm -rf /var/cache/apk/*
openssh-client

RUN curl -sSLf \
-o /usr/local/bin/install-php-extensions \
https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && \
chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions opcache pdo_pgsql intl zip @composer && \
rm /usr/local/bin/install-php-extensions

# set timezone
RUN ln -snf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && \
Expand All @@ -49,4 +40,5 @@ WORKDIR /app
COPY . .

ENV APP_ENV=prod
RUN composer install --optimize-autoloader --no-dev

RUN composer install --optimize-autoloader --no-dev; composer clear-cache
13 changes: 7 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ public function synchronize(Package $package): void
return $a->getReleaseDate() <=> $b->getReleaseDate();
}

if ($a->getStability() === Version::STABILITY_STABLE && $b->getStability() !== Version::STABILITY_STABLE) {
return -1;
}

if ($a->getStability() !== Version::STABILITY_STABLE && $b->getStability() === Version::STABILITY_STABLE) {
return 1;
}

return Comparator::greaterThan($a->getVersion(), $b->getVersion()) ? 1 : -1;
});

Expand Down
Binary file not shown.
Binary file added tests/Resources/artifacts-mixed-sorting/b-1.0.0.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ public function testSynchronizePackageFromArtifacts(): void
self::assertContains('suggests-buddy-works/suggests-You really should', $linkStrings);
}

public function testWithMostRecentUnstable(): void
{
$this->downloader->addContent($this->resourcesDir.'artifacts-mixed-sorting', 'foobar');
$package = PackageMother::withOrganization('artifact', $this->resourcesDir.'artifacts-mixed-sorting', 'buddy');
$this->synchronizer->synchronize($package);

self::assertEquals('v1.0.0', $this->getProperty($package, 'latestReleasedVersion'));
}

public function testSynchronizePackageThatAlreadyExists(): void
{
$path = $this->baseDir.'/buddy/p/buddy-works/alpha.json';
Expand Down

0 comments on commit 283ec36

Please sign in to comment.