forked from segmentio/aws-okta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
50 lines (47 loc) · 1.74 KB
/
circle.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
41
42
43
44
45
46
47
48
49
50
machine:
pre:
- curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0
services:
- docker
environment:
ECR_ENABLED: TRUE
dependencies:
pre:
- docker login -e ${DOCKER_EMAIL} -u ${DOCKER_USER} -p ${DOCKER_PASS}
- pip install awscli
- $(aws ecr get-login --region $AWS_REGION)
override:
- docker pull $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/golang-private:latest
test:
override:
- >
docker run
$(env | grep -E '^CIRCLE_|^DOCKER_|^AWS_|^GH_|^NPM_|^PRODUCTION_|^STAGE_|^CIRCLECI=|^CI=' | sed 's/^/--env /g' | tr "\\n" " ")
--rm
--tty
--interactive
--name go
--net host
--volume /var/run/docker.sock:/run/docker.sock
--volume ${GOPATH%%:*}/src:/go/src
--volume ${PWD}:/go/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
--workdir /go/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/golang-private:latest
deployment:
release:
tag: /v[0-9]+(\.[0-9]+)*/
commands:
- >
docker run
$(env | grep -E '^CIRCLE_|^DOCKER_|^AWS_|^GH_|^NPM_|^PRODUCTION_|^STAGE_|^CIRCLECI=|^CI=' | sed 's/^/--env /g' | tr "\\n" " ")
--rm
--tty
--interactive
--name release
--net host
--volume /var/run/docker.sock:/run/docker.sock
--volume ${GOPATH%%:*}/src:/go/src
--volume ${PWD}:/go/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
--workdir /go/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
--entrypoint make
$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/golang-private:latest release