Skip to content

Commit b8d4531

Browse files
author
root
committed
Initial commit
0 parents  commit b8d4531

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+7277
-0
lines changed

Diff for: .dockerignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*
2+
!bin
3+
!docs
4+
!res
5+
!src
6+
!views
7+
!composer.json
8+
!composer.lock
9+
!LICENSE

Diff for: .gitattributes

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Auto-detect text files, ensure they use LF.
2+
* text=auto eol=lf
3+
4+
# These files are always considered text and should use LF.
5+
# See core.whitespace @ http://git-scm.com/docs/git-config for whitespace flags.
6+
*.php text eol=lf whitespace=blank-at-eol,blank-at-eof,space-before-tab,tab-in-indent,tabwidth=4 diff=php
7+
*.json text eol=lf whitespace=blank-at-eol,blank-at-eof,space-before-tab,tab-in-indent,tabwidth=4

Diff for: .gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/public/
2+
/build/
3+
/vendor/
4+
/.php_cs.cache
5+
/composer.phar
6+
/phpunit.xml
7+
/satis.phar

Diff for: .php_cs.dist

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
/* This config requires PHP-CS-Fixer version ^2.9 */
4+
5+
$header = <<<EOF
6+
This file is part of composer/satis.
7+
8+
(c) Composer <https://github.com/composer>
9+
10+
For the full copyright and license information, please view
11+
the LICENSE file that was distributed with this source code.
12+
EOF;
13+
14+
$finder = (new PhpCsFixer\Finder())
15+
->files()
16+
->name('*.php')
17+
->in(__DIR__.'/src')
18+
->in(__DIR__.'/tests')
19+
->in(__DIR__.'/views')
20+
;
21+
22+
return (new PhpCsFixer\Config('satis'))
23+
->setRiskyAllowed(true)
24+
->setRules([
25+
// default
26+
'@PSR2' => true,
27+
'@Symfony' => true,
28+
// additionally
29+
'array_syntax' => ['syntax' => 'short'],
30+
'concat_space' => false,
31+
'header_comment' => ['header' => $header],
32+
'no_unused_imports' => false,
33+
'no_useless_else' => true,
34+
'no_useless_return' => true,
35+
'ordered_imports' => true,
36+
'phpdoc_align' => false,
37+
'phpdoc_order' => true,
38+
'phpdoc_align' => false,
39+
'phpdoc_summary' => false,
40+
'simplified_null_return' => false,
41+
'ternary_to_null_coalescing' => true,
42+
])
43+
->setFinder($finder)
44+
;

Diff for: .travis.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
sudo: false
2+
dist: trusty
3+
4+
language: php
5+
6+
cache:
7+
directories:
8+
- $HOME/.composer/cache/files
9+
10+
git:
11+
depth: 5
12+
13+
php:
14+
- 7.0
15+
- 7.1
16+
- 7.2
17+
- nightly
18+
19+
matrix:
20+
fast_finish: true
21+
allow_failures:
22+
- php: nightly
23+
24+
before_install:
25+
- flags="--no-interaction --no-progress --prefer-dist"
26+
27+
install:
28+
- composer install $flags
29+
30+
script:
31+
- vendor/bin/phpunit

