Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: '1.17.6'
- run: GOOS=linux GOARCH=amd64 go build -o artifacts/pipecd ./cmd/pipecd
- run: GOOS=linux GOARCH=amd64 go build -o artifacts/piped ./cmd/piped
- run: GOOS=linux GOARCH=amd64 go build -o artifacts/launcher ./cmd/launcher
- run: GOOS=linux GOARCH=amd64 go build -o artifacts/pipectl ./cmd/pipectl
- run: GOOS=linux GOARCH=amd64 go build -o artifacts/helloworld ./cmd/helloworld

- name: Build pipecd binary
run: GOOS=linux GOARCH=amd64 go build -o ./.artifacts/pipecd ./cmd/pipecd
- name: Build piped binary
run: GOOS=linux GOARCH=amd64 go build -o ./.artifacts/piped ./cmd/piped
- name: Build launcher binary
run: GOOS=linux GOARCH=amd64 go build -o ./.artifacts/launcher ./cmd/launcher
- name: Build pipectl binary
run: GOOS=linux GOARCH=amd64 go build -o ./.artifacts/pipectl ./cmd/pipectl
- name: Build helloworld binary
run: GOOS=linux GOARCH=amd64 go build -o ./.artifacts/helloworld ./cmd/helloworld

test:
runs-on: ubuntu-latest
Expand All @@ -29,4 +35,5 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: '1.17.6'
- run: go test ./pkg/... ./cmd/...
- name: Run unit tests
run: go test ./pkg/... ./cmd/...
43 changes: 38 additions & 5 deletions .github/workflows/publish-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
REGISTRY: ghcr.io

jobs:
build-and-push-image:
publish-image:
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -19,19 +19,52 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: '1.17.6'
- run: make dep
- run: make build

- name: Log in to the Container registry
- name: Build pipecd binary
run: GOOS=linux GOARCH=amd64 go build -o ./.artifacts/pipecd ./cmd/pipecd
- name: Build piped binary
run: GOOS=linux GOARCH=amd64 go build -o ./.artifacts/piped ./cmd/piped
- name: Build launcher binary
run: GOOS=linux GOARCH=amd64 go build -o ./.artifacts/launcher ./cmd/launcher
- name: Build pipectl binary
run: GOOS=linux GOARCH=amd64 go build -o ./.artifacts/pipectl ./cmd/pipectl
- name: Build helloworld binary
run: GOOS=linux GOARCH=amd64 go build -o ./.artifacts/helloworld ./cmd/helloworld

- name: Log in to the container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
- name: Build and push pipecd image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
push: true
file: cmd/pipecd/Dockerfile
tags: ${{ env.REGISTRY }}/pipe-cd/pipecd:${{ github.ref_name }}
- name: Build and push piped image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
push: true
file: cmd/piped/Dockerfile
tags: ${{ env.REGISTRY }}/pipe-cd/piped:${{ github.ref_name }}
- name: Build and push launcher image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
push: true
file: cmd/launcher/Dockerfile
tags: ${{ env.REGISTRY }}/pipe-cd/launcher:${{ github.ref_name }}
- name: Build and push pipectl image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
push: true
file: cmd/pipectl/Dockerfile
tags: ${{ env.REGISTRY }}/pipe-cd/pipectl:${{ github.ref_name }}
- name: Build and push helloworld image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
push: true
file: cmd/helloworld/Dockerfile
tags: ${{ env.REGISTRY }}/pipe-cd/helloworld:${{ github.ref_name }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
/bazel-testlogs
/BUILD.bazel.generated

# Binaries
.artifacts

# Go
/vendor

Expand Down
5 changes: 5 additions & 0 deletions cmd/helloworld/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine:3.15

ADD .artifacts/helloworld .

ENTRYPOINT ["./helloworld"]
5 changes: 5 additions & 0 deletions cmd/launcher/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine:3.15

ADD .artifacts/launcher .

ENTRYPOINT ["./launcher"]
6 changes: 4 additions & 2 deletions cmd/pipecd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FROM alpine:3.15
FROM gcr.io/pipecd/pipecd-base@sha256:f3e98a27b85b8ead610c4f93cec8d936c760a43866cf817d32563daf9b198358

RUN apk --no-cache add ca-certificates
ADD .artifacts/pipecd .

ENTRYPOINT ["./pipecd"]
Binary file added cmd/pipecd/pipecd
Binary file not shown.
5 changes: 5 additions & 0 deletions cmd/pipectl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM gcr.io/pipecd/pipectl-base@sha256:0cf7eacedb0cc8d759248f0e25bd8eddf659de6f2c1db315ac95a272ec2e60cc

ADD .artifacts/pipectl .

ENTRYPOINT ["./pipectl"]
5 changes: 5 additions & 0 deletions cmd/piped/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM gcr.io/pipecd/piped-base@sha256:be303a0bc87480a26ee90c91288d47498e5742e90e7803cc4f2e11bfcbffb118

ADD .artifacts/piped .

ENTRYPOINT ["./piped"]