Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 18
[WIP] Adding build script#44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -7,3 +7,7 @@ | ||
| /puli.json | ||
| /box.json | ||
| /.puli | ||
| /.idea | ||
| *.iml | ||
| .travis/build-key.pem | ||
| .travis/secrets.tar | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Deploy | ||
| ``` | ||
| ssh-keygen -t rsa -b 4096 -C "<your email address>" | ||
| ``` | ||
| * store deploy key in github | ||
| cp $HOME/.ssh/<repo>_rsa .travis/build-key.pem |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| #!/bin/bash | ||
| # Unpack secrets; -C ensures they unpack *in* the .travis directory | ||
| tar xvf .travis/secrets.tar -C .travis | ||
| # Setup SSH agent: | ||
| eval "$(ssh-agent -s)" #start the ssh agent | ||
| chmod 600 .travis/build-key.pem | ||
| ssh-add .travis/build-key.pem | ||
| # Get box and build PHAR | ||
| wget https://box-project.github.io/box2/manifest.json | ||
| BOX_URL=$(php bin/parse-manifest.php manifest.json) | ||
| rm manifest.json | ||
| wget -O box.phar ${BOX_URL} | ||
| chmod 755 box.phar | ||
| ./box.phar build -vv | ||
| # TODO if build with gh-pages | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's happening with these TODOs? Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i will remove it when its clear how we deploy the files (: | ||
| # Setup git defaults: | ||
| # TODO set username and email | ||
| # git config --global user.email "johannes.wachter@outlook.com" | ||
| # git config --global user.name "Johannes Wachter" | ||
| # Add SSH-based remote to GitHub repo: | ||
| # TODO remote | ||
| # git remote add deploy git@github.com:wachterjohannes/cli.git | ||
| # git fetch deploy | ||
| # Checkout gh-pages and add PHAR file and version: | ||
| # git checkout -b gh-pages deploy/gh-pages | ||
| # git pull deploy gh-pages | ||
| # mv build/* ./puli.phar | ||
| # sha1sum puli.phar > puli.phar.version | ||
| # git add puli.phar puli.phar.version | ||
| # Commit and push: | ||
| # git commit -m 'Rebuilt phar' | ||
| # git push deploy gh-pages:gh-pages | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <?php | ||
| chdir(__DIR__ . '/../'); | ||
| $fallbackUrl = 'https://github.com/box-project/box2/releases/download/2.6.0/box-2.6.0.phar'; | ||
| if (!isset($argv[1]) || !is_file($argv[1])) { | ||
| return $fallbackUrl; | ||
| } | ||
| $manifestJson = file_get_contents($argv[1]); | ||
| $files = json_decode($manifestJson, true); | ||
| if (!is_array($files)) { | ||
| echo $fallbackUrl; | ||
| exit(0); | ||
| } | ||
| foreach ($files as $file) { | ||
| if (!is_array($file) || !isset($file['version'])) { | ||
| continue; | ||
| } | ||
| if (version_compare($file['version'], '2.6.0', '>=')) { | ||
| echo $file['url']; | ||
| exit(0); | ||
| } | ||
| } | ||
| echo $fallbackUrl; | ||
| exit(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason why you removed these spaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no not really but the travis shell script removes it (: