-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Showing
17 changed files
with
201 additions
and
10 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
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
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
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
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,10 @@ | ||
class DodonaGitError < StandardError | ||
attr_reader :repository, | ||
:errorstring | ||
|
||
def initialize(repository, error) | ||
super() | ||
@repository = repository | ||
@errorstring = error.to_s | ||
end | ||
end |
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,15 @@ | ||
<div class="message"> | ||
<%= content_tag :p, t('.greeting', name: @name) %> | ||
<%= content_tag :p, t( | ||
'.error_message', | ||
repository: @error.repository.name, | ||
error: @error.errorstring | ||
) %> | ||
|
||
<%= content_tag :p, t('.hint') %> | ||
|
||
<%= content_tag :p, t('.regards') %> | ||
<p>Team Dodona</p> | ||
|
||
<%= content_tag :p, t('.auto-generated') %> | ||
</div> |
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,11 @@ | ||
<%= t '.greeting', name: @name %> | ||
<%= t '.error_message', | ||
repository: @error.repository.name, | ||
error: @error.errorstring %> | ||
|
||
<%= t '.hint' %> | ||
|
||
<%= t '.regards' %> | ||
Team Dodona | ||
|
||
<%= t '.auto-generated' %> |
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,74 @@ | ||
#!/usr/bin/env bash | ||
# exit when any command fails | ||
set -e | ||
# keep track of the last executed command | ||
current_command=$BASH_COMMAND | ||
last_command=$current_command | ||
trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG | ||
# echo an error message before exiting | ||
trap '[ $? -eq 0 ] || echo "\"${last_command}\" command failed with exit code $?."' EXIT | ||
|
||
if [ "$#" -ne 1 ] | ||
then | ||
>&2 echo "Expected exactly 1 argument" | ||
>&2 echo "usage \`bin/release [version]\`" | ||
>&2 echo "version should be of the format MAJOR.MINOR.PATCH" | ||
>&2 echo "example \`bin/release 5.6.4\`" | ||
exit 1 | ||
fi | ||
|
||
# first and only argument is version | ||
version=$1 | ||
# get major, minor and patch as an array | ||
readarray -d . -t version_array< <(printf '%s' "$version") | ||
|
||
if [ "${#version_array[@]}" -ne 3 ] | ||
then | ||
>&2 echo "expected version to contain major minor and patch" | ||
>&2 echo "usage \`bin/release [version]\`" | ||
>&2 echo "version should be of the format MAJOR.MINOR.PATCH" | ||
>&2 echo "example \`bin/release 5.6.4\`" | ||
exit 1 | ||
fi | ||
|
||
# Make sure you have the latest commits | ||
git checkout master | ||
git pull | ||
git checkout develop | ||
git pull | ||
|
||
# Start release | ||
git flow release start "$version" | ||
sed -i "s/MAJOR = [0-9]\+/MAJOR = ${version_array[0]}/g" config/initializers/00_version.rb | ||
sed -i "s/MINOR = [0-9]\+/MINOR = ${version_array[1]}/g" config/initializers/00_version.rb | ||
sed -i "s/PATCH = [0-9]\+/PATCH = ${version_array[2]}/g" config/initializers/00_version.rb | ||
git commit -am "Bump version" | ||
|
||
# Double check that all tests succeed | ||
bundle install | ||
yarn install | ||
bin/rake css:build # Build css before testing | ||
bin/rake javascript:build # Build javascript before testing | ||
bundle exec rails test | ||
bundle exec rails test:system | ||
yarn test | ||
|
||
# Finish release | ||
git flow release finish "$version" | ||
|
||
# Allow abort before push | ||
echo -n "Next step will push, press A to abort, any key to continue" | ||
read -r confirm | ||
if [ "$confirm" == "A" ] || [ "$confirm" == "a" ] | ||
then | ||
exit | ||
fi | ||
|
||
# Push local changes | ||
git push | ||
git checkout master | ||
git push | ||
git push --tags | ||
|
||
# Deploy | ||
cap production deploy |
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
en: | ||
repositories: | ||
form: | ||
remote_help: "The SSH clone URL of the judge repository. Dodona needs access rights to the repository to be able to clone it." | ||
remote_help: "The SSH clone URL of the exercise repository. Dodona needs read and write permissions to use the repository." | ||
judge_help: "This judge will be used when the exercise doesn't specify one." | ||
remote_cant_be_edited_html: The clone URL can't be edited after the repository was created. Contact <a href="mailto:[email protected]">[email protected]</a> if it needs to be changed. | ||
index: | ||
|
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
nl: | ||
repositories: | ||
form: | ||
remote_help: "De SSH 'clone url' van de repository waar de oefeningen te vinden zijn. Dodona heeft de juiste rechten nodig om de repository te kunnen clonen." | ||
remote_help: "De SSH 'clone url' van de repository waar de oefeningen te vinden zijn. Dodona heeft lees- en schrijfrechten nodig om de repository te gebruiken." | ||
judge_help: "Deze judge zal gebruikt worden als de oefening zelf geen specifieert." | ||
remote_cant_be_edited_html: De clone URL kan niet aangepast worden nadat de repository werd aangemaakt. Contacteer <a href="mailto:[email protected]">[email protected]</a> als het toch aangepast moet worden. | ||
index: | ||
|
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