Skip to content
This repository was archived by the owner on Dec 27, 2023. It is now read-only.

Commit 0a68a4d

Browse files
committed
A lot of CI work
1 parent e75783a commit 0a68a4d

File tree

12 files changed

+122
-25
lines changed

12 files changed

+122
-25
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
composer.lock
2-
private.key
2+
.travis/phar_private.key
3+
.travis/deploy_private.key
4+
.travis/secrets.tar
35
vendor/
46
jupyter-php-installer.phar
7+
jupyter-php-installer.phar.pubkey
58
.idea

.travis.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
sudo: false
2+
3+
language: php
4+
5+
cache:
6+
directories:
7+
- "$HOME/.composer/cache"
8+
- vendor
9+
10+
matrix:
11+
fast_finish: true
12+
include:
13+
- php: 5.5
14+
- php: 5.6
15+
- php: 7.0
16+
- php: hhvm
17+
allow_failures:
18+
- php: hhvm
19+
20+
before_install:
21+
- openssl aes-256-cbc -K $encrypted_f21abcc37842_key -iv $encrypted_f21abcc37842_iv
22+
-in secrets.tar.enc -out secrets.tar -d
23+
- travis_retry composer self-update
24+
25+
install:
26+
- travis_retry composer install --optimize-autoloader --prefer-dist --no-interaction
27+
- composer info -i
28+
29+
script:
30+
- here call phpunit
31+
32+
after_script:
33+
- something more
34+
35+
after_success:

.travis/deploy_public.key

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDUXU2ODDrbfdRatnMFgSzEJHvThGeNbvgo6WYKmy35ER+CctnVrC/SQ1tcXAHC+F6GKhSoJDMVazti3i9wp69bkYmGTY/OKbYltBP5wldtD4oF1mTmWzAB6EoiPac9BNddry57sHFH7N/zlQVSf9ZuMd3iXJLTTD6VJeVWuSTiIW/efby9ICVyoGEqnNBeoxDFD3L9w6tW9IPZHh5Sma2dzr3+C4TsEGFmDFYIEtK+Ar49XH03OH7hd5xALqxxSTE5c40Dt5N106ch6eKb2BhA9fVIFbS9/hhgh+ZV5n1Y53op0CDK8aadoQTzvQK/AdfSnDoX2hQWNBPAzyTJps6q2OoZdaV+gbAahsHwOgvRn4kYChUzU201DcRi4xMI2QkQ4f+NPUTgtJnvRbZUPRO7va7PLkXEEZqFv1Xs6sE1ua7fB7NUyLb9MrQznJrX7fOHE82veoDrqn2du3cEPJ/FATqL+dzynB6YjOk7J1F7qaxSAaURM3fG12dcbZYgfVKTDo+OieLEoYqtm8FGMTPM8xIQR8wm4euEDxsh6Ex4sDMHKXIRu88Hx9VPwYUzv1vIVQfbbKIc65G91zJm91cW5t0dsKY9QD2u2PzDY9EmwNfihRY+jMP2A47OSzNCaqdx/qj7SG7GUjnlvoi1/sKhGP5gNwVtuqSnVlogN0MXyQ== castarco@litipk.com

.travis/secrets.tar.enc

20 KB
Binary file not shown.

bin/deploy.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
# Unpack secrets
4+
tar xvf .travis/secrets.tar -C .travis
5+
6+
# Setup SSH agent:
7+
eval "$(ssh-agent -s)" #start the ssh agent
8+
chmod 600 .travis/phar_private.key
9+
ssh-add .travis/phar_private.key
10+
11+
# Setup git defaults:
12+
git config --global user.email "castarco@gmail.com"
13+
git config --global user.name "Andreu Correa Casablanca"
14+
15+
# Add SSH-based remote to GitHub repo:
16+
git remote add deploy git@github.com:Litipk/Jupyter-PHP-Installer.git
17+
git fetch deploy
18+
19+
# Get Box and build
20+
wget https://github.com/box-project/box2/releases/download/2.7.0/box-2.7.0.phar -O ./bin/box.phar
21+
cp .travis/phar_public.key ./public.key
22+
./bin/box.phar build -vv
23+
24+
# To allow checkout gh-pages branch
25+
mv jupyter-php-installer.phar jupyter-php-installer.phar.tmp
26+
mv jupyter-php-installer.phar.pubkey jupyter-php-installer.phar.pubkey.tmp
27+
28+
# Checkout gh-pages and add PHAR file and version:
29+
git checkout -b gh-pages deploy/gh-pages
30+
31+
mv jupyter-php-installer.phar.tmp dist/jupyter-php-installer.phar
32+
mv jupyter-php-installer.phar.pubkey.tmp dist/jupyter-php-installer.phar.pubkey
33+
34+
sha1sum dist/jupyter-php-installer.phar > dist/jupyter-php-installer.phar.version
35+
git add dist/jupyter-php-installer.phar dist/jupyter-php-installer.phar.version dist/jupyter-php-installer.phar.pubkey
36+
37+
# Commit and push:
38+
git commit -m 'Rebuilt phar'
39+
git push deploy gh-pages:gh-pages

box.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"alias": "jupyter-php-installer.phar",
33
"chmod": "0755",
4+
"algorithm": "OPENSSL",
5+
"compression": "GZ",
46
"directories": ["src"],
57
"files": [
68
"LICENSE",
7-
"README.md",
8-
"public.key"
9+
"README.md"
910
],
1011
"finder": [
1112
{
@@ -17,5 +18,6 @@
1718
"git-version": "package_version",
1819
"main": "src/EntryPoint/main.php",
1920
"output": "jupyter-php-installer.phar",
20-
"stub": true
21+
"stub": true,
22+
"key": ".travis/phar_private.key"
2123
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "project",
55
"license": "MIT",
66
"require": {
7-
"php": "5.*,>=5.5.9",
7+
"php": ">=5.5.9",
88
"symfony/console": "~3.0",
99
"seld/cli-prompt": "~1.0"
1010
},

public.key

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/Installer/Installer.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ protected abstract function getInstallPath();
6868
*/
6969
protected abstract function installKernel();
7070

71+
/**
72+
* @param $installPath
73+
* @return mixed
74+
*/
75+
protected abstract function executeSilentComposerCommand($installPath);
76+
7177
/**
7278
* @param string $installPath
7379
* @param bool $beVerbose
@@ -87,15 +93,7 @@ protected function executeComposerCommand($installPath, $beVerbose = false)
8793
);
8894
echo "\n";
8995
} else {
90-
$composerOutputLines = [];
91-
$composerOutput = exec(
92-
'PATH=' . getenv('PATH') . ' ' .
93-
$this->composerCmd . ' --prefer-dist --no-interaction --no-progress --working-dir="' .
94-
$installPath .'" create-project litipk/jupyter-php=dev-master pkgs > /dev/null 2>&1 ',
95-
96-
$composerOutputLines,
97-
$composerStatus
98-
);
96+
$composerStatus = $this->executeSilentComposerCommand($installPath);
9997
}
10098

10199
if ($composerStatus !== 0) {

src/Installer/LinuxInstaller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Litipk\JupyterPhpInstaller\System\UnixSystem;
88

99

10-
final class LinuxInstaller extends Installer
10+
final class LinuxInstaller extends UnixInstaller
1111
{
1212
/**
1313
* LinuxInstaller constructor.

0 commit comments

Comments
 (0)