refactor: use bin instead of build directory
This commit is contained in:
parent
8c6ded6794
commit
ff29c49867
@ -16,7 +16,7 @@
|
|||||||
<kind value="PACKAGE" />
|
<kind value="PACKAGE" />
|
||||||
<package value="golang-app" />
|
<package value="golang-app" />
|
||||||
<directory value="$PROJECT_DIR$" />
|
<directory value="$PROJECT_DIR$" />
|
||||||
<output_directory value="$PROJECT_DIR$/build" />
|
<output_directory value="$PROJECT_DIR$/bin" />
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
</component>
|
</component>
|
||||||
@ -1,6 +1,5 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="go test application" type="GoTestRunConfiguration" factoryName="Go Test">
|
<configuration default="false" name="go test application" type="GoTestRunConfiguration" factoryName="Go Test">
|
||||||
<module name="smart-bot" />
|
|
||||||
<working_directory value="$PROJECT_DIR$" />
|
<working_directory value="$PROJECT_DIR$" />
|
||||||
<EXTENSION ID="net.ashald.envfile">
|
<EXTENSION ID="net.ashald.envfile">
|
||||||
<option name="IS_ENABLED" value="true" />
|
<option name="IS_ENABLED" value="true" />
|
||||||
@ -13,11 +12,11 @@
|
|||||||
<ENTRY IS_ENABLED="true" PARSER="env" PATH=".env" />
|
<ENTRY IS_ENABLED="true" PARSER="env" PATH=".env" />
|
||||||
</ENTRIES>
|
</ENTRIES>
|
||||||
</EXTENSION>
|
</EXTENSION>
|
||||||
<framework value="gotest" />
|
|
||||||
<kind value="DIRECTORY" />
|
<kind value="DIRECTORY" />
|
||||||
<package value="smart-bot" />
|
<package value="golang-app" />
|
||||||
<directory value="$PROJECT_DIR$" />
|
<directory value="$PROJECT_DIR$" />
|
||||||
<filePath value="$PROJECT_DIR$" />
|
<filePath value="$PROJECT_DIR$" />
|
||||||
|
<framework value="gotest" />
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
</component>
|
</component>
|
||||||
@ -18,7 +18,7 @@ RUN go mod download
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the application
|
# Build the application
|
||||||
RUN go build -ldflags "-s -w" -o /bin/app .
|
RUN go build -ldflags "-s -w" -o bin/app .
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ WORKDIR /
|
|||||||
|
|
||||||
# Copy binary from build to main folder
|
# Copy binary from build to main folder
|
||||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
COPY --from=builder /bin/app app
|
COPY --from=builder /source/bin/app app
|
||||||
|
|
||||||
# Copy some application assets
|
# Copy some application assets
|
||||||
#COPY --from=builder /source/deploy/docker/environment.sh ./deploy/docker/environment.sh
|
#COPY --from=builder /source/deploy/docker/environment.sh ./deploy/docker/environment.sh
|
||||||
|
|||||||
2
Makefile
2
Makefile
@ -18,4 +18,4 @@ build:
|
|||||||
|
|
||||||
run:
|
run:
|
||||||
make build-backoffice-gateway
|
make build-backoffice-gateway
|
||||||
./build/app
|
./bin/app
|
||||||
|
|||||||
@ -12,12 +12,12 @@ cp .env.dist .env
|
|||||||
#### Build application
|
#### Build application
|
||||||
``` shell
|
``` shell
|
||||||
go mod tidy
|
go mod tidy
|
||||||
go build -ldflags "-s -w" -o build/app .
|
go build -ldflags "-s -w" -o bin/app .
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Run application
|
#### Run application
|
||||||
``` shell
|
``` shell
|
||||||
env $(cat .env|xargs) ./build/app
|
env $(cat .env|xargs) ./bin/app
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Test application
|
#### Test application
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user