-
Notifications
You must be signed in to change notification settings - Fork 19
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
[WIP] Adding build script #44
Open
wachterjohannes
wants to merge
2
commits into
puli:master
Choose a base branch
from
wachterjohannes:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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? 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 "[email protected]" | ||
# git config --global user.name "Johannes Wachter" | ||
|
||
# Add SSH-based remote to GitHub repo: | ||
# TODO remote | ||
# git remote add deploy [email protected]: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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 (: