feat: Dockerize + workflow WIP
Some checks failed
Docker build and push / terraform (push) Failing after 5s
Some checks failed
Docker build and push / terraform (push) Failing after 5s
Signed-off-by: Artémis Michelot <artemis.michelot@gmail.com>
This commit is contained in:
23
.gitea/workflows/terraform_auto_apply.yaml
Normal file
23
.gitea/workflows/terraform_auto_apply.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
name: Docker build and push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
|
||||
env:
|
||||
TOKEN: ${{ secrets.GRANT_ALL }}
|
||||
|
||||
jobs:
|
||||
terraform:
|
||||
runs-on: ubuntu-dind-noble
|
||||
steps:
|
||||
# - name: Checkout code
|
||||
# uses: actions/checkout@v4
|
||||
|
||||
- name: ouais
|
||||
run: |
|
||||
docker info
|
||||
docker ps
|
||||
cat ~/.docker/config.json
|
||||
|
||||
37
.gitea/workflows/terraform_plan.yaml
Normal file
37
.gitea/workflows/terraform_plan.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Terraform plan
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- "main"
|
||||
|
||||
env:
|
||||
TF_HTTP_USERNAME: ${{ secrets.TF_HTTP_USERNAME }}
|
||||
TF_HTTP_PASSWORD: ${{ secrets.TF_HTTP_PASSWORD }}
|
||||
OVH_ENDPOINT: ${{ vars.OVH_ENDPOINT }}
|
||||
OVH_APPLICATION_KEY: ${{ secrets.OVH_APPLICATION_KEY }}
|
||||
OVH_APPLICATION_SECRET: ${{ secrets.OVH_APPLICATION_SECRET }}
|
||||
OVH_CONSUMER_KEY: ${{ secrets.OVH_CONSUMER_KEY }}
|
||||
|
||||
jobs:
|
||||
terraform:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download latest terraform version
|
||||
run: |
|
||||
TFV=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version')
|
||||
curl -JOL "https://releases.hashicorp.com/terraform/${TFV}/terraform_${TFV}_linux_amd64.zip"
|
||||
unzip "terraform_${TFV}_linux_amd64.zip"
|
||||
cp terraform /usr/bin/
|
||||
chmod +x /usr/bin/terraform
|
||||
|
||||
- name: Terraform Init & Format
|
||||
run: |
|
||||
terraform init
|
||||
terraform fmt -check -recursive
|
||||
|
||||
- name: Terraform Plan
|
||||
run: terraform plan -out=tfplan
|
||||
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM gitea.dotty.fr/dotty/ubuntu-poetry-latest:latest
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
|
||||
COPY poetry.lock pyproject.toml /app/
|
||||
RUN poetry install --no-root
|
||||
COPY main.py /app/
|
||||
|
||||
CMD ["python", "main.py"]
|
||||
|
||||
18
poetry.lock
generated
18
poetry.lock
generated
@@ -265,6 +265,7 @@ files = [
|
||||
|
||||
[package.dependencies]
|
||||
cffi = {version = ">=2.0.0", markers = "python_full_version >= \"3.9.0\" and platform_python_implementation != \"PyPy\""}
|
||||
typing-extensions = {version = ">=4.13.2", markers = "python_full_version < \"3.11.0\""}
|
||||
|
||||
[package.extras]
|
||||
docs = ["sphinx (>=5.3.0)", "sphinx-inline-tabs", "sphinx-rtd-theme (>=3.0.0)"]
|
||||
@@ -326,6 +327,19 @@ urllib3 = ">=1.21.1,<3"
|
||||
socks = ["PySocks (>=1.5.6,!=1.5.7)"]
|
||||
use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]
|
||||
|
||||
[[package]]
|
||||
name = "typing-extensions"
|
||||
version = "4.15.0"
|
||||
description = "Backported and Experimental Type Hints for Python 3.9+"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["main"]
|
||||
markers = "python_full_version < \"3.11.0\""
|
||||
files = [
|
||||
{file = "typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548"},
|
||||
{file = "typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "urllib3"
|
||||
version = "2.5.0"
|
||||
@@ -346,5 +360,5 @@ zstd = ["zstandard (>=0.18.0)"]
|
||||
|
||||
[metadata]
|
||||
lock-version = "2.1"
|
||||
python-versions = ">=3.13"
|
||||
content-hash = "3a39350e7334cb4a252ccafec69ebd9ab6bf756d04aa5f1448488d2aee012da5"
|
||||
python-versions = ">=3.10"
|
||||
content-hash = "85832ddd37ae12d3b07744183307264b264db0279412f38aa9bf8db211f88f61"
|
||||
|
||||
@@ -6,7 +6,7 @@ authors = [
|
||||
{name = "Artémis Michelot",email = "artemis.michelot@gmail.com"}
|
||||
]
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.13"
|
||||
requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
"requests (>=2.32.5,<3.0.0)",
|
||||
"cryptography (>=46.0.1,<47.0.0)"
|
||||
|
||||
Reference in New Issue
Block a user