Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 95947e25bd | |||
| b97c1de0df | |||
| 97fda1aa26 | |||
| a9af5182dd | |||
| 581553a70f | |||
| 6ba1dda43f | |||
| 67fc3a08e5 | |||
| 073013c7a4 | |||
| dd6240dcab | |||
| d7e9867ad7 | |||
| 32d5fa1ccc | |||
| b60a00d1e2 | |||
| 65af3e65c9 | |||
| 8c03a54db6 | |||
| 091a721dc9 | |||
| 2f88d401b4 | |||
| 46b36f449c | |||
| 016a6dfb21 | |||
| abb6599234 | |||
| 175c53e632 | |||
| 4b7d9b1a41 | |||
| c9d6a821bf | |||
| 10853b8252 | |||
| 54d5d42e98 | |||
| 55744a4a7c | |||
| 80b3ff2d4d | |||
| 6a1733afa8 | |||
| 09ee7386fd |
13
.drone.yml
13
.drone.yml
@ -34,7 +34,7 @@ steps:
|
||||
image: alpine:latest
|
||||
environment:
|
||||
GITEA_TOKEN:
|
||||
from_secret: GITEA_TOKEN
|
||||
from_secret: DroneToken
|
||||
commands:
|
||||
- apk add --no-cache git
|
||||
|
||||
@ -42,18 +42,15 @@ steps:
|
||||
- git config --global user.email "drone@ci.local"
|
||||
- git config --global user.name "Drone CI"
|
||||
|
||||
# Remote setzen
|
||||
#- git remote set-url origin https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2
|
||||
|
||||
# Repo clonen
|
||||
- git clone https://git.efi.th-nuernberg.de/gitea/freudenreichan/EinfuehrungInDocker_Pipeline2.git
|
||||
- cd EinfuehrungInDocker_Pipeline
|
||||
- git clone https://$GITEA_TOKEN@git.efi.th-nuernberg.de/gitea/jannerju95124/EinfuehrungInDocker_Pipeline2.git
|
||||
- cd EinfuehrungInDocker_Pipeline2
|
||||
|
||||
# Branch wechseln oder erstellen
|
||||
- git checkout drone-artifacts || git checkout -b drone-artifacts
|
||||
|
||||
# Artifact löschen und neu hinzufügen
|
||||
- git rm image.tar
|
||||
- git rm image.tar || true
|
||||
- cp $DRONE_WORKSPACE/image.tar .
|
||||
- git add image.tar
|
||||
|
||||
@ -64,4 +61,4 @@ steps:
|
||||
- git pull || true
|
||||
|
||||
# Push
|
||||
- git push
|
||||
- git push --set-upstream origin drone-artifacts
|
||||
18
.vscode/c_cpp_properties.json
vendored
Normal file
18
.vscode/c_cpp_properties.json
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "windows-gcc-x64",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"compilerPath": "C:/ProgramData/mingw64/mingw64/bin/gcc.exe",
|
||||
"cStandard": "${default}",
|
||||
"cppStandard": "${default}",
|
||||
"intelliSenseMode": "windows-gcc-x64",
|
||||
"compilerArgs": [
|
||||
""
|
||||
]
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
24
.vscode/launch.json
vendored
Normal file
24
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "C/C++ Runner: Debug Session",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"externalConsole": true,
|
||||
"cwd": "c:/UNI/6.Semester/Docker/Austausch/Healthcheck/EinfuehrungInDocker_Pipeline2",
|
||||
"program": "c:/UNI/6.Semester/Docker/Austausch/Healthcheck/EinfuehrungInDocker_Pipeline2/build/Debug/outDebug",
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "gdb",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
59
.vscode/settings.json
vendored
Normal file
59
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"C_Cpp_Runner.cCompilerPath": "gcc",
|
||||
"C_Cpp_Runner.cppCompilerPath": "g++",
|
||||
"C_Cpp_Runner.debuggerPath": "gdb",
|
||||
"C_Cpp_Runner.cStandard": "",
|
||||
"C_Cpp_Runner.cppStandard": "",
|
||||
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
|
||||
"C_Cpp_Runner.useMsvc": false,
|
||||
"C_Cpp_Runner.warnings": [
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
"-Wpedantic",
|
||||
"-Wshadow",
|
||||
"-Wformat=2",
|
||||
"-Wcast-align",
|
||||
"-Wconversion",
|
||||
"-Wsign-conversion",
|
||||
"-Wnull-dereference"
|
||||
],
|
||||
"C_Cpp_Runner.msvcWarnings": [
|
||||
"/W4",
|
||||
"/permissive-",
|
||||
"/w14242",
|
||||
"/w14287",
|
||||
"/w14296",
|
||||
"/w14311",
|
||||
"/w14826",
|
||||
"/w44062",
|
||||
"/w44242",
|
||||
"/w14905",
|
||||
"/w14906",
|
||||
"/w14263",
|
||||
"/w44265",
|
||||
"/w14928"
|
||||
],
|
||||
"C_Cpp_Runner.enableWarnings": true,
|
||||
"C_Cpp_Runner.warningsAsError": false,
|
||||
"C_Cpp_Runner.compilerArgs": [],
|
||||
"C_Cpp_Runner.linkerArgs": [],
|
||||
"C_Cpp_Runner.includePaths": [],
|
||||
"C_Cpp_Runner.includeSearch": [
|
||||
"*",
|
||||
"**/*"
|
||||
],
|
||||
"C_Cpp_Runner.excludeSearch": [
|
||||
"**/build",
|
||||
"**/build/**",
|
||||
"**/.*",
|
||||
"**/.*/**",
|
||||
"**/.vscode",
|
||||
"**/.vscode/**"
|
||||
],
|
||||
"C_Cpp_Runner.useAddressSanitizer": false,
|
||||
"C_Cpp_Runner.useUndefinedSanitizer": false,
|
||||
"C_Cpp_Runner.useLeakSanitizer": false,
|
||||
"C_Cpp_Runner.showCompilationTime": false,
|
||||
"C_Cpp_Runner.useLinkTimeOptimization": false,
|
||||
"C_Cpp_Runner.msvcSecureNoWarnings": false
|
||||
}
|
||||
24
Dockerfile
24
Dockerfile
@ -1,9 +1,8 @@
|
||||
# Base-Image
|
||||
FROM ubuntu:latest
|
||||
FROM alpine:latest AS builder
|
||||
|
||||
# Pakete installieren
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y build-essential gcc curl vim net-tools
|
||||
RUN apk add --no-cache build-base
|
||||
|
||||
# Arbeitsverzeichnis setzen
|
||||
WORKDIR /app
|
||||
@ -14,8 +13,25 @@ COPY . .
|
||||
# Code kompilieren
|
||||
RUN gcc -o deployment deployment.c
|
||||
|
||||
# Stage 2
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk upgrade --no-cache
|
||||
|
||||
RUN addgroup -S stdgroup && adduser -S stduser -G stdgroup
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/deployment .
|
||||
|
||||
|
||||
# Verzeichnis für Ausgabe anlegen
|
||||
RUN mkdir /output
|
||||
RUN mkdir /output && chown stduser:stdgroup /output
|
||||
|
||||
VOLUME ["/output"]
|
||||
USER stduser
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 CMD test -f /output/output.txt || exit 1
|
||||
|
||||
# Ausgabe wird ins Container-Dateisystem geschrieben
|
||||
ENTRYPOINT ["/bin/bash", "-c"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user