forked from ucberkeley/Beehive
-
Notifications
You must be signed in to change notification settings - Fork 3
/
buildspec.yml
32 lines (29 loc) · 1.02 KB
/
buildspec.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
version: 0.2
env:
variables:
IMAGE_NAME: octobeehive/cicd
secrets-manager:
DOCKERRUN: BeehiveDockerrun
SPENCRYPTCERT: BeehiveSpEncryptCert
SPENCRYPTKEY: BeehiveSpEncryptKey
SPSIGNINGCERT: BeehiveSpSigningCert
SPSIGNINGKEY: BeehiveSpSigningKey
phases:
build:
#Build and Push image to OCTO Dockerhub
commands:
- echo $SPENCRYPTCERT > config/shibboleth/sp-encrypt-cert.pem
- echo $SPENCRYPTKEY > config/shibboleth/sp-encrypt-key.pem
- echo $SPSIGNINGCERT > config/shibboleth/sp-signing-cert.pem
- echo $SPSIGNINGKEY > config/shibboleth/sp-signing-key.pem
- docker build -t $IMAGE_NAME:$CODEBUILD_RESOLVED_SOURCE_VERSION .
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASS
- docker push $IMAGE_NAME:$CODEBUILD_RESOLVED_SOURCE_VERSION
post_build:
commands:
- echo $DOCKERRUN
- echo $DOCKERRUN > Dockerrun.aws.json
- sed -i "s/GIT_HASH/$CODEBUILD_RESOLVED_SOURCE_VERSION/g" Dockerrun.aws.json
artifacts:
files:
- Dockerrun.aws.json