Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
241 changes: 241 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
# DO NOT MODIFY - this is managed by Git Reduce in goro and generated from build-matrix.json
#
---
version: 2.1

############
## Github Actions Pipeline Params
############

parameters:
GHA_Event:
type: string
default: ""
GHA_Actor:
type: string
default: ""
GHA_Action:
type: string
default: ""
GHA_Meta:
type: string
default: ""

jobs:
generate-and-push-docs:
docker:
- image: cimg/ruby:3.4.5
auth:
username: "$DOCKERHUB_USERNAME"
password: "$DOCKERHUB_PASSWORD"
steps:
- checkout
- run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN
- run: bundle install
- run:
name: Generate documentation
command: ' if [[ $(bundle exec rake -T docs:generate:custom) ]]; then echo
"Generating docs using rake task docs:generate:custom" ; bundle exec rake
docs:generate:custom ; elif [[ $(bundle exec rake -T docs:generate) ]];
then echo "Generating docs using rake task docs:generate" ; bundle exec
rake docs:generate ; else echo "Skipping doc generation" ; exit 0 ; fi '
- run:
name: Push documentation to Unwritten
command: if [[ $(bundle exec rake -T docs:push) ]]; then bundle exec rake
docs:push; fi
release:
docker:
- image: cimg/ruby:3.4.5
auth:
username: "$DOCKERHUB_USERNAME"
password: "$DOCKERHUB_PASSWORD"
steps:
- checkout
- run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN
- run: bundle install
- run:
name: Artifactory login
command: mkdir -p ~/.gem && curl -u$ARTIFACTORY_USER:$ARTIFACTORY_TOKEN https://stitchfix01.jfrog.io/stitchfix01/api/gems/eng-gems/api/v1/api_key.yaml
> ~/.gem/credentials && chmod 0600 ~/.gem/credentials
- run:
name: Build/release gem to artifactory
command: bundle exec rake push_artifactory
ruby-3_4_5-rails-8_0:
docker:
- image: cimg/ruby:3.4.5
auth:
username: "$DOCKERHUB_USERNAME"
password: "$DOCKERHUB_PASSWORD"
environment:
BUNDLE_GEMFILE: Gemfile.rails-8.0
working_directory: "~/rspec_api_documentation"
steps:
- checkout
- run:
name: Check for Gemfile.lock presence
command: ' if (test -f Gemfile.lock) then echo "Dont commit Gemfile.lock (see
https://github.com/stitchfix/eng-wiki/blob/main/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)"
1>&2 ; exit 1 ; else exit 0 ; fi '
- run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN
- run: bundle install
- run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
--format=doc
- run:
name: Run Additional CI Steps
command: if [ -e bin/additional-ci-steps ]; then bin/additional-ci-steps;
fi
- run:
name: Notify Pager Duty
command: bundle exec y-notify "#app-platform-ops"
when: on_fail
- store_test_results:
path: "/tmp/test-results"
ruby-3_3_9-rails-8_0:
docker:
- image: cimg/ruby:3.3.9
auth:
username: "$DOCKERHUB_USERNAME"
password: "$DOCKERHUB_PASSWORD"
environment:
BUNDLE_GEMFILE: Gemfile.rails-8.0
working_directory: "~/rspec_api_documentation"
steps:
- checkout
- run:
name: Check for Gemfile.lock presence
command: ' if (test -f Gemfile.lock) then echo "Dont commit Gemfile.lock (see
https://github.com/stitchfix/eng-wiki/blob/main/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)"
1>&2 ; exit 1 ; else exit 0 ; fi '
- run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN
- run: bundle install
- run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
--format=doc
- run:
name: Run Additional CI Steps
command: if [ -e bin/additional-ci-steps ]; then bin/additional-ci-steps;
fi
- run:
name: Notify Pager Duty
command: bundle exec y-notify "#app-platform-ops"
when: on_fail
- store_test_results:
path: "/tmp/test-results"
ruby-3_4_5-rails-7_2:
docker:
- image: cimg/ruby:3.4.5
auth:
username: "$DOCKERHUB_USERNAME"
password: "$DOCKERHUB_PASSWORD"
environment:
BUNDLE_GEMFILE: Gemfile.rails-7.2
working_directory: "~/rspec_api_documentation"
steps:
- checkout
- run:
name: Check for Gemfile.lock presence
command: ' if (test -f Gemfile.lock) then echo "Dont commit Gemfile.lock (see
https://github.com/stitchfix/eng-wiki/blob/main/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)"
1>&2 ; exit 1 ; else exit 0 ; fi '
- run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN
- run: bundle install
- run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
--format=doc
- run:
name: Run Additional CI Steps
command: if [ -e bin/additional-ci-steps ]; then bin/additional-ci-steps;
fi
- run:
name: Notify Pager Duty
command: bundle exec y-notify "#app-platform-ops"
when: on_fail
- store_test_results:
path: "/tmp/test-results"
ruby-3_3_9-rails-7_2:
docker:
- image: cimg/ruby:3.3.9
auth:
username: "$DOCKERHUB_USERNAME"
password: "$DOCKERHUB_PASSWORD"
environment:
BUNDLE_GEMFILE: Gemfile.rails-7.2
working_directory: "~/rspec_api_documentation"
steps:
- checkout
- run:
name: Check for Gemfile.lock presence
command: ' if (test -f Gemfile.lock) then echo "Dont commit Gemfile.lock (see
https://github.com/stitchfix/eng-wiki/blob/main/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)"
1>&2 ; exit 1 ; else exit 0 ; fi '
- run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN
- run: bundle install
- run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
--format=doc
- run:
name: Run Additional CI Steps
command: if [ -e bin/additional-ci-steps ]; then bin/additional-ci-steps;
fi
- run:
name: Notify Pager Duty
command: bundle exec y-notify "#app-platform-ops"
when: on_fail
- store_test_results:
path: "/tmp/test-results"
workflows:
version: 2
on-commit:
unless:
equal: [ "schedule", << pipeline.parameters.GHA_Event >> ]
jobs:
- release:
context: org-global
requires:
- ruby-3_4_5-rails-8_0
- ruby-3_3_9-rails-8_0
- ruby-3_4_5-rails-7_2
- ruby-3_3_9-rails-7_2
filters:
tags:
only: "/^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:(-|\\.)(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/"
branches:
ignore: /.*/
- generate-and-push-docs:
context: org-global
requires:
- release
filters:
tags:
only: "/^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:(-|\\.)(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/"
branches:
ignore: /.*/
- ruby-3_4_5-rails-8_0:
context: org-global
filters:
tags:
only: &1 /.*/
- ruby-3_3_9-rails-8_0:
context: org-global
filters:
tags:
only: *1
- ruby-3_4_5-rails-7_2:
context: org-global
filters:
tags:
only: *1
- ruby-3_3_9-rails-7_2:
context: org-global
filters:
tags:
only: *1
scheduled:
when:
equal: [ "schedule", << pipeline.parameters.GHA_Event >> ]
jobs:
- ruby-3_4_5-rails-8_0:
context: org-global
- ruby-3_3_9-rails-8_0:
context: org-global
- ruby-3_4_5-rails-7_2:
context: org-global
- ruby-3_3_9-rails-7_2:
context: org-global
14 changes: 14 additions & 0 deletions .github/workflows/scheduled_cci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on:
schedule:
- cron: '53 20 * * 1,2,3,4,5'
workflow_dispatch:

