-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from nationalarchives/feature/docker-test
Make a Docker image for tests
- Loading branch information
Showing
19 changed files
with
300 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
services: | ||
app: | ||
build: | ||
# context: test | ||
dockerfile: test/Dockerfile | ||
environment: | ||
- ENVIRONMENT=develop | ||
- CONFIG=config.Develop | ||
- SECRET_KEY=abc123 | ||
ports: | ||
- 5001:8080 | ||
volumes: | ||
- ./test:/app | ||
- ./tna_frontend_jinja:/home/app/tna_frontend_jinja |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
{ | ||
"scripts": { | ||
"prettier": "prettier --write '*.{mjs,json}'", | ||
"run": "flask --app test run --debug --port 5000", | ||
"prettier": "npx --yes prettier --write '*.{mjs,json}'", | ||
"test": "node test-fixtures.mjs" | ||
}, | ||
"dependencies": { | ||
"@nationalarchives/frontend": "^0.2.8", | ||
"diff": "^5.1.0", | ||
"glob": "^10.2.7", | ||
"js-beautify": "^1.14.8", | ||
"node-fetch": "^3.3.1", | ||
"prettier": "^3.2.5" | ||
"node-fetch": "^3.3.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM ghcr.io/nationalarchives/tna-python:latest | ||
|
||
COPY --chown=app test . | ||
COPY --chown=app ../tna_frontend_jinja /home/app/tna_frontend_jinja | ||
|
||
RUN tna-build | ||
|
||
CMD ["tna-run", "app:app"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
from flask import Flask | ||
from .components import bp as components_bp | ||
from .utilities import bp as utilities_bp | ||
from .templates import bp as templates_bp | ||
|
||
app = Flask(__name__, template_folder="/home/app/tna_frontend_jinja/templates") | ||
|
||
def create_app(): | ||
app = Flask(__name__, template_folder="../../tna_frontend_jinja/templates") | ||
|
||
from .components import bp as components_bp | ||
from .utilities import bp as utilities_bp | ||
from .templates import bp as templates_bp | ||
@app.route("/ready/") | ||
def ready(): | ||
return "ok" | ||
|
||
app.register_blueprint(components_bp, url_prefix="/components") | ||
app.register_blueprint(utilities_bp, url_prefix="/utilities") | ||
app.register_blueprint(templates_bp, url_prefix="/templates") | ||
|
||
return app | ||
app.register_blueprint(components_bp, url_prefix="/components") | ||
app.register_blueprint(utilities_bp, url_prefix="/utilities") | ||
app.register_blueprint(templates_bp, url_prefix="/templates") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.