Diff for: Dockerfile

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
FROM php:7-alpine
2+
3+
MAINTAINER https://github.com/composer/satis
4+
5+
RUN apk --no-cache add curl git subversion mercurial openssh openssl tini zlib-dev
6+
7+
RUN docker-php-ext-install zip \
8+
&& echo "memory_limit=-1" > "$PHP_INI_DIR/conf.d/memory-limit.ini" \
9+
&& echo "date.timezone=${PHP_TIMEZONE:-UTC}" > "$PHP_INI_DIR/conf.d/date_timezone.ini"
10+
11+
ENV COMPOSER_HOME /composer
12+
ENV PATH "/composer/vendor/bin:$PATH"
13+
ENV COMPOSER_ALLOW_SUPERUSER 1
14+
15+
RUN mkdir /build \
16+
&& mkdir /composer \
17+
&& chmod -R 777 /composer \
18+
&& curl -sfLo /tmp/composer-setup.php https://getcomposer.org/installer \
19+
&& curl -sfLo /tmp/composer-setup.sig https://composer.github.io/installer.sig \
20+
&& php -r " \
21+
\$hash = hash('SHA384', file_get_contents('/tmp/composer-setup.php')); \
22+
\$signature = trim(file_get_contents('/tmp/composer-setup.sig')); \
23+
if (!hash_equals(\$signature, \$hash)) { \
24+
unlink('/tmp/composer-setup.php'); \
25+
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
26+
exit(1); \
27+
}" \
28+
&& php /tmp/composer-setup.php --no-ansi --install-dir=/usr/bin --filename=composer \
29+
&& composer --no-interaction --no-ansi --version \
30+
&& rm /tmp/composer-setup.php
31+
32+
WORKDIR /satis
33+
34+
COPY ["composer.json", "composer.lock", "/satis/"]
35+
36+
RUN composer install --no-interaction --no-ansi --no-autoloader --no-scripts --no-plugins --no-dev
37+
38+
COPY bin /satis/bin/
39+
COPY res /satis/res/
40+
COPY views /satis/views/
41+
COPY src /satis/src/
42+
43+
RUN composer dump-autoload --no-interaction --no-ansi --optimize --no-dev
44+
45+
ENTRYPOINT ["/sbin/tini", "-g", "--", "/satis/bin/docker-entrypoint.sh"]
46+
47+
CMD ["--ansi", "-vvv", "build", "/build/satis.json", "/build/output"]

Diff for: LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) Composer
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

