Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure-project: initial commit #4

Merged
merged 1 commit into from
Jan 18, 2025
Merged
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
5 changes: 0 additions & 5 deletions .circleci/app.ignore

This file was deleted.

133 changes: 0 additions & 133 deletions .circleci/app.yml

This file was deleted.

9 changes: 3 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ version: 2.1
setup: true

orbs:
dynamic: bjd2385/dynamic-continuation@3.6.12
dynamic: bjd2385/dynamic-continuation@3.9.1

workflows:
version: 2

default:
jobs:
- dynamic/extend:
context: orb-publishing
modules: |
.
scripts
- dynamic/continue:
context: orb-publishing
2 changes: 1 addition & 1 deletion .circleci/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ workflows:
on-commit:
jobs:
- shellcheck/check:
dir: ./src/scripts
dir: .
exclude: SC2148
filters:
branches:
Expand Down
3 changes: 0 additions & 3 deletions .github/FUNDING.yml

This file was deleted.

File renamed without changes.
8 changes: 4 additions & 4 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
_extends: .github

repository:
name: base
description: Base repository with default settings and configs
homepage: github.com
name: directory-anarchy
description: A directory traversal game that teaches you Bash
homepage: anarchy.aperiodicity.com

# A comma-separated list of topics to set on the repository
topics: settings
private: false
private: false
39 changes: 27 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
fail_fast: true
repos:
# Requires hadolint binary on local machine.
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint
args:
- --config
- config/.hadolint.yaml
- Dockerfile

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.4.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict
args: [--maxkb=10000, --enforce-all]
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: mixed-line-ending

- repo: https://github.com/bjd2385/circleci-orb-pre-commit-hook
rev: v1.2.0
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: circleci-orb-validate
- id: shellcheck
args:
- src # Target the src/ directory.
- "true" # Enable pre-pack prior to validation.
- -x

- repo: https://github.com/bjd2385/circleci-config-pre-commit-hook
rev: v1.0.3
- repo: https://github.com/emmeowzing/dynamic-continuation-orb
rev: v3.6.8
hooks:
- id: circleci-config-validate

- repo: https://github.com/premiscale/pre-commit-hooks
rev: v0.0.7
hooks:
- id: msg-issue-prefix
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shellcheck 0.10.0
hadolint 2.12.0
29 changes: 29 additions & 0 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Contributing

To contribute to this repository, start by installing the necessary dependencies and following the build steps, below!

## Dependencies

Install asdf, followed by executing the dependencies script.

```shell
./scripts/dependencies.sh
```

This script will install all necessary tools and their versions as defined in the `.tool-versions`-file at the root of this repository.

### Docker

This project has primarily been developed on Docker. Please have a suitable version installed on your machine (25 and later). Please open an Issue in this repository if you have any issues running this container image.

## Build

Run the following Docker build and run commands to execute this codebase.

```shell
DOCKER_BUILDKIT=1 docker build --platform="linux/[amd64|arm64]" . -t directory-anarchy:latest
docker run -it -e DEBUG=true -n directory-anarchy-game directory-anarchy:latest
```

### pre-commit

31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ARG REGISTRY=docker.io
ARG IMAGE=ubuntu
ARG TAG=22.04

FROM ${REGISTRY}/${IMAGE}:${TAG}

SHELL [ "/bin/bash", "-c" ]

ENV DEBUG=false

# https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys
LABEL org.opencontainers.image.description "Directory anarchy game"
LABEL org.opencontainers.image.licenses "MIT"
LABEL org.opencontainers.image.authors "Emma Doyle <[email protected]>, Willow Ahrens <[email protected]>"
LABEL org.opencontainers.image.documentation "https://anarchy.aperiodicity.com"

USER root

# apt list -a bash && apt install -y \
RUN apt update \
&& rm -rf /var/apt/lists/* \
&& groupadd anarchists --gid 1001 \
&& useradd -rm -d /opt/anarchy -s /bin/bash -g anarchists -u 1001 anarchist

WORKDIR /opt/anarchy

COPY --chown=anarchist:anarchists scripts/cmd.sh .

USER anarchist

CMD [ "./cmd.sh" ]
10 changes: 10 additions & 0 deletions config/.hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ignored:
- DL3008
- DL3015
- DL4006
- DL3027
- DL3013
- DL3042
- SC1091
- DL3033
- DL3032
Empty file removed scripts/.placeholder
Empty file.
2 changes: 2 additions & 0 deletions scripts/cmd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#! /usr/bin/env bash
# Start the game.
7 changes: 7 additions & 0 deletions scripts/dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /usr/bin/env bash
# Install all dependencies for developing this project.

asdf plugin add hadolint https://github.com/looztra/asdf-hadolint.git
asdf plugin add shellcheck https://github.com/luizm/asdf-shellcheck.git

asdf install