Init commit
parent
ab8b19c1e9
commit
d9f86158af
|
|
@ -0,0 +1,5 @@
|
|||
README.md
|
||||
Jenkinsfile
|
||||
Dockerfile
|
||||
.gitignore
|
||||
.idea
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="SpellCheckingInspection" enabled="true" level="INFORMATION" enabled_by_default="true">
|
||||
<option name="processCode" value="true" />
|
||||
<option name="processLiterals" value="true" />
|
||||
<option name="processComments" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/test-ci-cd.iml" filepath="$PROJECT_DIR$/.idea/test-ci-cd.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="Go" enabled="true" />
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
FROM golang:1.23.6 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod .
|
||||
|
||||
RUN go mod tidy
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server main.go
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/server /app/server
|
||||
|
||||
RUN chmod +x /app/server
|
||||
|
||||
ENTRYPOINT ["/app/server"]
|
||||
|
|
@ -1,2 +1,5 @@
|
|||
# test-ci-cd
|
||||
|
||||
```bash
|
||||
docker build -t test-ci-cd .
|
||||
docker run --rm --name test-ci-cd -p 8000:8080 test-ci-cd:latest
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func handler(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w, "Hello, World!")
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", handler)
|
||||
|
||||
port := ":8080"
|
||||
fmt.Println("Сервер запущен на порту", port)
|
||||
if err := http.ListenAndServe(port, nil); err != nil {
|
||||
fmt.Println("Ошибка запуска сервера:", err)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue