Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
persona
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hexang 息壤平台
persona
Commits
bee48b34
Commit
bee48b34
authored
12 years ago
by
Richard Soderberg
Browse files
Options
Downloads
Patches
Plain Diff
match indenting of hook script to rest of <pre> blocks
parent
069fad64
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/DEPLOYMENT.md
+34
-34
34 additions, 34 deletions
docs/DEPLOYMENT.md
with
34 additions
and
34 deletions
docs/DEPLOYMENT.md
+
34
−
34
View file @
bee48b34
...
...
@@ -129,40 +129,40 @@ Now, here's a full sample script that you can start with for that
post-update hook, annotated to help you follow along:
<pre>
#!/bin/bash
# only run these commands if it's the browserid repo bein' pushed
if [ "x$GL_REPO" == 'xbrowserid' ] ; then
# create a temporary directory where we'll stage new code
NEWCODE=`mktemp -d`
echo "staging code to $NEWCODE"
mkdir -p $NEWCODE
git archive --format=tar dev | tar -x -C $NEWCODE
echo "generating production resources"
cd $NEWCODE/browserid && ./compress.sh && cd -
# stop the servers
curl -o --url http://localhost:62700/code_update > /dev/null 2>&1
curl -o --url http://localhost:62800/code_update > /dev/null 2>&1
# now move code into place, and keep a backup of the last code
# that was in production in .old
echo "moving updated code into place"
rm -rf /home/browserid/code.old
mv /home/browserid/code{,.old}
mv $NEWCODE /home/browserid/code
echo "fixing permissions"
find /home/browserid/code -exec chgrp www-data {} \; > /dev/null 2>&1
find /home/browserid/code -type d -exec chmod 0775 {} \; > /dev/null 2>&1
find /home/browserid/code -type f -exec chmod ga+r {} \; > /dev/null 2>&1
find /home/browserid/code -type f -perm /u+x -exec chmod g+x {} \; > /dev/null 2>&1
echo "updating dependencies"
ln -s /home/browserid/node_modules /home/browserid/code/node_modules
cd /home/browserid/code && npm install && cd -
fi
#!/bin/bash
# only run these commands if it's the browserid repo bein' pushed
if [ "x$GL_REPO" == 'xbrowserid' ] ; then
# create a temporary directory where we'll stage new code
NEWCODE=
`mktemp -d`
echo "staging code to $NEWCODE"
mkdir -p $NEWCODE
git archive --format=tar dev | tar -x -C $NEWCODE
echo "generating production resources"
cd $NEWCODE/browserid && ./compress.sh && cd -
# stop the servers
curl -o --url http://localhost:62700/code_update > /dev/null 2>&1
curl -o --url http://localhost:62800/code_update > /dev/null 2>&1
# now move code into place, and keep a backup of the last code
# that was in production in .old
echo "moving updated code into place"
rm -rf /home/browserid/code.old
mv /home/browserid/code{,.old}
mv $NEWCODE /home/browserid/code
echo "fixing permissions"
find /home/browserid/code -exec chgrp www-data {} \; > /dev/null 2>&1
find /home/browserid/code -type d -exec chmod 0775 {} \; > /dev/null 2>&1
find /home/browserid/code -type f -exec chmod ga+r {} \; > /dev/null 2>&1
find /home/browserid/code -type f -perm /u+x -exec chmod g+x {} \; > /dev/null 2>&1
echo "updating dependencies"
ln -s /home/browserid/node_modules /home/browserid/code/node_modules
cd /home/browserid/code && npm install && cd -
fi
</pre>
### 6. Get node servers running
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment