-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
70 changed files
with
2,350 additions
and
139 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 |
---|---|---|
@@ -1,24 +1,60 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/ubuntu | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/docker-existing-dockerfile | ||
{ | ||
"name": "Ubuntu", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04 | ||
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon. | ||
"args": { "VARIANT": "ubuntu-22.04" } | ||
"args": { | ||
"VARIANT": "ubuntu-22.04" | ||
} | ||
}, | ||
|
||
|
||
// Sets the run context to one level up instead of the .devcontainer folder. | ||
"context": "..", | ||
|
||
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. | ||
"dockerFile": "../Dockerfile", | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "uname -a", | ||
|
||
"forwardPorts": [3000], | ||
|
||
// Uncomment the next line to run commands after the container is created - for example installing curl. | ||
// "postCreateCommand": "apt-get update && apt-get install -y curl", | ||
|
||
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust | ||
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], | ||
|
||
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker. | ||
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], | ||
|
||
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode", | ||
|
||
"features": { | ||
"terraform": "1.0", | ||
"aws-cli": "latest" | ||
} | ||
}, | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"python.linting.pylintEnabled": false, | ||
"python.linting.flake8Enabled": true, | ||
"python.linting.enabled": true, | ||
"terraform.languageServer.args": [ | ||
"-port 3000" | ||
], | ||
"terraform.languageServer.tcp.port": 3000 | ||
}, | ||
|
||
"extensions": [ | ||
"hashicorp.terraform", | ||
"redhat.vscode-yaml", | ||
"ms-python.python", | ||
"mutantdino.resourcemonitor" | ||
], | ||
|
||
// Hack for terraform-ls | ||
// "postStartCommand": "nohup bash -c '/home/vscode/.vscode-server/extensions/hashicorp.terraform-2.24.1-linux-arm64/bin/terraform-ls serve -port 3000 &'" | ||
|
||
} |
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,6 @@ | ||
[flake8] | ||
max-line-length = 90 | ||
max-complexity = 10 | ||
exclude = | ||
__pycache__ | ||
.venv |
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,3 @@ | ||
* text=auto eol=lf | ||
*.{cmd,[cC][mM][dD]} text eol=crlf | ||
*.{bat,[bB][aA][tT]} text eol=crlf |
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,64 @@ | ||
name: main | ||
|
||
on: [workflow_dispatch, pull_request] | ||
|
||
env: | ||
AWS_REGION: eu-west-1 | ||
AWS_ROLE: cat-genrl-prd-infra-gh-tf-aws-github-runners | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
python_lint: | ||
name: 🐍 Python file formatting | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- run: | | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
pip install -r requirements.txt | ||
flake8 | ||
black . | ||
terraform_lint: | ||
name: 🏗 Terraform file format | ||
runs-on: self-hosted | ||
steps: | ||
- uses: hashicorp/setup-terraform@v2 | ||
- uses: dflook/terraform-fmt-check@v1 | ||
with: | ||
path: . | ||
|
||
testing: | ||
needs: [python_lint, terraform_lint] | ||
name: ✅ Testing | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-region: ${{ env.AWS_REGION }} | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
role-to-assume: ${{ env.AWS_ROLE }} | ||
role-duration-seconds: 3600 | ||
- uses: actions/setup-python@v2 | ||
- uses: hashicorp/setup-terraform@v2 | ||
- name: Install tests | ||
run: | | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
pip install -r requirements.txt | ||
pre-commit install | ||
- name: Execute tests | ||
run: | | ||
source .venv/bin/activate | ||
pre-commit run | ||
pytest --run-id ${{ github.run_id }} | ||
env: | ||
PYTEST_ADDOPTS: "--color=yes" | ||
timeout-minutes: 30 |
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.
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 |
---|---|---|
|
@@ -17,7 +17,7 @@ on: | |
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
runs-on: self-hosted | ||
# Skip running release workflow on forks | ||
if: github.repository_owner == 'cloudandthings' | ||
steps: | ||
|
@@ -37,4 +37,4 @@ jobs: | |
@semantic-release/[email protected] | ||
[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Oops, something went wrong.