-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1640f1
commit 130c14e
Showing
6 changed files
with
99 additions
and
3 deletions.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
https://github.com/Scalingo/nodejs-buildpack | ||
https://github.com/Scalingo/nginx-buildpack |
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
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,17 @@ | ||
{ | ||
"name": "Pix UI Review App", | ||
"env": { | ||
"REVIEW_APP": { | ||
"description": "Indicates that the application is a review app", | ||
"value": "true" | ||
} | ||
}, | ||
"addons": [ | ||
], | ||
"formation": { | ||
"web": { | ||
"amount": 1, | ||
"size": "S" | ||
} | ||
} | ||
} |
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,8 @@ | ||
#!/bin/bash -e | ||
|
||
if [ "$REVIEW_APP" == "true" ] | ||
then | ||
npm run build-storybook | ||
else | ||
npm run build-ember | ||
fi |
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,37 @@ | ||
#!/bin/bash -e | ||
|
||
[ "$REVIEW_APP" != "true" ] && { | ||
echo '$REVIEW_APP is not true. I will not post a message to GitHub. Bye !' | ||
exit 0 | ||
} | ||
|
||
[ -z $APP ] && { | ||
echo 'FATAL: $APP is absent' | ||
exit 1 | ||
} | ||
|
||
[ -z $GITHUB_USER ] && { | ||
echo 'FATAL: $GITHUB_USER is absent' | ||
exit 1 | ||
} | ||
|
||
[ -z $GITHUB_USER_TOKEN ] && { | ||
echo 'FATAL: $GITHUB_USER_TOKEN is absent' | ||
exit 1 | ||
} | ||
|
||
PR_NUMBER=$(echo $APP | grep -Po '(?<=-pr)\d+') | ||
RA_URL="https://ui-pr$PR_NUMBER.review.pix.fr" | ||
|
||
MESSAGE_PREFIX="I'm deploying this PR to:" | ||
|
||
existing_comments=$(curl -Ssf -u $GITHUB_USER:$GITHUB_USER_TOKEN \ | ||
"https://api.github.com/repos/1024pix/pix-ui/issues/${PR_NUMBER}/comments") | ||
|
||
if [[ $existing_comments == *"${MESSAGE_PREFIX}"* ]]; then | ||
echo 'INFO: found a matching comment on the PR, not posting another one.' | ||
else | ||
curl -Ssf -u $GITHUB_USER:$GITHUB_USER_TOKEN \ | ||
-X POST "https://api.github.com/repos/1024pix/pix-ui/issues/${PR_NUMBER}/comments" \ | ||
--data "{\"body\":\"$MESSAGE_PREFIX\n\n- Storybook: $RA_URL\n\n Please check it out!\"}" | ||
fi |
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 @@ | ||
log_format keyvalue | ||
'method=$request_method' | ||
' path="$request_uri"' | ||
' host=$host' | ||
' request_id=$http_x_request_id' | ||
' from="$remote_addr"' | ||
' protocol=$scheme' | ||
' status=$status' | ||
' duration=${request_time}s' | ||
' bytes=$bytes_sent' | ||
' referer="$http_referer"' | ||
' user_agent="$http_user_agent"'; | ||
|
||
# In order to avoid logging access twice per request | ||
# it is necessary to turn off the top-level (e.g. http) buildpack default access_log | ||
# as we are about to override it in the server directive here below | ||
access_log off; | ||
|
||
port_in_redirect off; | ||
|
||
server { | ||
listen <%= ENV['PORT'] %>; | ||
|
||
charset utf-8; | ||
|
||
# Disable compression that is performed by the Scalingo router anyway | ||
gzip off; | ||
|
||
root /app/storybook-static/; | ||
} |