-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from splunk/develop
Merge base build for 3.22
- Loading branch information
Showing
7 changed files
with
335 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| version: 2 | ||
| jobs: | ||
| build: | ||
| environment: | ||
| IMAGE_NAME: rfaircloth/scs | ||
| docker: | ||
| - image: circleci/buildpack-deps:stretch | ||
| steps: | ||
| - checkout | ||
| - run: git submodule sync | ||
| - run: git submodule update --init --recursive | ||
| - setup_remote_docker: | ||
| docker_layer_caching: true | ||
| - run: | ||
| name: Docker Login | ||
| command: docker login -u $DOCKER_USER -p $DOCKER_PASS | ||
| - run: | ||
| name: Build Docker image | ||
| command: pushd package; docker build -f Dockerfile --build-arg RH_ORG=$RH_ORG --build-arg RH_ACTIVATION=$RH_ACTIVATION -t $IMAGE_NAME:build . | ||
| - run: | ||
| name: Tag Docker image | ||
| command: docker tag $IMAGE_NAME:build $IMAGE_NAME:$CIRCLE_SHA1 | ||
| - run: | ||
| name: Push Docker image | ||
| command: docker push $IMAGE_NAME:$CIRCLE_SHA1 | ||
| dgoss: | ||
| environment: | ||
| IMAGE_NAME: rfaircloth/scs | ||
| GOSS_VER: v0.3.7 | ||
| GOSS_OPTS: "--max-concurrent=1 --format junit" | ||
| GOSS_FILES_STRATEGY: cp | ||
|
|
||
| docker: | ||
| - image: circleci/buildpack-deps:stretch | ||
| steps: | ||
| - checkout | ||
| - setup_remote_docker: | ||
| docker_layer_caching: true | ||
| - run: | ||
| name: Docker Login | ||
| command: docker login -u $DOCKER_USER -p $DOCKER_PASS | ||
| - run: | ||
| name: Docker pull | ||
| command: docker pull $IMAGE_NAME:$CIRCLE_SHA1 | ||
| - run: | ||
| name: Install goss | ||
| command: | | ||
| # rather than give internet scripts SU rights, we install to local user bin and add to path | ||
| curl -fsSL https://goss.rocks/install | GOSS_VER=v0.3.7 sudo sh | ||
| goss -version | ||
| - run: | ||
| name: Test Docker | ||
| command: | | ||
| mkdir -p ~/project/test-results | ||
| # Don't forget path! | ||
| export PATH=$PATH:~/bin | ||
| pushd package | ||
| GOSS_FMT_OPTIONS="perfdata verbose" GOSS_FILES_STRATEGY=cp GOSS_OPTS="--max-concurrent=1 --format junit" dgoss run -t $IMAGE_NAME:$CIRCLE_SHA1 3>&1 1>&2 2>&3 > /tmp/goss.tmp || true ; cat /tmp/goss.tmp | grep -v "<" | ||
| popd | ||
| cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml | ||
| - store_test_results: | ||
| path: test-results | ||
| publish: | ||
| environment: | ||
| IMAGE_NAME: rfaircloth/scs | ||
| docker: | ||
| - image: circleci/buildpack-deps:stretch | ||
| steps: | ||
| - setup_remote_docker: | ||
| docker_layer_caching: true | ||
| - run: | ||
| name: Docker Login | ||
| command: docker login -u $DOCKER_USER -p $DOCKER_PASS | ||
| - run: | ||
| name: Docker pull | ||
| command: docker pull $IMAGE_NAME:$CIRCLE_SHA1 | ||
| - run: | ||
| name: Docker tag image | ||
| command: docker tag $IMAGE_NAME:$CIRCLE_SHA1 $IMAGE_NAME:$CIRCLE_BRANCH | ||
| - run: | ||
| name: Docker push tag | ||
| command: docker push $IMAGE_NAME:$CIRCLE_BRANCH | ||
|
|
||
|
|
||
|
|
||
| workflows: | ||
| version: 2 | ||
| build-publish: | ||
| jobs: | ||
| - build | ||
| - dgoss: | ||
| requires: | ||
| - build | ||
| - publish: | ||
| requires: | ||
| - dgoss | ||
| filters: | ||
| branches: | ||
| only: | ||
| - master | ||
| - develop |
Oops, something went wrong.