-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into smi-conformace
- Loading branch information
Showing
8 changed files
with
238 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Learn Layer5 | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
docker: | ||
name: Docker build and push | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success() | ||
uses: actions/checkout@master | ||
with: | ||
fetch-depth: 1 | ||
- name: Docker login | ||
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success() | ||
uses: azure/docker-login@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Docker build & push | ||
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success() | ||
run: | | ||
make build-img-service | ||
make image-push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
VER=$(shell git rev-parse --short HEAD) | ||
|
||
build-service: | ||
cd service && go build -a -o ./main . | ||
|
||
run-service: build-service | ||
run-service-a: | ||
SERVICE_NAME="service-a" \ | ||
PORT=9091 \ | ||
./service/main | ||
|
||
run-service-b: | ||
SERVICE_NAME="service-b" \ | ||
PORT=9092 \ | ||
./service/main | ||
|
||
build-img-service: | ||
cd service && docker build -t layer5/sample-app-service:dev . | ||
cd service && docker build -t layer5/learn-layer5:latest -t layer5/learn-layer5:$(VER) . | ||
|
||
image-push: | ||
docker push layer5/learn-layer5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM golang:1.13.5 as bd | ||
WORKDIR /github.com/layer5io/sample-app-service | ||
ADD . . | ||
RUN GOPROXY=direct GOSUMDB=off go build -a -o /main . | ||
CMD ["/main"] | ||
RUN GOPROXY=direct GOSUMDB=off go build -a -o ./main . | ||
CMD ["./main"] |
Oops, something went wrong.