Skip to content

Commit

Permalink
Merge pull request #249 from mozilla-iam/fix_ci
Browse files Browse the repository at this point in the history
Fix ci - and attempt to deploy dev
  • Loading branch information
andrewkrug authored Apr 4, 2019
2 parents 1eaae05 + 77910be commit 2b3e547
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: python
python:
- 3.6
script:
- python -m unittest discover tests
- make test
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
S3_BUCKET := ${S3_BUCKET}

.PHONY: test
test:
pip install pyyaml
python -m unittest discover tests

.PHONY: deploy
deploy: test
aws s3 sync . s3://$(S3_BUCKET)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[![Build Status](https://travis-ci.org/mozilla-iam/sso-dashboard-configuration.svg?branch=master)](https://travis-ci.org/mozilla-iam/sso-dashboard-configuration)

![Codebuild Status](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiUWVHQlJNT2FjckNEcUFtUzI4VVR3ZlBTYjRCYnl4SWhWcUx0TTFEMUMzWmFMM3N2eGdLOFJMTUl6NkNtQTFkRVdXa2RzSEQ5SGYvZWRZMW01Q2cvcXhRPSIsIml2UGFyYW1ldGVyU3BlYyI6IjZjWmVyRWdkRDFFVTllRksiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master)

# How it works...

`apps.yml` is used both for first stage access control and SSO Dashboard visibility settings.
Expand Down
2 changes: 1 addition & 1 deletion buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ phases:
- echo Nothing to do in the pre_build phase...
build:
commands:
- aws s3 sync . s3://$S3_BUCKET
- ./deploy.sh
post_build:
commands:
- echo Build completed on `date`
17 changes: 17 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

echo "Begin deploy of the apps.yml file."
echo "$CODEBUILD_WEBHOOK_TRIGGER"

if [[ "branch/master" == "$CODEBUILD_WEBHOOK_TRIGGER" ]]
then
echo "Deploying to the development CDN cdn.sso.allizom.org"
make deploy S3_BUCKET=sso-dashboard.configuration
elif [[ "$CODEBUILD_WEBHOOK_TRIGGER" =~ ^tag\/[0-9]\.[0-9]\.[0-9](\-(prod))?$ ]]
then
echo "Deploying to the production CDN cdn.sso.mozilla.com"
make deploy S3_BUCKET=sso-dashboard.configuration-prod
fi

echo "$CODEBUILD_WEBHOOK_TRIGGER"
echo "End deploy of the apps.yml."

0 comments on commit 2b3e547

Please sign in to comment.