From 887a529b86a370521978865c60a9ae9dbe5625b3 Mon Sep 17 00:00:00 2001 From: Sciocatti Date: Thu, 12 Jan 2023 13:44:22 +0200 Subject: [PATCH] Bootstrapped. --- Dockerfile | 14 +++++++++++++- {template => cicd}/Jenkinsfile | 4 ++-- config.conf | 2 +- template/setup.sh | 27 --------------------------- 4 files changed, 16 insertions(+), 31 deletions(-) rename {template => cicd}/Jenkinsfile (94%) delete mode 100755 template/setup.sh diff --git a/Dockerfile b/Dockerfile index 6e600c7..4224f50 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1 +1,13 @@ -FROM nginx:latest \ No newline at end of file +FROM python:3.8-slim + +RUN python3 -m venv /venv + +RUN . /venv/bin/activate && pip install --no-cache-dir anyio==3.6.1 asgiref==3.5.2 \ +certifi==2022.6.15 charset-normalizer==2.0.12 click==8.1.3 dnspython==2.2.1 email-validator==1.2.1 \ +fastapi==0.78.0 h11==0.13.0 httptools==0.4.0 idna==3.3 itsdangerous==2.1.2 Jinja2==3.1.2 \ +MarkupSafe==2.1.1 orjson==3.7.3 pydantic==1.9.1 python-dateutil==2.8.2 python-dotenv==0.20.0 \ +python-multipart==0.0.5 PyYAML==6.0 requests==2.28.0 six==1.16.0 sniffio==1.2.0 starlette==0.19.1 \ +typing-extensions==4.2.0 ujson==5.3.0 urllib3==1.26.9 uvicorn==0.17.6 uvloop==0.16.0 watchgod==0.8.2 \ +websockets==10.3 SQLAlchemy==1.4.42 PyMySQL==1.0.2 mysql-connector-python==8.0.31 xmltodict==0.13.0 + +CMD . /venv/bin/activate && exec python \ No newline at end of file diff --git a/template/Jenkinsfile b/cicd/Jenkinsfile similarity index 94% rename from template/Jenkinsfile rename to cicd/Jenkinsfile index d2775b9..4b39495 100644 --- a/template/Jenkinsfile +++ b/cicd/Jenkinsfile @@ -8,11 +8,11 @@ pipeline { apiVersion: v1 kind: Pod metadata: - name: {{k3sApp}}-image-build + name: fastapi-arm-image-build spec: serviceAccountName: jenkins-admin nodeSelector: - kubernetes.io/arch: {{k3sArch}} + kubernetes.io/arch: arm64 containers: - name: kaniko image: gcr.io/kaniko-project/executor:debug diff --git a/config.conf b/config.conf index 5d50dbb..5b9aa3a 100644 --- a/config.conf +++ b/config.conf @@ -1,3 +1,3 @@ destinationRegistry=192.168.195.195:30000 -imageName=nginx +imageName=fastapi-arm imageTag=latest \ No newline at end of file diff --git a/template/setup.sh b/template/setup.sh deleted file mode 100755 index 1ecf2a9..0000000 --- a/template/setup.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -echo "Hello, lets get your project set up. Please follow the prompts attentively." - -echo "" -read -p " K3S Build Pod Name: " k3sApp -read -p " Build Architecture: [amd64 | arm64] " k3sArch - -echo "" -echo "Creating Folders" - echo " Creating cicd/" - mkdir cicd - -echo "" -echo "Loading files" -echo " Loading cicd/Jenkinsfile" -cp template/Jenkinsfile cicd/Jenkinsfile -sed -ie "s|{{k3sApp}}|$k3sApp|g" cicd/Jenkinsfile -sed -ie "s|{{k3sArch}}|$k3sArch|g" cicd/Jenkinsfile -rm cicd/Jenkinsfilee - -echo "" -echo "Removing template folder" -rm -rf template - -echo "" -echo "Thank you! Happy building..."