Skip to content

Commit

Permalink
feat(bootstrap): v10.2.1, fnd-dt (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredallard committed Aug 3, 2022
1 parent a0c0133 commit 6a3a496
Show file tree
Hide file tree
Showing 18 changed files with 519 additions and 455 deletions.
226 changes: 72 additions & 154 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,187 +1,105 @@
# Please re-run stencil after any changes to this file as invalid
# syntax, such as anchors, will be fixed automatically.
version: 2.1
orbs:
shared: getoutreach/shared@1.64.3
shared: getoutreach/shared@2.2.0

# DEPRECATED: Use the devbase orb instead:
# https://github.com/getoutreach/devbase/tree/main/orbs/shared
commands:
with_job_span:
parameters:
steps:
type: steps
steps:
- run:
name: DEPRECATION NOTICE
command: echo "with_job_span is deprecated and should be removed"
- steps: << parameters.steps >>
# Extra contexts to expose to all jobs below
contexts: &contexts
- aws-credentials
- ghaccesstoken
- docker-registry
- npm-credentials
- prismacloud-credentials
- opslevel-credentials
- vault-dev
- confluence
###Block(extraContexts)

###EndBlock(extraContexts)

jobs:
{}
###Block(circleJobs)
###EndBlock(circleJobs)

test:
executor:
name: shared/testbed-docker
###Block(circleTestOverride)
###EndBlock(circleTestOverride)
docker:
- image: gcr.io/outreach-docker/bootstrap/ci:stable
auth:
username: _json_key
password: $GCLOUD_SERVICE_ACCOUNT
###Block(customContainers)
###EndBlock(customContainers)
environment:
###Block(testEnvVars)
###EndBlock(testEnvVars)
steps:
- shared/setup_environment
- run:
name: Wait for Infrastructure to be Ready
command: ./scripts/shell-wrapper.sh ci/testing/wait-for-infra.sh
- shared/with_go_cache
- run:
name: Run unit tests
# Store the results of our tests in the $TEST_RESULTS directory
command: make test | tee ${TEST_RESULTS}/go-test.out
- run:
name: Upload Code Coverage
command: ./scripts/shell-wrapper.sh ci/testing/coveralls.sh test
- shared/save_go_cache # We save at the end because binaries are included with this
- shared/upload_test_results # Uploads to CircleCI

finalize-coverage:
executor:
name: shared/testbed-docker
docker:
- image: gcr.io/outreach-docker/bootstrap/ci:stable
auth:
username: _json_key
password: $GCLOUD_SERVICE_ACCOUNT
steps:
- shared/setup_environment
- run:
name: Finish Coveralls upload
command: ./scripts/shell-wrapper.sh ci/testing/coveralls-finish.sh

e2e:
executor:
name: shared/testbed-machine
environment:
VAULT_ADDR: https://vault-dev.outreach.cloud
resource_class: large
steps:
- shared/setup_environment:
machine: true
- shared/with_go_cache
- run:
name: Run E2E Tests
command: KUBECONFIG="$HOME/.outreach/kubeconfig.yaml" make e2e | tee ${TEST_RESULTS}/go-test.out
- run:
name: Upload Code Coverage
command: ./scripts/shell-wrapper.sh ci/testing/coveralls.sh e2e
- shared/save_go_cache # We save at the end because binaries are included with this
- shared/upload_test_results # Uploads to CircleCI

release-dryrun:
executor:
name: shared/testbed-docker
docker_tag: stable
###Block(releaseDryRun)
###EndBlock(releaseDryRun)
steps:
- shared/setup_environment
- shared/with_node_cache:
save: true
- run:
name: Release (Dry-run)
command: ./scripts/shell-wrapper.sh ci/release/dryrun.sh
release:
executor:
name: shared/testbed-docker
docker_tag: stable
###Block(release)
###EndBlock(release)
steps:
- shared/setup_environment
- shared/with_node_cache:
save: true
- run:
name: Release
command: ./scripts/shell-wrapper.sh ci/release/release.sh
###EndBlock(circleJobs)

publish_docs:
executor:
name: shared/testbed-docker
docker_tag: stable
steps:
- shared/setup_environment
- shared/with_go_cache
- run:
name: Publish Documentation
command: ./scripts/shell-wrapper.sh ci/release/docs.sh
### Start jobs inserted by other modules
### End jobs inserted by other modules

workflows:
version: 2
###Block(circleWorkflows)

###EndBlock(circleWorkflows)
build_and_test:

### Start workflows inserted by other modules
### End workflows inserted by other modules

release:
jobs:
###Block(circleWorkflowJobs)

###EndBlock(circleWorkflowJobs)
- release:
context:
- docker-registry
- npm-credentials
- ghaccesstoken
- package-cloud-credentials
### Start jobs inserted by other modules
### End jobs inserted by other modules
- shared/release: &release
dryrun: false
context: *contexts
###Block(circleReleaseExtra)

###EndBlock(circleReleaseExtra)
requires:
- test
###Block(circleReleaseRequires)
###EndBlock(circleReleaseRequires)
###Block(circleReleaseRequires)

###EndBlock(circleReleaseRequires)
- shared/test
filters:
branches:
only:
- master
- main
- release-dryrun:
context:
- docker-registry
- npm-credentials
- ghaccesstoken
- package-cloud-credentials
# Dryrun release for PRs
- shared/release:
<<: *release
dryrun: true
filters:
branches:
ignore:
- master
- main
- test:
context:
- ghaccesstoken
- docker-registry
- npm-credentials
###Block(circleTestContext)
###EndBlock(circleTestContext)
- publish_docs:
context:
- ghaccesstoken
- docker-registry
- confluence
- shared/test:
context: *contexts
app_name: localizer
### Start parameters inserted by other modules
### End parameters inserted by other modules
###Block(circleTestExtra)

###EndBlock(circleTestExtra)

- shared/publish_docs:
context: *contexts
filters:
branches:
ignore: /.*/
tags:
only: /v[0-9]+(\.[0-9]+)*(-.*)*/
- e2e:
context:
- docker-registry
- ghaccesstoken
- vault-dev
- aws-credentials
- finalize-coverage:
context:
- docker-registry
- ghaccesstoken
- shared/finalize-coverage:
context: *contexts
requires:
- e2e
- test
- shared/e2e
- shared/test
- shared/e2e:
context: *contexts
###Block(circleE2EExtra)

###EndBlock(circleE2EExtra)
- shared/docker:
context: *contexts
filters:
branches:
ignore:
- master
- main
tags:
only: /v\d+(\.\d+)*(-.*)*/
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# See https://help.github.com/articles/about-codeowners/
* @getoutreach/fnd-dtss
* @getoutreach/fnd-dt

###Block(customCodeowners)

Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/pull_request-shared-actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Pull Request Shared Actions
on: pull_request

jobs:
conventional_commit:
name: Conventional Commit
uses: getoutreach/actions/.github/workflows/conventional_commit.yaml@main
secrets:
OUTREACH_DOCKER_JSON: ${{ secrets.OUTREACH_DOCKER_JSON }}
4 changes: 4 additions & 0 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ plugins:
- assets:
- "dist/*.tar.gz"
- "dist/checksums.txt"

### Block(customReleasePlugins)

### EndBlock(customReleasePlugins)
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"recommendations": [
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"hashicorp.terraform",
"golang.go",
"heptio.jsonnet",
"xrc-inc.jsonnet-formatter",
Expand All @@ -13,6 +15,7 @@
// Please consider contributing back all recommended
// extensions to bootstrap!
///Block(extensions)

///EndBlock(extensions)
]
}
26 changes: 26 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,34 @@
"go.testEnvFile": "${workspaceRoot}/.vscode/private.env",
"program": "${workspaceRoot}/cmd/localizer/",
"buildFlags": "-tags=or_dev"
},
{
"name": "Attach to dev container",
"type": "go",
"debugAdapter": "dlv-dap",
"request": "attach",
"mode": "remote",
///Block(vscodeRemoteDebug)
"host": "127.0.0.1",
"port": 42097,
///EndBlock(vscodeRemoteDebug)
"substitutePath": [
{
"from": "${workspaceRoot}",
"to": "/home/dev/app"
},
{
"from": "${env:HOME}/.asdf/installs/golang/1.17.9/packages/pkg/mod",
"to": "/tmp/cache/go/mod/"
},
{
"from": "${env:HOME}/.asdf/installs/golang/1.17.9/go/src",
"to": "/home/dev/.asdf/installs/golang/1.17.9/go/src"
}
]
}
///Block(vscodeLaunchConfigs)

