Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: ci improvements #2515

Merged
merged 2 commits into from
Nov 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,50 @@ jobs:
- store_artifacts:
path: /root/sd/junit

staging-test-with-rebase:
docker:
- image: quay.io/freedomofpress/circleci-docker:latest
environment:
FPF_CI: true
CI_SD_ENV: staging
CI_AWS_TYPE: t2.medium
FPF_GRSEC: false
TEST_REPORTS: /root/sd
working_directory: ~/sd

steps:

- checkout

- run:
name: Installation pre-reqs
command: pip install -U -r ./testinfra/requirements.txt

- run:
name: Check Python dependencies for CVEs
command: make safety

- setup_remote_docker

- run:
name: Run Debian builds
command: make build-debs

- run:
name: Provision staging servers and run tests
command: make ci-go

- run:
name: Ensure environment torn down
command: molecule destroy -s aws
when: on_fail

- store_test_results:
path: /root/sd/junit

- store_artifacts:
path: /root/sd/junit

workflows:
version: 2
securedrop_ci:
Expand All @@ -76,3 +120,6 @@ workflows:
- staging-test:
requires:
- docs-lint
- staging-test-with-rebase:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this is a good practice (running tests both on their own branch and rebasing on the target branch - this is what we do for Travis tests as well).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though this increases costs so @msheiny/@conorsch happy to re-evaluate later this week

requires:
- docs-lint
7 changes: 5 additions & 2 deletions devops/scripts/rebase-develop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ if [[ "$CIRCLE_BRANCH" != "master" && "$CIRCLE_BRANCH" != release* ]]; then
git config --global user.email "[email protected]"
git config --global user.name "CI User"

# Ensure presensce of upstream remote
git ls-remote --exit-code --quiet upstream 2>/dev/null || git remote add upstream https://github.com/freedomofpress/securedrop.git

# Fetch and rebase onto the latest in develop
git fetch origin develop
git rebase origin/develop
git fetch upstream develop
git rebase upstream/develop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, good call 👍


# Print out the current head for debugging potential CI issues
git rev-parse HEAD
Expand Down