Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 deploy toil_example on every new commit (#10)
* 🚀 add logic to deploy toil example * 🐛 fix git command * 📝 add credits to generated README * 🔧 skip example deployment if GH_TOKEN is unset * 🔧 make sure toil_example starts from scratch * 🔧 symlink .gitmessage * 🔧 no need for -f with cookiecutter * 🐛 force branch and push in example deployment
- Loading branch information
1 parent
fddd774
commit a25a37a
Showing
11 changed files
with
94 additions
and
70 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 @@ | ||
{{cookiecutter.project_slug}}/.gitmessage |
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,35 @@ | ||
if [ -z "$GH_TOKEN" ]; then | ||
echo "No GH token available, skipping toil_example deployment..." | ||
exit 0 | ||
fi | ||
|
||
DEPLOY_REPO_URL=https://${GH_TOKEN}@github.com/leukgen/toil_example.git | ||
DEPLOY_BASE_DIR=/tmp/toil_example_deploy | ||
DEPLOY_TEMP_DIR=/tmp/toil_example_deploy/_toil_example | ||
DEPLOY_REPO_DIR=/tmp/toil_example_deploy/toil_example | ||
DEPLOY_REPO_BRA=${TRAVIS_PULL_REQUEST_BRANCH:="$TRAVIS_BRANCH"} | ||
|
||
git config --global user.email "travis@travis-ci.org" | ||
git config --global user.name "Travis CI" | ||
|
||
if [ "$DEPLOY_TOIL_EXAMPLE" = "true" ]; then | ||
mkdir $DEPLOY_BASE_DIR && cd $DEPLOY_BASE_DIR | ||
git clone $DEPLOY_REPO_URL $DEPLOY_REPO_DIR | ||
|
||
echo "checking out to current branch: $DEPLOY_REPO_BRA" | ||
cd $DEPLOY_REPO_DIR && git checkout -B $DEPLOY_REPO_BRA | ||
|
||
echo "force creating cookiecutter..." | ||
cd $DEPLOY_BASE_DIR && mv $DEPLOY_REPO_DIR $DEPLOY_TEMP_DIR | ||
cookiecutter $TRAVIS_BUILD_DIR --no-input -o $DEPLOY_BASE_DIR | ||
|
||
echo "moving back .git directory to repo..." | ||
mv $DEPLOY_TEMP_DIR/.git $DEPLOY_REPO_DIR | ||
cd $DEPLOY_REPO_DIR && git add . | ||
|
||
echo "pushing changes: 🤖 travis build $TRAVIS_BUILD_NUMBER..." | ||
git commit --message "🤖 travis build $TRAVIS_BUILD_NUMBER" | ||
git push -u --force origin $DEPLOY_REPO_BRA | ||
else | ||
echo "DEPLOY_TOIL_EXAMPLE not set to true, skipping..." | ||
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
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,9 +1,9 @@ | ||
{ | ||
"full_name": "John Smith", | ||
"email": "smithj@mskcc.org", | ||
"full_name": "Juan S. Medina, Juan E. Arango", | ||
"email": "medinaj@mskcc.org", | ||
"github_account": "leukgen", | ||
"cli_type": ["toil", "click"], | ||
"project_name": "test_project", | ||
"project_name": "toil_example", | ||
"project_slug": "{{ cookiecutter.project_name.lower()|replace(' ', '_')|replace('-', '_') }}", | ||
"project_description": "An awesome python package." | ||
"project_description": "A Command Line Interface created with [cookiecutter-toil](https://github.com/leukgen/cookiecutter-toil)." | ||
} |
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