-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v4.5.1 Support running inside Docker (#115)
* Refactor and improve how config and options are read * Replace tslint with ESLint * Cleanup types * Re-organize files * Move into `/services` * Use accessToken instead of ssh keys * Move postinstall to src files * Improve spinners * Add test for postinstall script * Add Dockerfile and bash helper function * Use `never` to require generic * Rename prompts * Remove wildcard imports (`* as something`) * Add test for `getBranches` * Add test for options * Minor fixes * Fix typo * v4.4.2-docker-alpha-0.1 * Disallow empty strings in validateOptions * 4.5.0-beta.1 * Ensure gitconfig is mounted * Simplify package.json * Update deps * Rename to pre-push * Add docs for running with docker * Move docker help to readme * Remove link to docker docs * Update readme * Rename `pullRequest` to `pullNumber` * Rename `branch` to `baseBranch` * 4.5.0-beta.2 * 4.5.0 * 4.5.1
- Loading branch information
Showing
76 changed files
with
2,571 additions
and
2,096 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,15 @@ | ||
module.exports = { | ||
plugins: ['@typescript-eslint'], | ||
parser: '@typescript-eslint/parser', // Specifies the ESLint parser | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin | ||
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier | ||
'plugin:prettier/recommended' // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. | ||
], | ||
rules: { | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/no-use-before-define': 'off', | ||
'@typescript-eslint/camelcase': 'off', | ||
'@typescript-eslint/explicit-member-accessibility': 'off' | ||
} | ||
}; |
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,6 +1,6 @@ | ||
/node_modules | ||
/coverage | ||
/.coveralls.yml | ||
/test/.DS_Store | ||
/dist | ||
/yarn-error.log | ||
.DS_Store |
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,11 @@ | ||
# Build command: `docker build -t sqren/backport .` | ||
FROM node:latest | ||
|
||
RUN mkdir /app | ||
WORKDIR /app | ||
|
||
COPY ./entrypoint.sh /entrypoint.sh | ||
|
||
RUN npm install backport -g | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
CMD [] |
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,18 @@ | ||
# Example usage: | ||
# With .backport/config.json mounted: | ||
# - `backport` | ||
# Without .backport/config.json mounted: | ||
# `backport --username sqren --accessToken myGithubAccessToken --upstream elastic/kibana` | ||
backport() { | ||
BACKPORT_FOLDER=~/.backport | ||
GITCONFIG=~/.gitconfig | ||
|
||
# -it: interactive shell | ||
# --rm: remove container after exit | ||
# -v: Mounts the following volumes: | ||
# - current directory as read-only volume (to access .backportrc.json) | ||
# - .backport folder (to access config.json and avoid re-cloning repos) | ||
# - gitconfig (to apply correct username and email to cherry-picked commits) | ||
# "$@": pass all bash arguments to docker (which into turn passes them to backport cli inside container) | ||
docker run -it --rm -v $(pwd):/app:ro -v $BACKPORT_FOLDER:/root/.backport -v $GITCONFIG:/etc/gitconfig sqren/backport "$@" | ||
} |
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 @@ | ||
#!/bin/bash | ||
|
||
EMAIL=$(git config --system user.email) | ||
NAME=$(git config --system user.name) | ||
if test -z "$EMAIL" || test -z "$NAME" | ||
then | ||
echo ".gitconfig must be mounted" | ||
exit 1 | ||
else | ||
backport "$@" | ||
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
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 was deleted.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.