Skip to content

Commit

Permalink
Merge pull request #126 from cisagov/improvement/update_skeleton-pyth…
Browse files Browse the repository at this point in the history
…on-library_version

Bump version from `0.0.1` to `0.1.0`
  • Loading branch information
mcdonnnj authored Sep 15, 2022
2 parents 2dbe229 + 1a61ac7 commit 46d8b6c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ USER cisa
EXPOSE 8080/TCP
VOLUME ["/var/log"]
ENTRYPOINT ["example"]
CMD ["--log-level", "DEBUG"]
CMD ["--log-level", "DEBUG", "4", "2"]
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ appropriate for Docker containers and the major languages that we use.
To run the `cisagov/example` image via Docker:

```console
docker run cisagov/example:0.0.1
docker run cisagov/example:0.1.0
```

### Running with Docker Compose ###
Expand All @@ -37,7 +37,7 @@ docker run cisagov/example:0.0.1

services:
example:
image: cisagov/example:0.0.1
image: cisagov/example:0.1.0
volumes:
- type: bind
source: <your_log_dir>
Expand Down Expand Up @@ -82,7 +82,7 @@ environment variables. See the
services:
example:
image: cisagov/example:0.0.1
image: cisagov/example:0.1.0
volumes:
- type: bind
source: <your_log_dir>
Expand Down Expand Up @@ -125,7 +125,7 @@ environment variables. See the
1. Pull the new image:

```console
docker pull cisagov/example:0.0.1
docker pull cisagov/example:0.1.0
```

1. Recreate and run the container by following the [previous instructions](#running-with-docker).
Expand All @@ -135,13 +135,13 @@ environment variables. See the
The images of this container are tagged with [semantic
versions](https://semver.org) of the underlying example project that they
containerize. It is recommended that most users use a version tag (e.g.
`:0.0.1`).
`:0.1.0`).

| Image:tag | Description |
|-----------|-------------|
|`cisagov/example:1.2.3`| An exact release version. |
|`cisagov/example:1.2`| The most recent release matching the major and minor version numbers. |
|`cisagov/example:1`| The most recent release matching the major version number. |
|`cisagov/example:0.1.0`| An exact release version. |
|`cisagov/example:0.1`| The most recent release matching the major and minor version numbers. |
|`cisagov/example:0`| The most recent release matching the major version number. |
|`cisagov/example:edge` | The most recent image built from a merge into the `develop` branch of this repository. |
|`cisagov/example:nightly` | A nightly build of the `develop` branch of this repository. |
|`cisagov/example:latest`| The most recent release image pushed to a container registry. Pulling an image using the `:latest` tag [should be avoided.](https://vsupalov.com/docker-latest-tag/) |
Expand Down Expand Up @@ -196,8 +196,8 @@ Build the image locally using this git repository as the [build context](https:/

```console
docker build \
--build-arg VERSION=0.0.1 \
--tag cisagov/example:0.0.1 \
--build-arg VERSION=0.1.0 \
--tag cisagov/example:0.1.0 \
https://github.com/cisagov/example.git#develop
```

Expand Down Expand Up @@ -227,9 +227,9 @@ Docker:
docker buildx build \
--file Dockerfile-x \
--platform linux/amd64 \
--build-arg VERSION=0.0.1 \
--build-arg VERSION=0.1.0 \
--output type=docker \
--tag cisagov/example:0.0.1 .
--tag cisagov/example:0.1.0 .
```

## New repositories from a skeleton ##
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
# Run the container normally
build:
# VERSION must be specified on the command line:
# e.g., --build-arg VERSION=0.0.1
# e.g., --build-arg VERSION=0.1.0
context: .
dockerfile: Dockerfile
image: cisagov/example
Expand Down
2 changes: 1 addition & 1 deletion src/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.1"
__version__ = "0.1.0"
5 changes: 5 additions & 0 deletions tests/container_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

ENV_VAR = "ECHO_MESSAGE"
ENV_VAR_VAL = "Hello World from docker compose!"
DIVISION_RESULT = "4 / 2 == 2.000000"
READY_MESSAGE = "This is a debug message"
SECRET_QUOTE = (
"There are no secrets better kept than the secrets everybody guesses." # nosec
Expand Down Expand Up @@ -52,6 +53,10 @@ def test_output(main_container):
"""Verify the container had the correct output."""
main_container.wait() # make sure container exited if running test isolated
log_output = main_container.logs().decode("utf-8")
assert DIVISION_RESULT in log_output, "Division result not found in log output."
assert (
ENV_VAR_VAL in log_output
), "Environment variable value not found in log output."
assert SECRET_QUOTE in log_output, "Secret not found in log output."


Expand Down

0 comments on commit 46d8b6c

Please sign in to comment.