diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..cbd138d --- /dev/null +++ b/.circleci/config.yml @@ -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:x-oauth-basic@github.com/pantheon-systems/".insteadOf "git@github.com: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 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c0b0d51 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/pyml-validator +/pyml-validator.yml + +.DS_Store diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..8eaca47 --- /dev/null +++ b/.goreleaser.yml @@ -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 \ No newline at end of file diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..d128eff --- /dev/null +++ b/CODEOWNERS @@ -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 diff --git a/Makefile b/Makefile index e69de29..bc7c1ab 100644 --- a/Makefile +++ b/Makefile @@ -0,0 +1,5 @@ +APP := pyml-validator + +include devops/make/common.mk +include devops/make/common-kube.mk +include devops/make/common-go.mk \ No newline at end of file diff --git a/main.go b/main.go index 06ab7d0..38dd16d 100644 --- a/main.go +++ b/main.go @@ -1 +1,3 @@ package main + +func main() {}