-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.yml
40 lines (40 loc) · 1.25 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
version: 2
jobs:
build-custom-docker-image:
docker:
- image: docker:git
environment:
IMAGE_REPO_HOST: quay.io
IMAGE_REPO_NAME: nobuoka/circleci-custom-image-example
IMAGE_TAG: md5-9154db4aa3155e4ec306dd33165a36b2
steps:
- checkout
# To enable `docker` command and `docker-compose` command on Docker Executor
# https://circleci.com/docs/2.0/building-docker-images/
- setup_remote_docker
- run:
name: Build and push custom Docker image if not exist on Quay Repository
command: |
set -x
sh +x -c 'echo $QUAY_TOKEN' | docker login -u=$QUAY_USERNAME --password-stdin quay.io
apk update && apk add curl
./custom-docker-image/build-and-push-if-not-exist.sh
run-on-custom-docker-image:
docker:
- image: quay.io/nobuoka/circleci-custom-image-example:md5-9154db4aa3155e4ec306dd33165a36b2
steps:
- checkout
- run:
name: Run shell script
command: |
set -x
/example/hello.sh
workflows:
version: 2
build-and-run:
jobs:
- build-custom-docker-image:
context: org-global
- run-on-custom-docker-image:
requires:
- build-custom-docker-image