Skip to content

Commit ae43937

Browse files
authored
Merge pull request #9 from forumone/rjensen-updating-pipeline-default
Adding ddev / moving directories / adding storybook / adding basic pi…
2 parents d42c8f2 + 5c19646 commit ae43937

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+46132
-8963
lines changed

.buildkite/pipeline-base.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Consolidate the common configuration for reuse across multiple steps.
2+
definitions:
3+
# Configure some default step values.
4+
step-defaults: &step-defaults
5+
timeout_in_minutes: 15
6+
plugins:
7+
ecr: &ecr
8+
ecr#v2.0.0:
9+
login: true
10+
no-include-email: true
11+
12+
# Specify common agent queue parameters.
13+
queues:
14+
# Docker-based tasks should run in the Docker queue.
15+
docker-agents: &docker-agents
16+
agents:
17+
queue: "docker-builders"
18+
env:
19+
# If you do not declare buildkit:1 then arguments using for --target
20+
# do not work correctly and they will build every steps.
21+
DOCKER_BUILDKIT: 1
22+
BUILDKIT_PROGRESS: plain
23+
24+
# Identify the address for the shared Buildkite ECR repository.
25+
IMAGE_REPOSITORY: "165761832703.dkr.ecr.us-east-1.amazonaws.com/buildkite"
26+
27+
# Set this as an environment variable for automatic usage by default for all
28+
# docker-compose buildkite plugin executions.
29+
BUILDKITE_PLUGIN_DOCKER_COMPOSE_IMAGE_REPOSITORY: "$IMAGE_REPOSITORY"
30+
31+
# Define a common namespace for images to be published within the shared ECR repo.
32+
ECR_NAMESPACE: "${IMAGE_REPOSITORY}:${BUILDKITE_PIPELINE_SLUG}"
33+
34+
# Define service directory were the Dockerfile is used
35+
DOCKERFILE_LOCATION: "./services/app"
36+
steps:
37+
- label: ":hammer: :docker: Building Docker Image"
38+
key: "build-image"
39+
<<: *step-defaults
40+
<<: *docker-agents
41+
command:
42+
- "docker build --target ${DOCKERFILE_BUILD_STEP} -t ${ECR_NAMESPACE}-${BUILDKITE_BUILD_NUMBER}-${BUILDKITE_COMMIT} ${DOCKERFILE_LOCATION}"
43+
- "docker push ${ECR_NAMESPACE}-${BUILDKITE_BUILD_NUMBER}-${BUILDKITE_COMMIT}"
44+
plugins:
45+
- *ecr
46+
- seek-oss/aws-sm#v2.0.0:
47+
file:
48+
- path: services/app/.env
49+
secret-id: [NEED THIS CONFIGURED]
50+
51+
# Wait for images to finish building.
52+
- wait: ~
53+
54+
# Deploy the built application.
55+
- label: ":capistrano: Deploy"
56+
key: "deploy"
57+
timeout_in_minutes: 15
58+
depends_on: "build-image"
59+
concurrency: 1
60+
concurrency_group: '$BUILDKITE_PIPELINE_SLUG/$BUILDKITE_BRANCH/deploy'
61+
branches:
62+
- integration
63+
- main
64+
- live
65+
plugins:
66+
# Log into ECR for this build step to access prebuilt images.
67+
- *ecr
68+
69+
# Download the prebuilt image and extract project files to the
70+
# local filesystem for further operations.
71+
- forumone/extract#v0.2.0:
72+
image: ${ECR_NAMESPACE}-${BUILDKITE_BUILD_NUMBER}-${BUILDKITE_COMMIT}
73+
from: /app
74+
to: ${DOCKERFILE_LOCATION}
75+
76+
# Execute a Capistrano deployment using the defined branch to
77+
# environment mapping.
78+
- forumone/capistrano#v0.4.0:
79+
require-stage: true
80+
branches:
81+
integration: dev
82+
main: stage
83+
live: prod

