From d15f2350c081419b110b8464f37d8cf2161b82cd Mon Sep 17 00:00:00 2001 From: Sean Knox Date: Fri, 28 Jul 2017 23:36:34 -0700 Subject: [PATCH 1/5] chore(ci): use circle-ci as CI platform --- .circleci/config.yml | 36 ++++++++++++++++++++++++++++++++++++ Makefile | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000..1bdac0153b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,36 @@ +version: 2 +jobs: + test: + working_directory: /go/src/github.com/Azure/acs-engine + docker: + - image: circleci/golang:1.8 + steps: + - checkout + - run: + name: Run unit tests + command: make bootstrap build test + - run: + name: Generate test coverage results + command: make bootstrap build coverage + e2e: + working_directory: /go/src/github.com/Azure/acs-engine + docker: + - image: circleci/golang:1.8 + steps: + - setup_remote_docker: + reusable: true + - checkout + - run: + name: Pull latest image + command: docker pull microsoft/acs-engine:latest + - run: + name: Build current image + command: | + TAG="0.1.${CIRCLE_BUILD_NUM}" + docker build -t microsoft/acs-engine:$TAG . + +workflows: + version: 2 + build_and_test: + jobs: + - test diff --git a/Makefile b/Makefile index 1bed226944..2c34c93613 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ checksum: clean: @rm -rf $(BINDIR) ./_dist -test: test_fmt +test: test-style go test -v $(GOFILES) .PHONY: test-style From 76961879f10f86d428dc59a71e205887ca8e3e46 Mon Sep 17 00:00:00 2001 From: Sean Knox Date: Fri, 28 Jul 2017 23:37:48 -0700 Subject: [PATCH 2/5] ref(Dockerfile): cache make bootstrap step --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c6b2d4f5e8..10c97f720b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,10 @@ RUN git clone https://github.com/akesterson/cmdarg.git /tmp/cmdarg \ RUN git clone https://github.com/akesterson/shunit.git /tmp/shunit \ && cd /tmp/shunit && make install && rm -rf /tmp/shunit -# Used by some CI jobs -ADD ./test/bootstrap/checkout-pr.sh /tmp/checkout-pr.sh - WORKDIR /gopath/src/github.com/Azure/acs-engine + +# Cache vendor layer where possible +ADD Makefile versioning.mk glide.yaml glide.lock /gopath/src/github.com/Azure/acs-engine/ +RUN make bootstrap + +ADD . /gopath/src/github.com/Azure/acs-engine From 2f488a12c346d968e194cdf72eb73f2fbd5252ba Mon Sep 17 00:00:00 2001 From: Sean Knox Date: Fri, 28 Jul 2017 23:39:27 -0700 Subject: [PATCH 3/5] chore(ci): separate e2e tests into separate step --- .circleci/config.yml | 25 +++++++++++++++++++++++++ Makefile | 4 ++++ test/{acs-engine-test.sh => e2e.sh} | 2 -- 3 files changed, 29 insertions(+), 2 deletions(-) rename test/{acs-engine-test.sh => e2e.sh} (98%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1bdac0153b..63e680f759 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,9 +28,34 @@ jobs: command: | TAG="0.1.${CIRCLE_BUILD_NUM}" docker build -t microsoft/acs-engine:$TAG . + - run: + name: e2e tests + command: | + TAG="0.1.${CIRCLE_BUILD_NUM}" + cat > ./env.list < Date: Sat, 29 Jul 2017 01:06:46 -0700 Subject: [PATCH 4/5] ref(ci): require manual approval to start e2e tests --- .circleci/config.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 63e680f759..b5dca50cac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,4 +58,10 @@ workflows: build_and_test: jobs: - test - - e2e + - e2e-hold: + type: approval + requires: + - test + - e2e: + requires: + - e2e-hold From f835a502f16b6debb7013a58719d18f800d54739 Mon Sep 17 00:00:00 2001 From: Sean Knox Date: Mon, 31 Jul 2017 21:02:48 -0700 Subject: [PATCH 5/5] ref(ci): use microsoft/acs-engine:latest as base test image --- .circleci/config.yml | 21 +++++++++++++-------- .dockerignore | 5 ++++- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b5dca50cac..aec70f3055 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,26 +3,31 @@ jobs: test: working_directory: /go/src/github.com/Azure/acs-engine docker: - - image: circleci/golang:1.8 + - image: microsoft/acs-engine:latest steps: + - setup_remote_docker: + reusable: true - checkout - run: - name: Run unit tests - command: make bootstrap build test + name: Build current image + command: | + TAG="0.1.${CIRCLE_BUILD_NUM}" + docker build -t microsoft/acs-engine:$TAG . + - run: + name: Run style and unit tests + command: docker run --rm microsoft/acs-engine:$TAG make test-style build test - run: name: Generate test coverage results command: make bootstrap build coverage + command: docker run --rm microsoft/acs-engine:$TAG make build coverage e2e: working_directory: /go/src/github.com/Azure/acs-engine docker: - - image: circleci/golang:1.8 + - image: microsoft/acs-engine:latest steps: - setup_remote_docker: reusable: true - checkout - - run: - name: Pull latest image - command: docker pull microsoft/acs-engine:latest - run: name: Build current image command: | @@ -51,7 +56,7 @@ jobs: NUM_OF_RETRIES=2 TEST_CONFIG=test/acse-conf/acse-pr.json END - docker run --env-file ./env.list microsoft/acs-engine:$TAG make build test-e2e + docker run --rm --env-file ./env.list microsoft/acs-engine:$TAG make build test-e2e workflows: version: 2 diff --git a/.dockerignore b/.dockerignore index e4a98cc42c..046b83d286 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,4 +2,7 @@ ./acs-engine.exe ./_output ./.git -./test/acs-engine-test/acs-engine-test \ No newline at end of file +./test/acs-engine-test/acs-engine-test +## autogenerated +./pkg/i18n/translations.go +./pkg/acsengine/templates.go