Skip to content

Commit

Permalink
build(ci): add circleci config
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Mar 1, 2023
1 parent 52b0657 commit d3baa03
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 3 deletions.
80 changes: 80 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
version: 2.1
jobs:
crawler:
machine:
image: ubuntu-2004:2023.02.1
resource_class: xlarge
environment:
RUSTFLAGS: "-D warnings"
IMAGE_NAME: a11ywatch/crawler
DOCKER_BUILDKIT: 1
BUILDX_PLATFORMS: linux/amd64,linux/arm64

steps:
- checkout

- restore_cache:
keys:
- node-v1-{{ .Branch }}-{{ checksum "Cargo.lock" }}
- node-v1-{{ .Branch }}-
- node-v1-

- run:
name: Login to Dockerhub
command: echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin

- run:
name: Install buildx
command: |
curl --output docker-buildx --silent --show-error --location --fail --retry 3 \
"https://github.com/docker/buildx/releases/download/v0.9.1/buildx-v0.9.1.linux-amd64"
mkdir -p ~/.docker/cli-plugins
mv docker-buildx ~/.docker/cli-plugins/
chmod a+x ~/.docker/cli-plugins/docker-buildx
- run:
name: Install Rust
command: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup.sh
chmod +x rustup.sh
./rustup.sh -y
source "$HOME"/.cargo/env
sudo apt-get update
sudo apt-get -y --no-install-recommends install libssl-dev qemu gcc-aarch64-linux-gnu qemu-user-static
- run:
name: Test image
command: cargo test --all-features

- run:
name: Setup buildx
command: docker buildx create --driver docker-container --name local --buildkitd-flags '--allow-insecure-entitlement security.insecure' --use

- run:
name: Build and Push Latest (Alpine)
no_output_timeout: 30m
command: docker buildx build --platform $BUILDX_PLATFORMS -t $IMAGE_NAME:latest -t $IMAGE_NAME:alpine --push . -f docker/Dockerfile

- run:
name: Build and Push (Debian)
no_output_timeout: 30m
command: |
docker buildx build --platform $BUILDX_PLATFORMS -t $IMAGE_NAME:debian --push . -f docker/Dockerfile.debian
- run:
name: Build and Push (Ubuntu)
no_output_timeout: 30m
command: |
docker buildx build --platform $BUILDX_PLATFORMS -t $IMAGE_NAME:ubuntu --push . -f docker/Dockerfile.ubuntu
- save_cache:
paths:
- ~/usr/local/lib/target
key: node-v1-{{ .Branch }}-{{ checksum "Cargo.lock" }}

workflows:
build_and_test:
jobs:
- crawler
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ This is required since every request spawns a thread. Isolating the context dras

If you need help implementing the gRPC server to receive the pages or links when found check out the [gRPC node example](https://github.com/A11yWatch/a11ywatch-core/blob/main/src/proto/website-server.ts) for a starting point .

## TODO
## Donations

1. Allow gRPC server port setting or change to direct url:port combo.
1. add protoc pre-compiled binary [installation](https://grpc.io/docs/protoc-installation/#install-pre-compiled-binaries-any-os).
Building the project is a bit expensive, we take all contributions including help with cost to deploy the best docker images for everyone to utilize.
If you want to help send an email to [a11ywatch support]([email protected]). At A11yWatch we use a custom variation of the project and we do not need to target other platforms since we deploy on similiar architecture. Helping give back to the community requires a bit more time and effort for some of the solutions that we released to the community.

## LICENSE

Expand Down

0 comments on commit d3baa03

Please sign in to comment.