forked from FairwindsOps/rok8s-scripts
-
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.
Adding circleci orb build and config
Adding docker login. Adding a makefile for testing locally. Added notes to readme and contributing. Adding orb examples Updating Makefile to work with OSX Updating to v9.0 for the orb release
- Loading branch information
Andrew Suderman
committed
Jul 23, 2019
1 parent
943133a
commit ccc1fd1
Showing
14 changed files
with
217 additions
and
15 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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
version: 2 | ||
version: 2.1 | ||
|
||
orbs: | ||
orb-tools: circleci/[email protected] | ||
|
||
references: | ||
docker_login: &docker_login | ||
|
@@ -100,13 +103,12 @@ jobs: | |
- *docker_build | ||
- *docker_push | ||
|
||
|
||
workflows: | ||
version: 2 | ||
build_and_test: | ||
jobs: | ||
- test | ||
- build | ||
|
||
release: | ||
jobs: | ||
- release: | ||
|
@@ -115,3 +117,48 @@ workflows: | |
ignore: /.*/ | ||
tags: | ||
only: /^v.*/ | ||
|
||
"Orb Test and Publish": | ||
jobs: | ||
- orb-tools/lint: | ||
name: "lint-orb-files" | ||
lint-dir: orb | ||
filters: | ||
branches: | ||
only: /.*/ | ||
tags: | ||
only: /.*/ | ||
- orb-tools/pack: | ||
name: "pack-orb" | ||
source-dir: orb | ||
requires: | ||
- "lint-orb-files" | ||
filters: | ||
branches: | ||
only: /.*/ | ||
tags: | ||
only: /.*/ | ||
- orb-tools/publish: | ||
name: "publish-dev-branch-orb" | ||
orb-ref: reactiveops/rok8s-scripts@dev:${CIRCLE_BRANCH} | ||
publish-token-variable: CIRCLECI_DEV_API_TOKEN | ||
attach-workspace: true | ||
requires: | ||
- "pack-orb" | ||
filters: | ||
branches: | ||
only: /.*/ | ||
tags: | ||
ignore: /.*/ | ||
- orb-tools/publish: | ||
name: "publish-tagged-orb" | ||
orb-ref: reactiveops/rok8s-scripts@${CIRCLE_TAG} | ||
publish-token-variable: CIRCLECI_DEV_API_TOKEN | ||
attach-workspace: true | ||
requires: | ||
- "pack-orb" | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^v.*/ |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.vscode | ||
.DS_Store | ||
orb.yml |
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
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
docs-index: | ||
cat README.md \ | ||
| sed 's/\[\(.*\)\](\(\w\+\.md\))/[\1](https:\/\/github.com\/reactiveops\/rok8s-scripts\/tree\/master\/\2)/g' \ | ||
| sed 's/\[\(.*\)\](\/\?docs\/\(.*\))/[\1](\2)/g' \ | ||
| sed 's/\[\(.*\)\](\(\/.*\))/[\1](https:\/\/github.com\/reactiveops\/rok8s-scripts\/tree\/master\2)/g' \ | ||
| sed -E 's/\[(.*)\]\(([^\/]*\.md)\)/[\1](https:\/\/github.com\/reactiveops\/rok8s-scripts\/tree\/master\/\2)/g' \ | ||
| sed -E 's/\[(.*)\]\(\/*docs\/(.*)\)/[\1](\2)/g' \ | ||
| sed -E 's/\[(.*)\]\((\/.*)\)/[\1](https:\/\/github.com\/reactiveops\/rok8s-scripts\/tree\/master\2)/g' \ | ||
> docs/index.md | ||
orb-validate: | ||
circleci config pack orb/ > orb.yml | ||
circleci orb validate orb.yml |
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
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
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
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
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
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
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,47 @@ | ||
commands: | ||
set_env: | ||
description: Sets the needed rok8s-scripts environment variables from Circle | ||
steps: | ||
- run: | | ||
echo 'export CI_SHA1=$CIRCLE_SHA1' >> ${BASH_ENV} | ||
echo 'export CI_BRANCH=$CIRCLE_BRANCH' >> ${BASH_ENV} | ||
echo 'export CI_BUILD_NUM=$CIRCLE_BUILD_NUM' >> ${BASH_ENV} | ||
echo 'export CI_TAG=$CIRCLE_TAG' >> ${BASH_ENV} | ||
docker_login: | ||
description: Log into a docker repo | ||
parameters: | ||
registry: | ||
type: string | ||
description: The name of the docker registry. | ||
default: "quay.io" | ||
username: | ||
type: string | ||
description: The username to use for the registry. | ||
password-variable: | ||
type: string | ||
description: The environment variable name containing the password. | ||
steps: | ||
- run: | | ||
docker login -u="<<parameters.username>>" -p="$<<parameters.password-variable>>" <<parameters.registry>> | ||
docker_push: | ||
description: Pushes a docker image using rok8s-scripts | ||
parameters: | ||
config: | ||
type: string | ||
description: The location of the rok8s-scripts config file | ||
default: "deploy/build.config" | ||
steps: | ||
- run: | | ||
docker-push -f << parameters.config >> | ||
docker_build: | ||
description: Builds a docker image using rok8s-scripts | ||
parameters: | ||
config: | ||
type: string | ||
description: The location of the rok8s-scripts config file | ||
default: "deploy/build.config" | ||
steps: | ||
- setup_remote_docker | ||
- run: | | ||
docker-build -f << parameters.config >> |
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,2 @@ | ||
version: "2.1" | ||
description: "ReactiveOps rok8s-scripts. https://github.com/reactiveops/rok8s-scripts" |
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,25 @@ | ||
description: > | ||
Use this example to build and push a docker | ||
image using rok8s-scripts. This assumes that you | ||
have a working rok8s-scripts configuration already | ||
in place. | ||
usage: | ||
version: 2.1 | ||
|
||
orbs: | ||
rok8s-scripts: reactiveops/[email protected] | ||
|
||
workflows: | ||
build_and_push: | ||
jobs: | ||
- rok8s/docker_build_and_push: | ||
config_file: deploy/build.config | ||
docker-login: true | ||
username: "orgname+circleci" | ||
registry: "quay.io" | ||
password-variable: quay_token | ||
context: org-global | ||
filters: | ||
branches: | ||
only: master |
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,47 @@ | ||
jobs: | ||
docker_build_and_push: | ||
parameters: | ||
config_file: | ||
description: "The location of the rok8s-scripts config file." | ||
type: string | ||
default: deploy/build.config | ||
docker-login: | ||
type: boolean | ||
default: true | ||
description: When true(default), perform a docker login before build and push. | ||
registry: | ||
type: string | ||
description: The name of the docker registry. Only used if docker-login is true. | ||
default: "quay.io" | ||
username: | ||
type: string | ||
description: The username to use for the registry. Only used if docker-login is true. | ||
default: "" | ||
password-variable: | ||
type: string | ||
description: The environment variable name containing the password. Only used if docker-login is true. | ||
default: "" | ||
executor: ci-images | ||
steps: | ||
- checkout | ||
- setup_remote_docker | ||
- set_env | ||
- when: | ||
condition: << parameters.docker-login >> | ||
steps: | ||
- docker_login: | ||
username: <<parameters.username>> | ||
password-variable: <<parameters.password-variable>> | ||
registry: <<parameters.registry>> | ||
- docker_build: | ||
config: <<parameters.config_file>> | ||
- docker_push: | ||
config: <<parameters.config_file>> | ||
executors: | ||
ci-images: | ||
parameters: | ||
version: | ||
type: string | ||
default: "v9.0-stretch" | ||
docker: | ||
- image: quay.io/reactiveops/ci-images:<<parameters.version>> |