Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Commit

Permalink
automate release
Browse files Browse the repository at this point in the history
Signed-off-by: Chuck Ha <[email protected]>
  • Loading branch information
chuckha committed Jul 22, 2019
1 parent c43ace4 commit d7e9c62
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 53 deletions.
33 changes: 0 additions & 33 deletions .github/main.workflow

This file was deleted.

21 changes: 21 additions & 0 deletions .github/release.workflow
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
workflow "Release" {
on = "push"
resolves = ["Setup Google Cloud"]
}

action "Setup Google Cloud" {
uses = "actions/gcloud/auth@master"
secrets = ["GCLOUD_AUTH"]
}

action "is-tag" {
uses = "actions/bin/filter@master"
args = "tag"
}

action "goreleaser" {
uses = "docker://goreleaser/goreleaser"
secrets = []
args = "release"
needs = ["is-tag", "Setup Google Cloud"]
}
16 changes: 15 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ before:
hooks:
- go mod download
builds:
- env:
-
id: capdctl
env:
- CGO_ENABLED=0
main: ./cmd/capdctl/main.go
binary: capdctl
Expand All @@ -13,6 +15,16 @@ builds:
- darwin
goarch:
- amd64
-
id: capd-manager
env:
- CGO_ENABLED=0
main: ./cmd/capd-manager/main.go
binary: capd-manager
goos:
- linux
goarch:
- amd64
archives:
- replacements:
darwin: Darwin
Expand All @@ -25,6 +37,8 @@ snapshot:
dockers:
- goos: linux
goarch: amd64
binaries:
- capd-manager
image_templates:
- "gcr.io/kubernetes1-226021/capd-manager:v{{.Version}}"
- "gcr.io/kubernetes1-226021/capd-manager:v{{.Major}}.{{.Minor}}"
Expand Down
21 changes: 5 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.12.6
WORKDIR /cluster-api-provider-docker
ADD go.mod go.mod
ADD go.sum go.sum
RUN go mod download
RUN curl -L https://dl.k8s.io/v1.14.4/kubernetes-client-linux-amd64.tar.gz | tar xvz
ADD cmd cmd
ADD actuators actuators
ADD kind kind
ADD third_party third_party

RUN go install -v ./cmd/capd-manager
FROM golang:1.12.7
WORKDIR /tmp
RUN curl -L https://dl.k8s.io/v1.14.4/kubernetes-client-linux-amd64.tar.gz | tar xvz
RUN mv /tmp/kubernetes/client/bin/kubectl /usr/local/bin
RUN curl https://get.docker.com | sh
COPY capd-manager /usr/local/bin

FROM golang:1.12.5
COPY --from=0 /cluster-api-provider-docker/kubernetes/client/bin/kubectl /usr/local/bin
COPY --from=0 /go/bin/capd-manager /usr/local/bin
COPY --from=0 /usr/bin/docker /usr/local/bin
ENTRYPOINT ["capd-manager"]
5 changes: 2 additions & 3 deletions cmd/capd-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,12 @@ func main() {
os.Exit(1)
}

clusterLogger := log.WithName("cluster-actuator")
clusterLogger := klogr.New().WithName("cluster-actuator")
clusterActuator := actuators.Cluster{
Log: clusterLogger,
}

machineLogger := log.WithName("machine-actuator")

machineLogger := klogr.New().WithName("machine-actuator")
machineActuator := actuators.Machine{
Core: k8sclientset.CoreV1(),
ClusterAPI: cs.ClusterV1alpha1(),
Expand Down

0 comments on commit d7e9c62

Please sign in to comment.