Skip to content
Open
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
22 changes: 22 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.git
.vscode

charts
deployments
docs
examples

.gitignore
.travis.yml
coverage.txt
glide.*
README.md

# ignore compiled files
debug
test/e2e/e2e.test
workflow-controller

# ignore vendor tests
vendor/*/*/test
vendor/*/*/*/test
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ os: linux
sudo: required
services:
- docker
addons:
apt:
packages:
- docker-ce
go:
- 1.8.3
go_import_path: github.com/sdminonne/workflow-controller
Expand All @@ -18,8 +22,7 @@ install:
- helm init --service-account tiller

script:
- make build
- make test
- make container_test
- make container
- helm install --version latest -n end2end-test charts/workflow-controller
- while [ $(kubectl get pod --selector=app=workflow-controller | grep 'workflow-controller' | awk '{print $3}') != "Running" ]; do echo "$(kubectl get pod --selector=app=workflow-controller)"; sleep 5; done
Expand Down
33 changes: 32 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,39 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ----- Go Dev Image ------
#
FROM golang:1.9 AS godev

# set working directory
RUN mkdir -p /go/src/github.com/sdminonne/workflow-controller
WORKDIR /go/src/github.com/sdminonne/workflow-controller

# copy sources
COPY . .

#
# ------ Go Test Runner ------
#
FROM godev AS tester

# run tests
ENTRYPOINT ["make"]
CMD ["test"]

#
# ------ Go Builder ------
#
FROM godev AS builder

# build binary
RUN make

#
# ------ Workflow Controller image ------
#
FROM busybox
LABEL maintainer "salvatore-dario.minonne@amadeus.com"
ADD workflow-controller /workflow-controller
COPY --from=builder /go/src/github.com/sdminonne/workflow-controller/workflow-controller /workflow-controller
ENTRYPOINT ["/workflow-controller"]
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ build: ${ARTIFACT}
${ARTIFACT}: ${SOURCES}
CGO_ENABLED=0 GOOS=linux go build -i -installsuffix cgo -ldflags '-w' -o ${ARTIFACT} ./main.go

container: build
container:
docker build -t $(PREFIX):$(TAG) .

container_test:
touch coverage.txt
docker build -t $(PREFIX):tester --target tester .
docker run -it --rm --name tester -v $(PWD)/coverage.txt:/go/src/github.com/sdminonne/workflow-controller/coverage.txt $(PREFIX):tester

test:
./go.test.sh

Expand Down