Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
feat(ci): add watchtower workflow
  • Loading branch information
Airscript committed Aug 14, 2022
commit bf9079403057e1371144f616f03e5de2fba3c626
40 changes: 34 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
version: 2.1

setup: true

orbs:
path-filtering: circleci/[email protected]

executors:
build-environment:
docker:
Expand All @@ -22,7 +27,10 @@ jobs:

- run:
name: Verify Environment
command: sh ./scripts/ci/verify.sh build
command: |
apk update
sh scripts/install/bash.sh $BLOG_BUILD_ENV
bash scripts/ci/verify.sh build

verify-deploy-environment:
executor: deploy-environment
Expand All @@ -32,7 +40,10 @@ jobs:

- run:
name: Verify Environment
command: sh ./scripts/ci/verify.sh deploy
command: |
apk update
sh scripts/install/bash.sh $BLOG_BUILD_ENV
bash scripts/ci/verify.sh deploy

verify-publish-environment:
executor: publish-environment
Expand All @@ -42,7 +53,10 @@ jobs:

- run:
name: Verify Environment
command: sh ./scripts/ci/verify.sh publish
command: |
apk update
sh scripts/install/bash.sh $BLOG_BUILD_ENV
bash scripts/ci/verify.sh publish

build:
executor: build-environment
Expand All @@ -55,7 +69,8 @@ jobs:

command: |
apk update
sh ./scripts/install/make.sh
sh scripts/install/bash.sh $BLOG_BUILD_ENV
bash scripts/install/make.sh
make install-git env=$BLOG_BUILD_ENV
make install-hugo

Expand Down Expand Up @@ -92,7 +107,8 @@ jobs:

command: |
apk update
sh ./scripts/install/make.sh
sh scripts/install/bash.sh $BLOG_BUILD_ENV
bash scripts/install/make.sh
make install-npm
make install-netlify-cli

Expand All @@ -114,7 +130,8 @@ jobs:
name: Install Packages
command: |
apk update
sh ./scripts/install/make.sh
sh scripts/install/bash.sh $BLOG_BUILD_ENV
bash scripts/install/make.sh
make install-docker-cli

- run:
Expand All @@ -132,6 +149,17 @@ workflows:
jobs:
- build

watchtower:
jobs:
- path-filtering/filter:
name: watch

mapping: |
tests/.* run-tests-jobs true

base-revision: main
config-path: .circleci/watchtower.yml

deploy:
jobs:
- build
Expand Down
52 changes: 52 additions & 0 deletions .circleci/watchtower.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: 2.1

parameters:
run-tests-jobs:
type: boolean
default: false

tests-node-environment:
docker:
- image: node:18.7.0-alpine3.16

tests-bats-environment:
docker:
- image: bats/bats:1.7.0

jobs:
tests-bats:
executor: tests-bats-environment

steps:
- checkout

- run:
name: Run Tests
command: bats ./tests/_.bats ./tests/install.bats ./tests/shared.bats

tests-node:
executor: tests-node-environment

steps:
- checkout

- run:
name: Install Packages

command: |
apk update
apk add bash
npm install -g bats

- run:
name: Run Node Tests
command: bats tests/_.bats tests/install-node.bats


workflows:
tests:
when: << pipeline.parameters.run-tests-jobs >>

jobs:
- tests-bats
- tests-node
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ run-test:
./tests/_.bats ./tests/install.bats ./tests/shared.bats

docker run -it --rm --name="worker-bats-node" airscript/bats:node \
./tests/_.bats ./tests/install-npm.bats
./tests/_.bats ./tests/install-node.bats

.PHONY: install-bash
install-bash:
Expand Down
File renamed without changes.