Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	docker-compose.yml
#	tests/container_test.py
  • Loading branch information
mcdonnnj committed Jun 13, 2022
2 parents 1cfc036 + 9cea64d commit 4f3c7b4
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 41 deletions.
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---

# Any ignore directives should be uncommented in downstream projects to disable
# Dependabot updates for the given dependency. Downstream projects will get
# these updates when the pull request(s) in the appropriate skeleton are merged
# and Lineage processes these changes.

version: 2
updates:
- package-ecosystem: "docker"
Expand All @@ -11,6 +16,18 @@ updates:
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: actions/cache
- dependency-name: actions/checkout
- dependency-name: actions/setup-python
# Managed by cisagov/skeleton-docker
# - dependency-name: actions/download-artifact
# - dependency-name: actions/github-script
# - dependency-name: actions/upload-artifact
# - dependency-name: docker/build-push-action
# - dependency-name: docker/login-action
# - dependency-name: docker/setup-buildx-action
# - dependency-name: docker/setup-qemu-action

- package-ecosystem: "pip"
directory: "/"
Expand Down
56 changes: 28 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ name: build
on:
push:
branches:
- '**'
- "**"
tags:
- 'v*.*.*'
- "v*.*.*"
pull_request:
schedule:
- cron: '0 10 * * *' # everyday at 10am
- cron: "0 10 * * *" # everyday at 10am
repository_dispatch:
# Respond to rebuild requests. See: https://github.com/cisagov/action-apb/
types: [apb]
Expand All @@ -18,11 +18,11 @@ on:
remote-shell:
description: "Debug with remote shell"
required: true
default: false
default: "false"
image-tag:
description: "Tag to apply to pushed images"
required: true
default: dispatch
default: "dispatch"

