-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into hotfix/#183
- Loading branch information
Showing
9 changed files
with
180 additions
and
55 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 @@ | ||
#!/bin/bash | ||
|
||
# Do not use `set -x` here as then it displays the PYPIPW in logs | ||
set -e | ||
|
||
# Get environment variables, readily decrypted by rultor | ||
source ../rultor_github_secrets.sh | ||
|
||
# Make sure the user is a maintainer | ||
response=$(curl "https://api.github.com/teams/1238757/memberships/${author}?access_token=${GITHUB_TOKEN}") | ||
echo "$response" | ||
if echo "$response" | grep -q "Not Found"; then | ||
echo "@${author} is not in the maintainers group." | ||
exit 1 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-----BEGIN PGP MESSAGE----- | ||
|
||
hQEMA5qETcGag5w6AQf/apsbE6KJcSn8JlJBc6mLdTdVdQcTaeQOTNDdrYUVXRlp | ||
e/kDaOk+34+JyWJEKreIXXUNNEwmJ4qkDUCBBniiIhq1oT1Ch5125JdM8oKqnG/l | ||
+2tquYrjTf5MueCKepd1VMYs7caw5o1hLyEROzPxoP+MDOwglKurOdAhAjZ8+Gt0 | ||
spRwp5+cIgRQTh8tnXpP8LiOdCiuPVicCrHcT5wFJfS1krk9lxFdzRFqn3GTosHo | ||
23I2OoVVqLQB5ZdZe4MOR0IA3UZWwVHAz27PVrV4I2qVlJXdfkSkXSVxJRG8jtaK | ||
rehbOaT304l9mqGYAKd/+nd1DtJTc0rfynCpPP8T/NLAbQEFT4Nafb2OZ/YIlulP | ||
34QBkky62Z2kl8L9uZeygSgPcjt1G5aNMnNgVv71ObsjKFPF9sPDMwqyhJ7e2ZC0 | ||
0+7m6Ern+V9swEHW83cDVORRgbq2IuZt6a8MUfQafUp6wn56PuARdsbmEBgqgD/X | ||
qq8qc5Wsw5VjIN9sHq7bqPtP51RwTLnp3MoaVV4MmfZh1MhE94zkHrQDGxSuwLJP | ||
hi0uJPTPKWOD4s5edB3XQMSJIDUJnMTdDzTG9KnEV8CGlkMyEslFLBnlofsQP2sM | ||
7SbGqG5q+8obt2T+S/sYhQAXAN4s9NM/l8yjI13XD1rcCN4bwx/O0TMOPtoYnnC9 | ||
L6EpSsQolNyCGg6uHNOlejopE2fxpvOn8XOPmxApUBXQINtmXNeRzJzv8pfoYr0= | ||
=LwCm | ||
-----END PGP MESSAGE----- |
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,8 +1,15 @@ | ||
[shell] | ||
files = hooks/*, tests/*.sh | ||
bears = LineLengthBear, SpaceConsistencyBear, ShellCheckBear | ||
shell = bash | ||
max_line_length = 79 | ||
use_spaces = True | ||
|
||
[commit] | ||
bears = GitCommitBear | ||
shortlog_trailing_period = False | ||
shortlog_regex = ([^:]*|\S+: [A-Z0-9*].*) | ||
shortlog_regex = ([^:]*|[^:]+[^ ]: [A-Z0-9*].*) | ||
|
||
[yml] | ||
bears = YAMLLintBear | ||
files = *.yml, hooks/*.yml | ||
files = *.yml, hooks/*.yml |
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 @@ | ||
rultor_github_secrets.sh |
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,3 +1,7 @@ | ||
merge: | ||
fast-forward: only | ||
script: echo "Nothing to do." | ||
script: | ||
- bash .ci/check_maintainership.sh | ||
|
||
decrypt: | ||
rultor_github_secrets.sh: "repo/.ci/rultor_github_secrets.sh.asc" |
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,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e -x | ||
|
||
if [[ "${IMAGE_NAME/:/}" == "${IMAGE_NAME}" ]]; then | ||
# DockerCloud uses :this for pull requests | ||
IMAGE_NAME="${IMAGE_NAME}:this" | ||
fi | ||
|
||
ROCKER="$(which rocker | true)" | ||
|
||
if [[ -z "$TOOL" ]]; then | ||
if [[ -n "$ROCKER" ]]; then | ||
TOOL="$ROCKER" | ||
else | ||
TOOL=docker | ||
fi | ||
fi | ||
|
||
if [[ "${TOOL%docker}" != "$TOOL" ]]; then | ||
TOOL_ARGS="-t $IMAGE_NAME" | ||
elif [[ "${TOOL%rocker}" != "$TOOL" ]]; then | ||
TOOL_ARGS="--var image=$IMAGE_NAME" | ||
sed -i 's/^# rocker \([A-Z]*\) /\1 /' Dockerfile | ||
fi | ||
|
||
COALA_BRANCH=$(python guess_branch.py "$SOURCE_BRANCH") | ||
|
||
echo Building coala branch $COALA_BRANCH for docker branch $SOURCE_BRANCH | ||
echo "Building coala branch $COALA_BRANCH for docker branch $SOURCE_BRANCH" | ||
echo "as image ${IMAGE_NAME}, using ${TOOL} on $(uname -a)." | ||
|
||
docker build -f Dockerfile --build-arg=branch=$COALA_BRANCH -t $IMAGE_NAME . | ||
$TOOL build \ | ||
-f Dockerfile \ | ||
--build-arg=branch="$COALA_BRANCH" \ | ||
$TOOL_ARGS . |
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,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e -x | ||
|
||
# Docker Cloud doesnt set USER | ||
export USER=${USER:-root} | ||
|
||
# Run tests | ||
docker run -i --volume="$(pwd)/tests:/work" "$IMAGE_NAME" /bin/sh -c " | ||
set -e -x; | ||
/work/pytest.sh; | ||
/work/vcs.sh; | ||
/work/opensuse.sh; | ||
" | ||
|
||
# Verify MarkdownBear works outside of coala-bears directory. | ||
# See https://github.com/coala/coala-bears/issues/1235 | ||
docker run -i "$IMAGE_NAME" /bin/sh -c " | ||
set -e -x; | ||
cd /tmp; | ||
echo foo > foo.md; | ||
coala --non-interactive --no-config --bears MarkdownBear --files foo.md; | ||
" | ||
|
||
# Verify that image fails in neither a command or work directory are given. | ||
! docker run "$IMAGE_NAME" | ||
|
||
# Verify that a missing .coafile in the work directory causes coala-quickstart | ||
# to be run, creating a .coafile that is visible outside of the container. | ||
docker run --volume="$(pwd)/.ci/sample:/work" --workdir=/work "$IMAGE_NAME" | ||
ls -la ./.ci/sample/.coafile | ||
|
||
# Verify a .coafile present causes coala-ci to run, with a custom bears loaded, | ||
# and a non-zero exit status occurs when a bear emits a result. | ||
sudo chown "$USER" ./.ci/sample/.coafile | ||
echo -e "[fail]\nbears = NoCommentsBear\nfile = **.py" >> ./.ci/sample/.coafile | ||
! docker run --volume="$(pwd)/.ci/sample:/work" \ | ||
--volume="$(pwd)/.ci/bears:/additional_bears" \ | ||
--workdir=/work "$IMAGE_NAME" | ||
|
||
# Run coala | ||
# https://github.com/coala/coala-bears/issues/1037 | ||
if [[ "$TRAVIS" == "true" && "$TRAVIS_PULL_REQUEST" != "false" ]]; then | ||
sed -i.bak '/bears = GitCommitBear/d' .coafile | ||
fi | ||
|
||
docker run --volume="$(pwd):/work" --workdir=/work "$IMAGE_NAME" |