jobs:
trigger-circleci:
runs-on: ubuntu-latest
steps:
- name: CircleCI trigger on schedule
id: step1
uses: CircleCI-Public/[email protected]
env:
CCI_TOKEN: ${{ secrets.CCI_TOKEN || secrets.CCI_TOKEN_FOR_PUBLIC_REPOS }}
7 changes: 7 additions & 0 deletions Gemfile.rails-7.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# DO NOT MODIFY - this is managed by Git Reduce in goro
#
source 'https://stitchfix01.jfrog.io/stitchfix01/api/gems/eng-gems/'

gemspec

gem 'activesupport', '~> 7.2.0'
7 changes: 7 additions & 0 deletions Gemfile.rails-8.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# DO NOT MODIFY - this is managed by Git Reduce in goro
#
source 'https://stitchfix01.jfrog.io/stitchfix01/api/gems/eng-gems/'

gemspec

gem 'activesupport', '~> 8.0.0'
3 changes: 3 additions & 0 deletions build-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"build_matrix": {}
}
1 change: 1 addition & 0 deletions rspec_api_documentation.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ Gem::Specification.new do |s|

s.files = Dir.glob("lib/**/*") + Dir.glob("templates/**/*")
s.require_path = "lib"
s.add_development_dependency('rspec_junit_formatter')
end