env:
BUILDX_CACHE_DIR: ~/.cache/buildx
Expand All @@ -43,16 +43,16 @@ jobs:
steps:
- id: setup-env
uses: cisagov/setup-env-github-action@develop
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- id: setup-python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.9
python-version: "3.10"
# We need the Go version and Go cache location for the actions/cache step,
# so the Go installation must happen before that.
- uses: actions/setup-go@v2
with:
go-version: '1.16'
go-version: "1.16"
- name: Store installed Go version
id: go-version
run: |
Expand All @@ -62,7 +62,7 @@ jobs:
id: go-cache
run: |
echo "::set-output name=dir::$(go env GOCACHE)"
- uses: actions/cache@v2
- uses: actions/cache@v3
env:
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
py${{ steps.setup-python.outputs.python-version }}-\
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
source_version: ${{ steps.prep.outputs.source_version }}
tags: ${{ steps.prep.outputs.tags }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Gather repository metadata
id: repo
uses: actions/github-script@v5
Expand Down Expand Up @@ -234,13 +234,13 @@ jobs:
needs: [prepare]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v3
env:
BASE_CACHE_KEY: buildx-${{ runner.os }}-
with:
Expand All @@ -252,7 +252,7 @@ jobs:
run: mkdir -p dist
- name: Build image
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
build-args: |
VERSION=${{ needs.prepare.outputs.source_version }}
Expand Down Expand Up @@ -290,7 +290,7 @@ jobs:
- name: Compress image
run: gzip dist/image.tar
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
Expand All @@ -303,13 +303,13 @@ jobs:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- id: setup-python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Cache testing environments
uses: actions/cache@v2
uses: actions/cache@v3
env:
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
py${{ steps.setup-python.outputs.python-version }}-"
Expand All @@ -325,7 +325,7 @@ jobs:
python -m pip install --upgrade pip
pip install --upgrade --requirement requirements-test.txt
- name: Download docker image artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: dist
path: dist
Expand All @@ -351,24 +351,24 @@ jobs:
if: github.event_name != 'pull_request'
steps:
- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v3
env:
BASE_CACHE_KEY: buildx-${{ runner.os }}-
with:
Expand All @@ -380,7 +380,7 @@ jobs:
run: ./buildx-dockerfile.sh
- name: Build and push platform images to registries
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
build-args: |
VERSION=${{ needs.prepare.outputs.source_version }}
Expand Down
12 changes: 11 additions & 1 deletion .mdl_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,17 @@ MD035:
# Enforce dashes for horizontal rules
style: "---"

# MD046/code-block-style Code block style
# MD046/code-block-style - Code block style
MD046:
# Enforce the fenced style for code blocks
style: "fenced"

# MD049/emphasis-style - Emphasis style should be consistent
MD049:
# Enforce asterisks as the style to use for emphasis
style: "asterisk"

# MD050/strong-style - Strong style should be consistent
MD050:
# Enforce asterisks as the style to use for strong
style: "asterisk"
27 changes: 17 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ repos:

# Text file hooks
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.30.0
rev: v0.31.1
hooks:
- id: markdownlint
args:
- --config=.mdl_config.yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.1
rev: v2.6.1
hooks:
- id: prettier
- repo: https://github.com/adrienverge/yamllint
Expand All @@ -48,9 +48,16 @@ repos:
args:
- --strict

# GitHub Actions hooks
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.14.2
hooks:
- id: check-github-actions
- id: check-github-workflows

# pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit
rev: v2.16.0
rev: v2.17.0
hooks:
- id: validate_manifest

Expand All @@ -76,7 +83,7 @@ repos:

# Python hooks
- repo: https://github.com/PyCQA/bandit
rev: 1.7.1
rev: 1.7.4
hooks:
- id: bandit
name: bandit (tests tree)
Expand All @@ -91,7 +98,7 @@ repos:
name: bandit (everything else)
exclude: tests
- repo: https://github.com/psf/black
rev: 21.12b0
rev: 22.3.0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
Expand All @@ -105,31 +112,31 @@ repos:
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.931
rev: v0.942
hooks:
- id: mypy
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
rev: v2.31.1
hooks:
- id: pyupgrade

# Ansible hooks
- repo: https://github.com/ansible-community/ansible-lint
rev: v5.3.2
rev: v5.4.0
hooks:
- id: ansible-lint
# files: molecule/default/playbook.yml

# Terraform hooks
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.62.3
rev: v1.64.0
hooks:
- id: terraform_fmt
- id: terraform_validate

# Docker hooks
- repo: https://github.com/IamTheFij/docker-pre-commit
rev: v2.0.1
rev: v2.1.0
hooks:
- id: docker-compose-check

Expand Down
6 changes: 6 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
extends: default

rules:
# yamllint does not like it when you comment out different parts of
# dictionaries in a list. You can see
# https://github.com/adrienverge/yamllint/issues/384 for some examples of
# this behavior.
comments-indentation: disable

# yamllint doesn't like when we use yes and no for true and false,
# but that's pretty standard in Ansible.
truthy: disable
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,26 @@ Consider using a `docker-compose.yml` file to run Certboto.
init: true
restart: "no"
environment:
<<<<<<< HEAD
- AWS_DEFAULT_REGION=us-east-1
- BUCKET_NAME=my-certificates
- BUCKET_PROFILE=certsync-role
- DNS_PROFILE=dns-role
secrets:
- source: credentials
target: credentials
=======
- ECHO_MESSAGE="Hello from docker compose"
ports:
- target: 8080
published: 8080
protocol: tcp
>>>>>>> 9cea64da4a1379cdde3c509a09fc548f0da8b034
```

#### Issue a new certificate ####

<<<<<<< HEAD
```console
docker-compose run certboto certonly -d lemmy.imotorhead.com
```
Expand Down Expand Up @@ -86,6 +95,11 @@ argument. This is useful if you need to use other types of challenges.
```console
docker-compose run certboto --no-dns-route53 --manual certonly -d lemmy.imotorhead.com
```
=======
```console
docker compose up --detach
```
>>>>>>> 9cea64da4a1379cdde3c509a09fc548f0da8b034

## Using secrets with your container ##

Expand Down Expand Up @@ -140,10 +154,18 @@ want set:
init: true
restart: "no"
environment:
<<<<<<< HEAD
- AWS_DEFAULT_REGION=us-east-1
- BUCKET_NAME=my-certificates
- BUCKET_PROFILE=certsync-role
- DNS_PROFILE=dns-role
=======
- ECHO_MESSAGE="Hello from docker compose"
ports:
- target: 8080
published: 8080
protocol: tcp
>>>>>>> 9cea64da4a1379cdde3c509a09fc548f0da8b034
secrets:
- source: credentials
target: credentials
Expand All @@ -156,14 +178,18 @@ want set:
1. Pull the new image from Docker Hub:

```console
docker-compose pull
docker compose pull
```

1. Recreate the running container by following the
[previous instructions](#running-with-docker-compose):

```console
<<<<<<< HEAD
docker-compose run certboto
=======
docker compose up --detach
>>>>>>> 9cea64da4a1379cdde3c509a09fc548f0da8b034
```

## Image tags ##
Expand Down
Loading

0 comments on commit 4f3c7b4

Please sign in to comment.