1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-28 10:47:23 +00:00

Merge pull request #160 from marquiz/feature/travis

travis: add deploy step to automatically push docker image
This commit is contained in:
Kubernetes Prow Robot 2019-06-19 17:24:49 -07:00 committed by GitHub
commit cb2fbba043
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 11 deletions

View file

@ -1,7 +1,19 @@
language: minimal
env:
global:
# Sanitize git branch name into a valid docker tag name
- IMAGE_TAG_NAME=$(echo -n $TRAVIS_BRANCH | tr -c "[a-zA-Z0-9._'" "_")
services:
- docker
script:
- docker build -t quay.io/kubernetes_incubator/node-feature-discovery .
- make image -e
deploy:
on:
branch: master
condition: -n "$IMAGE_REPO_USER"
provider: script
script: echo "$IMAGE_REPO_PASSWORD" | docker login -u "$IMAGE_REPO_USER" --password-stdin quay.io && make push -e

View file

@ -2,6 +2,8 @@
.FORCE:
IMAGE_BUILD_CMD := docker build
IMAGE_BUILD_EXTRA_OPTS :=
IMAGE_PUSH_CMD := docker push
VERSION := $(shell git describe --tags --dirty --always)
@ -19,7 +21,8 @@ all: image
image: yamls
$(IMAGE_BUILD_CMD) --build-arg NFD_VERSION=$(VERSION) \
-t $(IMAGE_TAG) ./
-t $(IMAGE_TAG) \
$(IMAGE_BUILD_EXTRA_OPTS) ./
yamls: $(yaml_instances)
@ -39,3 +42,6 @@ mock:
test:
go test ./cmd/... ./pkg/...
push:
$(IMAGE_PUSH_CMD) $(IMAGE_TAG)

View file

@ -611,15 +611,17 @@ attribute in the spec template(s) to the new location
There are several Makefile variables that control the build process and the
name of the resulting container image.
| Variable | Description | Default value
| -------------- | ------------------------------------ | ------------------- |
| IMAGE_BUILD_CMD | Command to build the image | docker build
| IMAGE_REGISTRY | Container image registry to use | quay.io/kubernetes_incubator
| IMAGE_NAME | Container image name | node-feature-discovery
| IMAGE_TAG_NAME | Container image tag name | <nfd version>
| IMAGE_REPO | Container image repository to use | <IMAGE_REGISTRY>/<IMAGE_NAME>
| IMAGE_TAG | Full image:tag to tag the image with | <IMAGE_REPO>/<IMAGE_NAME>
| K8S_NAMESPACE | nfd-master and nfd-worker namespace | kube-system
| Variable | Description | Default value
| ---------------------- | -------------------------------------------- | ----------- |
| IMAGE_BUILD_CMD | Command to build the image | docker build
| IMAGE_BUILD_EXTRA_OPTS | Extra options to pass to build command | *empty*
| IMAGE_PUSH_CMD | Command to push the image to remote registry | docker push
| IMAGE_REGISTRY | Container image registry to use | quay.io/kubernetes_incubator
| IMAGE_NAME | Container image name | node-feature-discovery
| IMAGE_TAG_NAME | Container image tag name | <nfd version>
| IMAGE_REPO | Container image repository to use | <IMAGE_REGISTRY>/<IMAGE_NAME>
| IMAGE_TAG | Full image:tag to tag the image with | <IMAGE_REPO>/<IMAGE_NAME>
| K8S_NAMESPACE | nfd-master and nfd-worker namespace | kube-system
For example, to use a custom registry:
```