Add CircleCI

This commit is contained in:
Ilya Dmitrichenko
2018-05-16 12:49:13 +01:00
parent a1e5cb77fd
commit 01631a0a43
2 changed files with 51 additions and 10 deletions

35
.circleci/config.yml Normal file
View File

@@ -0,0 +1,35 @@
version: 2
jobs:
build:
docker:
- image: errordeveloper/skaffold:66cc263ef18f107adce245b8fc622a8ea46385f2
steps:
- checkout
- setup_remote_docker: {docker_layer_caching: true}
- run:
name: Run unit tests and build the image with Skaffold
command: skaffold build --profile=test
deploy:
docker:
- image: errordeveloper/skaffold:66cc263ef18f107adce245b8fc622a8ea46385f2
steps:
- checkout
- setup_remote_docker: {docker_layer_caching: true}
- run:
name: Login to the registry
command: echo $REGISTRY_PASSWORD | docker login --username $REGISTRY_USERNAME --password-stdin
- run:
name: Build and push the image to the registry with Skaffold
command: skaffold build --profile=production
workflows:
version: 2
main:
jobs:
- build
- deploy:
requires: [build]
filters:
branches: {only: [master]}

View File

@@ -1,27 +1,33 @@
apiVersion: skaffold/v1alpha2
kind: Config
## Default profile for use with `skaffold dev`
build:
artifacts:
- imageName: podinfo
docker:
dockerfilePath: ./Dockerfile.ci
deploy:
kubectl: { manifests: [ deploy/skaffold/* ] }
kubectl: { manifests: [ deploy/skaffold/dev/* ] }
profiles:
- name: production
- name: test
## This profile runs unit tests and builds the image
build:
local: { skipPush: false }
local: { skipPush: true }
artifacts:
- imageName: podinfo
- imageName: stefanprodan/podinfo
docker:
dockerfilePath: ./Dockerfile.ci
deploy: {} # not needed here as such
deploy: {}
- name: production
## This profile pushes the image
build:
local: { skipPush: false }
artifacts:
- imageName: stefanprodan/podinfo
docker:
dockerfilePath: ./Dockerfile.ci
deploy: {} # no-op, flux will take care of this