Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-ora2
Commits
99821fd0
Commit
99821fd0
authored
Apr 17, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the release script to create a tag but not a branch
parent
d34b5178
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
24 deletions
+70
-24
scripts/release.sh
+41
-24
scripts/sandbox-commit.sh
+29
-0
No files found.
scripts/release.sh
View file @
99821fd0
#!/usr/bin/env bash
# Use YYYY-MM-DD format
DATE
=
`
date +%Y-%m-%d
`
###################################################################
#
# Create a new tag for a release of edx-ora2 and
# push it to the remote.
#
# Release tags have a uniform naming scheme that includes
# the current date.
#
# Usage:
#
# ./release.sh COMMIT
#
# If no commit is specified, use origin/master.
#
# Examples:
#
# Create a release tag for origin/master:
# ./release.sh
#
# Create a release tag for a specific commit:
# ./release.sh f921f3ee4bc07edf2f1b492f94350cb1dd844100
#
# Create a release tag without user input:
# yes | ./release.sh
#
###################################################################
read
-p
"Cut the release branch? (You may lose changes that are not committed or stashed.) [y/n] "
RESP
# Use YYYY-MM-DD-HH:MM format (UTC)
DATE
=
`
date
-u
+%Y-%m-%dT%H.%M
`
read
-p
"Create the release candidate? (You may lose changes that are not committed or stashed.) [y/n] "
RESP
if
[
"
$RESP
"
!=
"y"
]
;
then
exit
0
fi
echo
"Updating origin/master..."
git fetch
&&
git checkout
-q
origin/master
git fetch
echo
"Creating the release branch..."
BRANCH
=
"rc/
$DATE
"
git branch |
grep
-q
"
$BRANCH
$"
if
[
$?
-eq
0
]
;
then
read
-p
"Branch
$BRANCH
already exists. Delete it? [y/n] "
RESP
if
[
"
$RESP
"
=
"y"
]
;
then
echo
"Deleting
$BRANCH
"
git branch
-D
$BRANCH
else
exit
0
fi
# If no commit is specified, use origin/master
if
[
-z
"
$1
"
]
;
then
git checkout
-q
origin/master
||
exit
1
else
git checkout
-q
$1
||
exit
1
fi
git checkout
-b
$BRANCH
echo
" == Created branch
$BRANCH
"
echo
"Tagging the release branch..."
echo
"Tagging the release candidate..."
TAG
=
"release-
$DATE
"
git tag |
grep
-q
"
$TAG
"
if
[
$?
-eq
0
]
;
then
read
-p
"Tag
$TAG
already exists. Delete it? [y/n] "
RESP
read
-p
"Tag
$TAG
already exists. Delete it
and create a new one
? [y/n] "
RESP
if
[
"
$RESP
"
=
"y"
]
;
then
echo
"Deleting
$TAG
"
git tag
-d
$TAG
...
...
@@ -43,13 +61,12 @@ fi
git tag
-m
"release for
$DATE
"
"
$TAG
"
echo
" == Created tag
$TAG
"
read
-p
"Push
branch
$BRANCH
and
tag
$TAG
to origin? [y/n] "
RESP
read
-p
"Push tag
$TAG
to origin? [y/n] "
RESP
if
[
"
$RESP
"
=
"y"
]
;
then
git push origin
$
BRANCH
&&
git push origin
$
TAG
echo
" == Pushed
branch
$BRANCH
and
tag
$TAG
to origin"
git push origin
$TAG
echo
" == Pushed tag
$TAG
to origin"
fi
echo
" == Finished =="
echo
"Branch:
$BRANCH
"
echo
"Tag:
$TAG
"
echo
"Commit:
`
git rev-parse HEAD
`
"
scripts/sandbox-commit.sh
0 → 100755
View file @
99821fd0
#!/usr/bin/env bash
###################################################################
#
# Echo the commit that is deployed to a sandbox.
#
# Usage:
#
# ./sandbox-commit.sh SSH_HOST [SSH_KEY]
#
# Examples:
#
# ./sandbox-commit.sh user@example.com
# ./sandbox-commit.sh user@example.com /home/user/.ssh/id_rsa
#
###################################################################
if
[
$#
-lt
1
]
;
then
echo
"Usage:
$0
SSH_HOST [SSH_KEY]"
exit
1
fi
if
[
-z
"
$2
"
]
;
then
SSH_CMD
=
"ssh
$1
"
else
SSH_CMD
=
"ssh
$1
-i
$2
"
fi
$SSH_CMD
'cd /edx/app/edxapp/venvs/edxapp/src/edx-ora2 && git rev-parse HEAD'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment