Skip to content

Commit

Permalink
add cli and possibilityu to add initial user
Browse files Browse the repository at this point in the history
  • Loading branch information
worph committed Aug 30, 2024
1 parent bcc5020 commit 56418d0
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@
path = CasaOS-UserService
url = https://github.com/worph/CasaOS-UserService.git
branch = main
[submodule "CasaOS-CLI"]
path = CasaOS-CLI
url = https://github.com/worph/CasaOS-CLI.git
branch = main
2 changes: 1 addition & 1 deletion CasaOS-AppManagement
1 change: 1 addition & 0 deletions CasaOS-CLI
Submodule CasaOS-CLI added at 51949f
2 changes: 1 addition & 1 deletion CasaOS-UserService
Submodule CasaOS-UserService updated 1 files
+25 −0 main.go
41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,41 @@ RUN go build -o casaos-main .
# default config
COPY ./CasaOS/build/sysroot/etc/casaos/casaos.conf.sample /etc/casaos/casaos.conf

############################################################################################################
# Build the Go binary for the CasaOS Cli
############################################################################################################
FROM golang:1.21-alpine AS builder-casaos-cli

WORKDIR /app

COPY ./CasaOS-CLI/go.mod ./
COPY ./CasaOS-CLI/go.sum ./

#see main.go
RUN mkdir -p codegen/app_management && \
go run github.com/deepmap/oapi-codegen/cmd/[email protected] \
-generate types,client -package app_management https://raw.githubusercontent.com/IceWhaleTech/CasaOS-AppManagement/main/api/app_management/openapi.yaml > codegen/app_management/api.go
RUN mkdir -p codegen/casaos && \
go run github.com/deepmap/oapi-codegen/cmd/[email protected] \
-generate types,client -package casaos https://raw.githubusercontent.com/IceWhaleTech/CasaOS/main/api/casaos/openapi.yaml > codegen/casaos/api.go
RUN mkdir -p codegen/local_storage && \
go run github.com/deepmap/oapi-codegen/cmd/[email protected] \
-generate types,client -package local_storage https://raw.githubusercontent.com/IceWhaleTech/CasaOS-LocalStorage/main/api/local_storage/openapi.yaml > codegen/local_storage/api.go
RUN mkdir -p codegen/message_bus && \
go run github.com/deepmap/oapi-codegen/cmd/[email protected] \
-generate types,client -package message_bus https://raw.githubusercontent.com/IceWhaleTech/CasaOS-MessageBus/main/api/message_bus/openapi.yaml > codegen/message_bus/api.go
RUN mkdir -p codegen/user_service && \
go run github.com/deepmap/oapi-codegen/cmd/[email protected] \
-generate types,client -package user_service https://raw.githubusercontent.com/IceWhaleTech/CasaOS-UserService/main/api/user-service/openapi.yaml > codegen/user_service/api.go

RUN go mod download

COPY ./CasaOS-CLI/build ./build
COPY ./CasaOS-CLI/cmd ./cmd
COPY ./CasaOS-CLI/main.go ./main.go

RUN go build -o casaos-cli .

############################################################################################################
# Build the final image
############################################################################################################
Expand All @@ -245,6 +280,9 @@ RUN curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh

# Set environment variables
ENV GO_ENV=production
ENV REF_SEPARATOR=-
ENV REF_SCHEME=https
ENV REF_PORT=443


# Set the Current Working Directory inside the container
Expand Down Expand Up @@ -293,6 +331,9 @@ COPY --from=builder-casaos-main /app/casaos-main .
#COPY --from=builder-casaos-main /etc/casaos/casaos.conf /etc/casaos/casaos.conf
COPY ./conf/casaos/casaos.conf /etc/casaos/casaos.conf

# Copy the Pre-built binary file from the cli
COPY --from=builder-casaos-cli /app/casaos-cli .

COPY ./entrypoint.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh

Expand Down
2 changes: 1 addition & 1 deletion dev/win/build-docker-img.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Define variables
$imageName = "casa-os"
$imageName = "casa-img"
$dockerfilePath = "../.."
$originalPath = Get-Location

Expand Down
2 changes: 1 addition & 1 deletion dockflow.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"registry": "nasselle",
"image": "casa-img",
"version": "1.0.2"
"version": "1.0.3"
}

0 comments on commit 56418d0

Please sign in to comment.