///EndBlock(vscodeLaunchConfigs)
]
}
1 change: 1 addition & 0 deletions .vscode/private.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ MY_NAMESPACE="localizer--bento1a"
OUTREACH_ACCOUNTS_BASE_URL="https://accounts.outreach-dev.com"
OUTREACH_DOMAIN="outreach-dev.com"
///Block(vscodeEnvVars)

///EndBlock(vscodeEnvVars)
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
// Please consider contributing back all added
// settings to bootstrap!
///Block(settings)

///EndBlock(settings)
"go.lintTool": "golangci-lint",
"go.lintFlags": [],
"go.formatTool": "goimports",
"go.useLanguageServer": true,
"go.testEnvFile": "${workspaceFolder}/.vscode/private.env",
"go.alternateTools": {
// This makes sure we use the correct version
// of golangci-lint in our editors.
Expand All @@ -21,6 +23,9 @@
"[dockerfile]": {
"editor.defaultFormatter": "ms-azuretools.vscode-docker"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[proto3]": {
"editor.defaultFormatter": "zxh404.vscode-proto3"
},
Expand All @@ -29,5 +34,11 @@
},
"gopls": {
"build.buildFlags": ["-tags=or_test,or_dev,or_e2e,or_int"]
},
"[terraform]": {
"editor.defaultFormatter": "hashicorp.terraform"
},
"protoc": {
"options": ["--proto_path=${workspaceRoot}/api"]
}
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ that postfixed path.

### Linting and Unit Testing

You can run the the linters and unit tests with:
You can run the linters and unit tests with:

```bash
make test
Expand Down
4 changes: 2 additions & 2 deletions api/v1.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6a3a496

Please sign in to comment.