Diff for: README.md

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Satis
2+
3+
Simple static Composer repository generator.
4+
5+
[![Build Status](https://travis-ci.org/composer/satis.svg?branch=master)](https://travis-ci.org/composer/satis)
6+
7+
8+
## Run from source
9+
10+
- Install satis: `composer create-project composer/satis:dev-master --keep-vcs`
11+
- Build a repository: `php bin/satis build <configuration-file> <output-dir>`
12+
13+
Read the more detailed instructions in the [documentation][].
14+
15+
16+
## Run as Docker container
17+
18+
Pull the image:
19+
20+
``` sh
21+
docker pull composer/satis
22+
```
23+
24+
Run the image:
25+
26+
``` sh
27+
docker run --rm -it -v /build:/build composer/satis
28+
```
29+
30+
> Note: by default it will look for a configuration file named `satis.json`
31+
inside the `/build` directory and dump the generated output files in
32+
`/build/output`.
33+
34+
Run the image (with Composer cache from host):
35+
36+
``` sh
37+
docker run --rm -it -v /build:/build -v $COMPOSER_HOME:/composer composer/satis
38+
```
39+
40+
If you want to run the image without implicitly running Satis, you have to
41+
override the entrypoint specified in the `Dockerfile`:
42+
43+
``` sh
44+
docker run --rm -it --entrypoint /bin/sh composer/satis
45+
```
46+
47+
48+
## Purge
49+
50+
If you choose to archive packages as part of your build, over time you can be
51+
left with useless files. With the `purge` command, you can delete these files.
52+
53+
``` sh
54+
php bin/satis purge <configuration-file> <output-dir>
55+
```
56+
57+
> Note: don't do this unless you are certain your projects no longer reference
58+
any of these archives in their `composer.lock` files.
59+
60+
61+
## Updating
62+
63+
Updating Satis is as simple as running `git pull && composer update` in the
64+
Satis directory.
65+
66+
If you are running Satis as a Docker container, simply pull the latest image.
67+
68+
69+
## Contributing
70+
71+
Please note that this project is released with a [Contributor Code of Conduct][].
72+
By participating in this project you agree to abide by its terms.
73+
74+
Fork the project, create a feature branch, and send us a pull request.
75+
76+
77+
## Authors
78+
79+
See the list of [contributors][] who participate(d) in this project.
80+
81+
82+
## Community Tools
83+
84+
- [satis-go][] - A simple web server for managing Satis configuration and
85+
hosting the generated Composer repository.
86+
- [satisfy][] - Symfony based composer repository manager with a simple web UI.
87+
- [satis-control-panel][] - Simple web UI for managing your Satis Repository
88+
with optional CI integration.
89+
- [composer-satis-builder][] - Simple tool for updating the Satis configuration
90+
(satis.json) "require" key on the basis of the project composer.json.
91+
92+
93+
## License
94+
95+
Satis is licensed under the MIT License - see the [LICENSE][] file for details
96+
97+
98+
[documentation]: https://getcomposer.org/doc/articles/handling-private-packages-with-satis.md
99+
[Contributor Code of Conduct]: http://contributor-covenant.org/version/1/4/
100+
[contributors]: https://github.com/composer/satis/contributors
101+
[satis-go]: https://github.com/benschw/satis-go
102+
[satisfy]: https://github.com/ludofleury/satisfy
103+
[satis-control-panel]: https://github.com/realshadow/satis-control-panel
104+
[composer-satis-builder]: https://github.com/AOEpeople/composer-satis-builder
105+
[LICENSE]: https://github.com/composer/satis/blob/master/LICENSE

Diff for: bin/docker-entrypoint.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/sh
2+
set -e
3+
4+
isCommand() {
5+
for cmd in \
6+
"add" \
7+
"build" \
8+
"help" \
9+
"init" \
10+
"list" \
11+
"purge"
12+
do
13+
if [ -z "${cmd#"$1"}" ]; then
14+
return 0
15+
fi
16+
done
17+
18+
return 1
19+
}
20+
21+
# check if the first argument passed in looks like a flag
22+
if [ "$(printf %c "$1")" = '-' ]; then
23+
set -- /satis/bin/satis "$@"
24+
# check if the first argument passed in is satis
25+
elif [ "$1" = 'satis' ]; then
26+
shift
27+
set -- /satis/bin/satis "$@"
28+
# check if the first argument passed in matches a known command
29+
elif isCommand "$1"; then
30+
set -- /satis/bin/satis "$@"
31+
fi
32+
33+
exec "$@"

Diff for: bin/satis

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
/*
5+
* This file is part of composer/satis.
6+
*
7+
* (c) Composer <https://github.com/composer>
8+
*
9+
* For the full copyright and license information, please view
10+
* the LICENSE file that was distributed with this source code.
11+
*/
12+
13+
function includeIfExists($file)
14+
{
15+
if (file_exists($file)) {
16+
return include $file;
17+
}
18+
}
19+
20+
if ((!$loader = includeIfExists(__DIR__.'/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__.'/../../../autoload.php'))) {
21+
print('You must set up the project dependencies using Composer before you can use Satis.');
22+
exit(1);
23+
}
24+
25+
$application = new Composer\Satis\Console\Application();
26+
$application->run();

Diff for: bin/satis.bat

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo OFF
2+
:: in case DelayedExpansion is on and a path contains !
3+
setlocal DISABLEDELAYEDEXPANSION
4+
php "%~dp0satis" %*

Diff for: box.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"alias": "satis.phar",
3+
"main": "bin/satis",
4+
"output": "satis.phar",
5+
"stub": true,
6+
"directories": [ "src", "views" ],
7+
"files": [
8+
"LICENSE",
9+
"res/satis-schema.json"
10+
],
11+
"finder": [{
12+
"name": "*.php",
13+
"in": "vendor"
14+
}, {
15+
"name": "composer-schema.json",
16+
"in": "vendor/composer/composer"
17+
}, {
18+
"name": "cacert.pem",
19+
"in": "vendor/composer/ca-bundle"
20+
}],
21+
"compression": "GZ",
22+
"compactors": [
23+
"Herrera\\Box\\Compactor\\Json",
24+
"Herrera\\Box\\Compactor\\Php"
25+
],
26+
"chmod": "0755",
27+
"algorithm": "SHA1"
28+
}

0 commit comments

Comments
 (0)