Skip to content

Commit

Permalink
Merge pull request #21 from allaboutapps/cw/work
Browse files Browse the repository at this point in the history
Cw/work
  • Loading branch information
chrztoph authored Dec 14, 2022
2 parents 91885ee + 3b92929 commit 7226098
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions template/.drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ alias:
- &IMAGE_BUILDER_ID ${DRONE_REPO,,}-${BUILD_ENV}:${DRONE_COMMIT_SHA}-builder

# Defines which branches will trigger a docker image push our Google Cloud Registry (tags are always published)
- &GCR_PUBLISH_BRANCHES [dev, staging, master]
- &GCR_PUBLISH_BRANCHES [dev, staging, main]

# Docker registry publish default settings
- &GCR_REGISTRY_SETTINGS
Expand Down Expand Up @@ -73,12 +73,12 @@ alias:
when:
event: *BUILD_EVENTS

- &DOCKER_BUILD_SETTINGS
- &DOCKER_BUILD_SETTINGS_RUNNER
image: docker:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
IMAGE_TAG: *IMAGE_BUILDER_ID
IMAGE_TAG: *IMAGE_RUNNER_ID
commands:
- |
docker build -t $${IMAGE_TAG} . --build-arg REACT_APP_COMMIT_HASH=${DRONE_BRANCH}_${DRONE_COMMIT_SHA:0:10}
Expand All @@ -88,7 +88,7 @@ alias:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
IMAGE_TAG: *IMAGE_RUNNER_ID
IMAGE_TAG: *IMAGE_BUILDER_ID
commands:
- |
docker build --target builder -t $${IMAGE_TAG} . --build-arg REACT_APP_COMMIT_HASH=${DRONE_BRANCH}_${DRONE_COMMIT_SHA:0:10}
Expand All @@ -110,7 +110,7 @@ pipeline:

"docker build (target runner)":
group: build
<<: *DOCKER_BUILD_SETTINGS
<<: *DOCKER_BUILD_SETTINGS_RUNNER
<<: *WHEN_BUILD_EVENT

# ---------------------------------------------------------------------------
Expand All @@ -131,11 +131,11 @@ pipeline:

"test":
group: test
image: *IMAGE_DEPLOY_ID_STAGE_BUILDER
image: *IMAGE_BUILDER_ID
commands:
- cd /app
- yarn test:ci
<<: *WHEN_BRANCH_BUILD_EVENT
<<: *WHEN_BUILD_EVENT

# ---------------------------------------------------------------------------
# PUBLISH
Expand All @@ -154,7 +154,7 @@ pipeline:
- '${DRONE_COMMIT_SHA:0:10}'
when:
branch: ${GCR_PUBLISH_BRANCHES}
event: *BRANCH_BUILD_EVENTS
event: *WHEN_BUILD_EVENT

# Built a tag? Push to cloud registry
"publish tag_${DRONE_COMMIT_SHA:0:10}":
Expand Down Expand Up @@ -185,7 +185,7 @@ pipeline:
mgmt_deployment_yaml: namespaces/${K8S_DEPLOY_NS_DEV}/webapp.deployment.yaml
when:
branch: dev
event: *BRANCH_BUILD_EVENTS
event: *WHEN_BUILD_EVENT

# promote dev, staging or production through "drone deploy <repo> <build> <env>" or "woodpecker-cli deploy <repo> <build> <env>"
"deploy ${DRONE_COMMIT_SHA:0:10} to ${K8S_DEPLOY_NS_DEV} (promote)":
Expand All @@ -207,7 +207,7 @@ pipeline:
mgmt_deployment_yaml: namespaces/${K8S_DEPLOY_NS_STAGING}/webapp.deployment.yaml
when:
branch: staging
event: *BRANCH_BUILD_EVENTS
event: *WHEN_BUILD_EVENT

# promote dev, staging or production through "drone deploy <repo> <build> <env>" or "woodpecker-cli deploy <repo> <build> <env>"
"deploy ${DRONE_COMMIT_SHA:0:10} to ${K8S_DEPLOY_NS_STAGING} (promote)":
Expand All @@ -232,7 +232,7 @@ pipeline:
# mgmt_deployment_yaml: namespaces/${K8S_DEPLOY_NS_PROD}/webapp.deployment.yaml
# when:
# branch: staging
# event: *BRANCH_BUILD_EVENTS
# event: *WHEN_BUILD_EVENT

# promote dev, staging or production through "drone deploy <repo> <build> <env>" or "woodpecker-cli deploy <repo> <build> <env>"
"deploy ${DRONE_COMMIT_SHA:0:10} to ${K8S_DEPLOY_NS_PROD} (promote)":
Expand Down
6 changes: 3 additions & 3 deletions template/scripts/lint-google-fonts.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
files="$(grep -rwl "$(pwd)" --exclude="$(pwd)/scripts/lint-google-fonts.sh" --exclude-dir="$(pwd)/node_modules" --include=\*.{js,jsx,ts,tsx,gql,css,json,html,htm} -e "fonts.googleapis.com")"
if [ -z "$files" ]
then
files="$(grep -rwl "." --exclude-dir="node_modules" --include=\*.{js,jsx,ts,tsx,gql,css,json,html,htm} -e "fonts.googleapis.com")"
if [ -z "$files" ]
then
echo "OK";
exit 0;
else
Expand Down

0 comments on commit 7226098

Please sign in to comment.