-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from ibuildthecloud/scripts
Scripts
- Loading branch information
Showing
554 changed files
with
57,490 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
./bin | ||
./.dapper | ||
./dist | ||
./.trash-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
image: golang:1.4.2 | ||
script: | ||
- ./scripts/ci | ||
--- | ||
pipeline: | ||
build: | ||
privileged: true | ||
image: rancher/dapper:1.11.2 | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
commands: | ||
- dapper ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
.DS_Store | ||
external-lb | ||
/.dapper | ||
/bin | ||
/dist | ||
*.swp | ||
/.trash-cache |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM ubuntu:16.04 | ||
# FROM arm=armhf/ubuntu:16.04 | ||
|
||
ARG DAPPER_HOST_ARCH | ||
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y gcc ca-certificates git wget curl vim less file && \ | ||
rm -f /bin/sh && ln -s /bin/bash /bin/sh | ||
|
||
ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH=GOLANG_ARCH_${ARCH} \ | ||
GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash | ||
|
||
RUN wget -O - https://storage.googleapis.com/golang/go1.6.2.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local && \ | ||
go get github.com/rancher/trash && go get github.com/golang/lint/golint | ||
|
||
ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \ | ||
DOCKER_URL_arm=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm \ | ||
DOCKER_URL=DOCKER_URL_${ARCH} | ||
|
||
RUN wget -O - ${!DOCKER_URL} > /usr/bin/docker && chmod +x /usr/bin/docker | ||
|
||
ENV DAPPER_SOURCE /go/src/github.com/rancher/external-lb/ | ||
ENV DAPPER_OUTPUT ./bin ./dist | ||
ENV DAPPER_DOCKER_SOCKET true | ||
ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache | ||
ENV HOME ${DAPPER_SOURCE} | ||
WORKDIR ${DAPPER_SOURCE} | ||
|
||
ENTRYPOINT ["./scripts/entry"] | ||
CMD ["ci"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
TARGETS := $(shell ls scripts) | ||
|
||
.dapper: | ||
@echo Downloading dapper | ||
@curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp | ||
@@chmod +x .dapper.tmp | ||
@./.dapper.tmp -v | ||
@mv .dapper.tmp .dapper | ||
|
||
$(TARGETS): .dapper | ||
./.dapper $@ | ||
|
||
trash: .dapper | ||
./.dapper -m bind trash | ||
|
||
trash-keep: .dapper | ||
./.dapper -m bind trash -k | ||
|
||
deps: trash | ||
|
||
.DEFAULT_GOAL := ci | ||
|
||
.PHONY: $(TARGETS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM ubuntu:16.04 | ||
COPY external-lb /usr/bin/ | ||
CMD ["external-lb"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,10 @@ | ||
#!/bin/bash -e | ||
#!/bin/bash | ||
set -e | ||
|
||
cd $(dirname $0)/.. | ||
|
||
if [ -f ./build/bootstrap.envs ];then | ||
. ./build/bootstrap.envs | ||
fi | ||
|
||
. ./scripts/common_functions | ||
|
||
set_project_vars | ||
source $(dirname $0)/version | ||
|
||
if [ -L ${PACKAGE} ]; then | ||
rm ${PACKAGE} | ||
fi | ||
|
||
if [ ! -e ${PACKAGE} ]; then | ||
mkdir -p $(dirname $PACKAGE) | ||
ln -s $(pwd) $PACKAGE | ||
fi | ||
|
||
echo export GOPATH=$GOPATH | ||
cd $(dirname $0)/.. | ||
|
||
CGO_ENABLED=0 go build -o bin/${PROJECT} | ||
mkdir -p bin | ||
[ "$(uname)" != "Darwin" ] && LINKFLAGS="-linkmode external -extldflags -static -s" | ||
go build -ldflags "-X main.VERSION=$VERSION $LINKFLAGS" -o bin/external-lb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cd $(dirname $0)/.. | ||
cd $(dirname $0) | ||
|
||
./scripts/clean | ||
./scripts/bootstrap | ||
./scripts/build | ||
./scripts/test | ||
./scripts/package | ||
./build | ||
./test | ||
./validate | ||
./package |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
mkdir -p bin dist | ||
if [ -e ./scripts/$1 ]; then | ||
./scripts/"$@" | ||
else | ||
exec "$@" | ||
fi | ||
|
||
chown -R $DAPPER_UID:$DAPPER_GID . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
cd $(dirname $0)/.. | ||
source $(dirname $0)/version | ||
|
||
CONTENT=$(</proc/sys/kernel/random/uuid) | ||
ARCH=${ARCH:?"ARCH not set"} | ||
SUFFIX="" | ||
[ "${ARCH}" != "amd64" ] && SUFFIX="_${ARCH}" | ||
|
||
rm -rf dist/artifacts | ||
cd $(dirname $0)/../package | ||
|
||
mkdir -p build/${CONTENT} | ||
mkdir -p dist/artifacts | ||
TAG=${TAG:-${VERSION}${SUFFIX}} | ||
REPO=${REPO:-rancher} | ||
|
||
cp -rf apply.sh bin content build/${CONTENT} | ||
cp ../bin/external-lb . | ||
docker build -t ${REPO}/external-lb:${TAG} . | ||
|
||
cd build | ||
|
||
sha1sum -b $(find ${CONTENT} -type f) > ${CONTENT}/SHA1SUMS | ||
sha1sum ${CONTENT}/SHA1SUMS > ${CONTENT}/SHA1SUMSSUM | ||
|
||
tar czf ../dist/artifacts/external-lb.tar.gz ${CONTENT} | ||
echo Created dist/artifacts/external-lb.tar.gz | ||
echo Built ${REPO}/external-lb:${TAG} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
exec $(dirname $0)/ci |
Oops, something went wrong.