Skip to content

Commit

Permalink
Inline Docker commands (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
jashparekh authored Sep 13, 2021
1 parent dc6de90 commit f88707a
Show file tree
Hide file tree
Showing 22 changed files with 145 additions and 242 deletions.
1 change: 0 additions & 1 deletion .env

This file was deleted.

2 changes: 1 addition & 1 deletion .github/actions/install-dependencies/action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ python -m pip install --upgrade pip

if [[ "${INSTALL_REQUIREMENTS}" == "true" ]]; then
echo "Installing code requirements"
pip install -r requirements.lock
pip install -r requirements.txt
fi

if [[ "${INSTALL_TEST_REQUIREMENTS}" == "true" ]]; then
Expand Down
30 changes: 0 additions & 30 deletions .github/actions/publish_images

This file was deleted.

4 changes: 0 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,4 @@ Please run through before submitting for final review:
- [ ] The PR title is descriptive of what changed.
- [ ] The description sections above are filled out.
- [ ] The CI pipeline is passing
- [ ] The plugin version has been bumped (using [SemVer](https://semver.org/spec/v2.0.0.html))

The plugin version should be bumped both in `.env` and in the README. **The plugin version is listed multiple times in the readme. Be sure to do a find/replace to ensure you haven't missed any!**

- [ ] Added the `ready-for-review` label to the PR.
10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
test-requirements: "true"

- name: Run bandit
run: bandit --ini .bandit -r deploy.py
run: bandit --ini .bandit -r plugin_scripts/deploy.py

black:
runs-on: ubuntu-latest
Expand All @@ -55,7 +55,7 @@ jobs:
test-requirements: "true"

- name: Run black
run: black --check deploy.py tests/test_deploy.py
run: black --check plugin_scripts/deploy.py tests/test_deploy.py

flake8:
runs-on: ubuntu-latest
Expand All @@ -72,7 +72,7 @@ jobs:
test-requirements: "true"

- name: Run flake8
run: flake8 deploy.py tests/test_deploy.py
run: flake8 plugin_scripts/deploy.py tests/test_deploy.py

isort:
runs-on: ubuntu-latest
Expand All @@ -89,7 +89,7 @@ jobs:
test-requirements: "true"

- name: Run isort
run: isort --recursive --check-only deploy.py tests/test_deploy.py
run: isort --recursive --check-only plugin_scripts/deploy.py tests/test_deploy.py

mypy:
runs-on: ubuntu-latest
Expand All @@ -106,4 +106,4 @@ jobs:
test-requirements: "true"

- name: Run mypy
run: mypy deploy.py tests/test_deploy.py
run: mypy plugin_scripts/deploy.py tests/test_deploy.py
15 changes: 0 additions & 15 deletions .github/workflows/publish.yml

This file was deleted.

17 changes: 7 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ on:
push:
branches: ["main"]

env:
PYTHON_VERSION: "3.9.1"

jobs:
test:
name: Buildkite Plugin Bash Tests
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- run: docker-compose run --rm test

py-test:
name: Buildkite Plugin Pytest
name: Pytest
runs-on: ubuntu-latest
steps:
- name: Check out code
Expand All @@ -28,7 +24,7 @@ jobs:
test-requirements: "true"

- name: Run pytest
run: pytest --cov deploy tests/test_deploy.py --cov-report xml:coverage-${{ env.PYTHON_VERSION }}.xml --junitxml=test-results-${{ env.PYTHON_VERSION }}.xml
run: pytest --cov plugin_scripts/ tests/test_deploy.py --cov-report xml:coverage-${{ env.PYTHON_VERSION }}.xml --junitxml=test-results-${{ env.PYTHON_VERSION }}.xml

- name: Upload pytest test results artifact
uses: actions/upload-artifact@v2
Expand All @@ -49,5 +45,6 @@ jobs:
- name: Publish coverage results to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage-${{ env.PYTHON_VERSION }}.xml
fail_ci_if_error: true
fail_ci_if_error: true
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.0] - 2021-09-12

### Added

Inline Docker

## [0.1.0] - 2021-07-14

### Added
Expand Down
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If the version number is not provided then the most recent version of the plugin
```yaml
steps:
- plugins:
- wayfair-incubator/bigquery#v0.1.0:
- wayfair-incubator/bigquery#v0.2.0:
gcp_project: gcp-us-project
dataset_schema_directory: schemas/gcp-us-project/dataset
```
Expand All @@ -40,14 +40,6 @@ The directory in your repository where are you storing the schemas for your tabl

Example: `gcp-us-project/dataset_name`

### `plugin_image_version` (optional, string)

**ONLY to be used when testing feature branch changes to this plugin from another pipeline**

The full hash for the latest commit to your feature branch for this plugin. This should match the plugin 'version' you are referencing in your test pipeline.

Example: `1e602649cebf27b16dc45177ef1552b068fd2f8e`

## Secret

This plugin expects `GCP_SERVICE_ACCOUNT` is placed as environment variable. Make sure to store it [securely](https://buildkite.com/docs/pipelines/secrets)!
Expand Down
4 changes: 0 additions & 4 deletions deploy.sh

This file was deleted.

1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ services:
lock-requirements:
<<: *bigquery-buildkite-plugin
entrypoint: "/bin/bash"
user: root
command: "docker/lock_requirements.sh"

volumes:
Expand Down
2 changes: 1 addition & 1 deletion docker/devbox.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ USER ${_USER}
COPY --chown=${UID}:${GID} ./requirements* /app/
WORKDIR /app

RUN pip install -r requirements.lock -r requirements-test.txt
RUN pip install -r requirements.txt -r requirements-test.txt

CMD bash
4 changes: 2 additions & 2 deletions docker/lock_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pip uninstall -y -r <(pip freeze)
pip install -r requirements.txt
printf "# THIS IS AN AUTOGENERATED LOCKFILE. DO NOT EDIT MANUALLY.\n" >requirements.lock
pip freeze --disable-pip-version-check --all >>requirements.lock
printf "# THIS IS AN AUTOGENERATED LOCKFILE. DO NOT EDIT MANUALLY.\n" >plugin_scripts/requirements.lock
pip freeze --disable-pip-version-check --all >>plugin_scripts/requirements.lock

echo "Rebuild containers to verify there are no conflicts."
12 changes: 6 additions & 6 deletions docker/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ while [[ $# -gt 0 ]]; do
done

# only generate html locally
pytest --cov deploy tests/test_deploy.py --cov-report html
pytest --cov plugin_scripts/ tests/test_deploy.py --cov-report html

echo "Running MyPy..."
mypy deploy.py tests/test_deploy.py
mypy plugin_scripts/deploy.py tests/test_deploy.py

echo "Running black..."
black ${BLACK_ACTION} deploy.py tests/test_deploy.py
black ${BLACK_ACTION} plugin_scripts/deploy.py tests/test_deploy.py

echo "Running iSort..."
isort ${ISORT_ACTION} deploy.py tests/test_deploy.py
isort ${ISORT_ACTION} plugin_scripts/deploy.py tests/test_deploy.py

echo "Running flake8..."
flake8 deploy.py tests/test_deploy.py
flake8 plugin_scripts/deploy.py tests/test_deploy.py

echo "Running bandit..."
bandit --ini .bandit --quiet -r deploy.py
bandit --ini .bandit --quiet -r plugin_scripts/deploy.py
44 changes: 0 additions & 44 deletions docker/service.dockerfile

This file was deleted.

Loading

0 comments on commit f88707a

Please sign in to comment.