.buildkite/pipeline.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
steps:
2+
- label: Build App
3+
command: buildkite-agent pipeline upload .buildkite/pipeline-base.yml
4+
branches:
5+
- live
6+
env:
7+
APP_SECRET: prod
8+
DOCKERFILE_BUILD_STEP: artifact
9+
10+
- label: Build App
11+
command: buildkite-agent pipeline upload .buildkite/pipeline-base.yml
12+
branches:
13+
- release
14+
env:
15+
APP_SECRET: release
16+
DOCKERFILE_BUILD_STEP: artifact
17+
18+
- label: Build App
19+
command: buildkite-agent pipeline upload .buildkite/pipeline-base.yml
20+
branches:
21+
- main
22+
env:
23+
APP_SECRET: stage
24+
DOCKERFILE_BUILD_STEP: artifact-storybook
25+
26+
- label: Build App
27+
command: buildkite-agent pipeline upload .buildkite/pipeline-base.yml
28+
branches:
29+
- "!live"
30+
- "!release"
31+
- "!main"
32+
env:
33+
APP_SECRET: dev
34+
DOCKERFILE_BUILD_STEP: artifact-storybook

.github/workflows/checks.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on: [pull_request]
55
jobs:
66
lint:
77
runs-on: ubuntu-latest
8+
defaults:
9+
run:
10+
working-directory: ./services/app
811

912
strategy:
1013
matrix:
@@ -35,6 +38,9 @@ jobs:
3538

3639
typescript:
3740
runs-on: ubuntu-latest
41+
defaults:
42+
run:
43+
working-directory: ./services/app
3844

3945
strategy:
4046
matrix:

.gitignore

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,7 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
31
# dependencies
42
/node_modules
5-
/.pnp
6-
.pnp.js
7-
8-
# testing
9-
/coverage
10-
11-
# next.js
12-
/.next/
13-
/out/
14-
15-
# production
16-
/build
173

184
# misc
195
.DS_Store
206
*.pem
217
.idea
22-
23-
# debug
24-
npm-debug.log*
25-
yarn-debug.log*
26-
yarn-error.log*
27-
28-
# local env files
29-
.env.local
30-
.env.development.local
31-
.env.test.local
32-
.env.production.local
33-
34-
# vercel
35-
.vercel
36-
37-
# TypeScript
38-
tsconfig.tsbuildinfo

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4+
# Run test command in the app service.
5+
cd services/app
46
npm test

Capfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
require 'json'
2+
3+
# Set config paths
4+
set :deploy_config_path, File.expand_path('capistrano/deploy.rb')
5+
set :stage_config_path, 'capistrano/deploy'
6+
7+
# Load DSL and Setup Up Stages
8+
require 'capistrano/setup'
9+
10+
# Includes default deployment tasks
11+
require 'capistrano/deploy'
12+
13+
# Includes tasks from other gems included in your Gemfile
14+
#
15+
# For documentation on these, see for example:
16+
#
17+
# https://github.com/capistrano/rvm
18+
# https://github.com/capistrano/rbenv
19+
# https://github.com/capistrano/bundler
20+
# https://github.com/capistrano/rails/tree/master/assets
21+
# https://github.com/capistrano/rails/tree/master/migrations
22+
#
23+
# require 'capistrano/rvm'
24+
# require 'capistrano/rbenv'
25+
# require 'capistrano/bundler'
26+
# require 'capistrano/rails/assets'
27+
# require 'capistrano/rails/migrations'
28+
29+
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
30+
Dir.glob('capistrano/tasks/*.rake').each { |r| import r }

Dockerfile

Lines changed: 0 additions & 57 deletions
This file was deleted.

Gemfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'capistrano', '3.4'
4+
gem 'json', '~>1.8'
5+
gem 'i18n', '~>0.8.6'
6+
7+
# Pin net-ssh to an older revision to avoid it dumping the Smallstep SSH
8+
# certificate into ~/.ssh/known_hosts on Buildkite
9+
gem 'net-ssh', '~>2.9.2'

0 commit comments

Comments
 (0)