Skip to content

Commit

Permalink
Merge pull request #173 from contiv/master
Browse files Browse the repository at this point in the history
Merge master into release-1.2 branch
  • Loading branch information
tiewei authored Jan 18, 2018
2 parents 0374e5d + 5d0e1a3 commit 43a8a37
Show file tree
Hide file tree
Showing 996 changed files with 240,026 additions and 49 deletions.
6 changes: 2 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.git

# don't import anything from the UI except the /app folder where the
# actual site and compiled assets live.
build/dependencies/contiv-ui
!build/dependencies/contiv-ui/app
ui
!ui/app
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@ local_certs
# state info stored for a local etcd instance
state/default.etcd/

# build dependencies (e.g., UI, etc.)
build/dependencies

# logs
*.log
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM golang:1.7.6 as builder

COPY ./ /go/src/github.com/contiv/auth_proxy

WORKDIR /go/src/github.com/contiv/auth_proxy

RUN VERSION=$(git describe --tags --always) ./scripts/build_in_container.sh

FROM scratch

COPY ./ui/app /ui
COPY --from=builder /go/src/github.com/contiv/auth_proxy/build/output/auth_proxy /auth_proxy

WORKDIR /

ENTRYPOINT ["./auth_proxy"]
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ godep:
run:
docker-compose up -d

# shfmt formats all shell scripts in a standardized way
shfmt:
go get github.com/contiv-experimental/sh/cmd/shfmt || :
find . -type f -name "*.sh" -and -not -path "./vendor/*" -print0 | xargs -0 shfmt -w

# systemtests runs the system tests suite.
systemtests: generate-certificate
@bash ./scripts/systemtests.sh
Expand Down
1 change: 0 additions & 1 deletion build/Dockerfile.checks
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ RUN go get github.com/golang/lint/golint
RUN go get github.com/fzipp/gocyclo
RUN go get github.com/client9/misspell/...
RUN go get github.com/remyoudompheng/go-misc/deadcode/...
RUN go get github.com/contiv-experimental/sh/cmd/shfmt

COPY ./ /go/src/github.com/contiv/auth_proxy

Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile.release
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM scratch

COPY ./build/dependencies/contiv-ui/app /ui
COPY ./ui/app /ui
COPY ./build/output/auth_proxy /auth_proxy

WORKDIR /
Expand Down
37 changes: 0 additions & 37 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,6 @@ IMAGE_NAME="contiv/auth_proxy"
BUILD_IMAGE_NAME="${IMAGE_NAME}_build"
VERSION=${BUILD_VERSION-$DEV_IMAGE_NAME}

#
# bake in the UI assets
#
UI_DIR="$PWD/build/dependencies/contiv-ui"

mkdir -p $UI_DIR

# make sure we have a local checkout
echo "Checking to see if $UI_DIR/.git exists"

if [ ! -d "$UI_DIR/.git" ]; then
echo "contiv-ui dependency directory does not exist, creating..."
echo "Performing clone of contiv-ui repo into $UI_DIR"
git clone --depth 1 https://github.com/contiv/contiv-ui.git $UI_DIR
fi

pushd $UI_DIR

# this is a fancy way to check if the var is set without tripping the unbound variable check
if [ ! -z "${BUILD_VERSION-}" ]; then
echo "BUILD_VERSION is set ($BUILD_VERSION), checking it out as a tag..."

git checkout master # make sure we have the latest master + all tags
git pull --ff-only # no merge commits, please
git fetch --tags # shallow clones do not include tags, so doublecheck
git checkout $BUILD_VERSION # BUILD_VERSION is expected to be a valid tag
else
echo "No BUILD_VERSION set, skipping checkout/update of contiv-ui repo"
echo "Whatever version is currently checked out in $UI_DIR directory will be baked in"
echo "Current version: $(git rev-parse HEAD)"
fi

#
# build the final image
#
popd

# create a local build image
docker build -t $BUILD_IMAGE_NAME -f ./build/Dockerfile.build .

Expand Down
3 changes: 0 additions & 3 deletions scripts/checks_in_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ set -e

export PATH="/go/bin:$PATH"

echo "Formatting all shell scripts..."
find . -type f -name "*.sh" -and -not -path "./vendor/*" -and -not -path "./build/dependencies/*" -print0 | xargs -0 shfmt -w

dirs=$(go list ./... | sed -e 's!github.com/contiv/auth_proxy!.!g' | grep -v ./vendor)
files=$(find . -type f -name '*.go' | grep -v ./vendor)

Expand Down
3 changes: 3 additions & 0 deletions ui/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
3 changes: 3 additions & 0 deletions ui/.bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "app/bower_components"
}
14 changes: 14 additions & 0 deletions ui/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
app/*.js
app/*.ts
app/*/*.js
app/*/*.ts
app/bower_components/**
app/*/*/*.js
app/*/*/*.ts
app/*/*/*/*.js
app/*/*/*/*.ts
!app/bower_components/semantic-ui/dist/**
!app/bower_components/jquery/dist/**
!app/main.bundle.js
!app/vendor.bundle.js
!app/polyfills.bundle.js
6 changes: 6 additions & 0 deletions ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
app/bower_components/jquery
.idea
app/**/*.map
app/**/*.js
**/.DS_Store
13 changes: 13 additions & 0 deletions ui/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"globalstrict": true,
"globals": {
"angular": false,
"describe": false,
"it": false,
"expect": false,
"beforeEach": false,
"afterEach": false,
"module": false,
"inject": false
}
}
14 changes: 14 additions & 0 deletions ui/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: node_js
node_js:
- "0.10"

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- npm start > /dev/null &
- npm run update-webdriver
- sleep 1 # give server time to start

script:
- node_modules/.bin/karma start karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=Firefox
- node_modules/.bin/protractor e2e-tests/protractor.conf.js --browser=firefox
Loading

0 comments on commit 43a8a37

Please sign in to comment.