Skip to content

Commit

Permalink
Setup Circle, Codeowners, gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
pwtyler committed Feb 3, 2023
1 parent 3fc1684 commit 6f87bf1
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 0 deletions.
98 changes: 98 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
version: 2.1

executors:
go-build:
docker:
- image: quay.io/getpantheon/go-build
auth:
username: $QUAY_USER
password: $QUAY_PASSWD

commands:
save-go-mod-cache:
steps:
- save_cache:
key: v4-dependencies-{{ checksum "go.sum" }}
paths:
- /go/pkg/mod
- /home/circleci/go/pkg/mod
restore-go-mod-cache:
steps:
- restore_cache:
keys:
- v4-dependencies-{{ checksum "go.sum" }}

# By default, CircleCI uses ssh, and authenticates as a user with read access to projects, but not write access.
# In order for `git push` command to work, we need to have CircleCI use HTTPS with the provided oauth token
# instead of ssh (the token is for pantheon-releases which has write access, but the default circle user does not)
configure-https-git:
steps:
- run: git config --global url."https://$GITHUB_TOKEN:[email protected]/pantheon-systems/".insteadOf "[email protected]:pantheon-systems/"

jobs:
update-mod-cache:
executor: go-build
steps:
- checkout
- restore-go-mod-cache
- run: go mod download
- save-go-mod-cache
# build all the code
build:
executor: go-build
steps:
- checkout
- restore-go-mod-cache
- run: make build
# Tests the code
test:
executor: go-build
steps:
- checkout
- restore-go-mod-cache
- run:
name: lint and test
command: make test-circle
# Tag for release
release:
executor: go-build
steps:
- checkout
- configure-https-git
- run: autotag
- run: git push --tags
- run:
name: go releaser
command: curl -sL https://git.io/goreleaser | bash -s -- --parallelism=2

workflows:
version: 2
build-deploy:
jobs:
- update-mod-cache:
context:
- docker-executor-auth
- sig-go-project
- build:
context:
- docker-executor-auth
- sig-go-project
requires:
- update-mod-cache
- test:
context:
- docker-executor-auth
- sig-go-project
requires:
- update-mod-cache
- release:
context:
- docker-executor-auth
- sig-go-release
requires:
- test
filters:
branches:
only:
- main
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/pyml-validator
/pyml-validator.yml

.DS_Store
21 changes: 21 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
project_name: pyml-validator

# don't compile anything
builds:
- skip: true # TODO: Build for releases.

# configure what shows up in the changelog
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- Merge pull request
- Merge branch

# make a zip of the source
# https://goreleaser.com/customization/source/
source:
enabled: true
4 changes: 4 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Code owners. See:
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners

* @pantheon-systems/cms-platform
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
APP := pyml-validator

include devops/make/common.mk
include devops/make/common-kube.mk
include devops/make/common-go.mk
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
package main

func main() {}

0 comments on commit 6f87bf1

Please sign in to comment.