Skip to content

Commit 87ae18e

Browse files
authored
Bulldozer 1.0 Github App rewrite (#50)
Bulldozer 1.0 Github App rewrite
1 parent 75f60bc commit 87ae18e

1,521 files changed

Lines changed: 38495 additions & 622195 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 67 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -1,166 +1,88 @@
1-
darwin-linux-no-cgo: &darwin-linux-no-cgo
2-
working_directory: /go/src/github.com/palantir/bulldozer
3-
docker:
4-
- image: nmiyake/go:go-darwin-linux-no-cgo-1.9-t112
5-
environment:
6-
CGO_ENABLED: 0
7-
8-
define-artifact-dir: &define-artifacts-dir
9-
run: echo "export ARTIFACT_STORE=/tmp/artifacts/${CIRCLE_PROJECT_REPONAME}-${TAG_NAME}-tests" >> $BASH_ENV
10-
11-
mkdir-artifacts-dir: &mkdir-artifacts-dir
12-
run: mkdir -p "${ARTIFACT_STORE}"
13-
14-
store-test-results: &store-test-results
15-
type: test-results-store
16-
path: /tmp/artifacts
17-
18-
store-artifacts: &store-artifacts
19-
type: artifacts-store
20-
path: /tmp/artifacts
21-
22-
make-client: &make-client
23-
run: ./scripts/make_client.sh
24-
25-
install-docker-client: &install-docker-client
26-
run:
27-
name: Install docker client
28-
command: |
29-
set -x
30-
VER="17.05.0-ce"
31-
curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz
32-
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
33-
mv /tmp/docker/* /usr/bin
34-
35-
build-docker-image: &build-docker-image
36-
run:
37-
name: Build docker image
38-
command: |
39-
set -x
40-
version=$(./godelw project-version)
41-
cp /etc/ssl/certs/ca-certificates.crt .
42-
docker build \
43-
-t palantirtechnologies/bulldozer \
44-
--build-arg VERSION=${version} \
45-
-f Dockerfile \
46-
.
47-
rm -f ca-certificates.crt
48-
49-
install-git: &install-git
50-
run:
51-
name: Install git
52-
command: apt-get install -y git
53-
54-
install-yarn: &install-yarn
55-
run:
56-
name: Install yarn
57-
command: |
58-
curl -sL https://deb.nodesource.com/setup_6.x | bash -
59-
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
60-
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
61-
apt-get -y update
62-
apt-get -y install nodejs yarn
1+
common:
2+
godel-cache:
3+
key: &godel-cache-key v1-godel-cache-{{ checksum "godelw" }}-{{ checksum "godel/config/godel.yml" }}
4+
<<: &restore-godel-cache
5+
restore_cache:
6+
keys:
7+
- *godel-cache-key
8+
<<: &save-godel-cache
9+
save_cache:
10+
key: *godel-cache-key
11+
paths:
12+
- ~/.godel
13+
14+
test-results:
15+
dir: &results-dir /tmp/test-results
16+
<<: &store-results
17+
store_test_results:
18+
path: *results-dir
19+
<<: &store-artifacts
20+
store_artifacts:
21+
path: *results-dir
22+
destination: test-results
23+
24+
### Jobs ###
6325

6426
version: 2
6527
jobs:
6628
build:
67-
<<: *darwin-linux-no-cgo
29+
working_directory: /go/src/github.com/palantir/bulldozer
30+
environment:
31+
TESTS_DIR: *results-dir
32+
docker:
33+
- image: nmiyake/go:go-darwin-linux-1.11-t134
6834
steps:
69-
- *define-artifacts-dir
70-
- *mkdir-artifacts-dir
7135
- checkout
72-
- *install-yarn
73-
74-
- restore_cache:
75-
keys:
76-
- v1-dependencies-{{ checksum "./client/package.json" }}
77-
- v1-dependencies-
78-
79-
- run: go version
36+
- *restore-godel-cache
8037
- run: ./godelw version
81-
- run: ./godelw verify --apply=false --junit-output="${ARTIFACT_STORE}/tests.xml"
82-
83-
- setup_remote_docker
84-
- *install-docker-client
85-
86-
- run: ./godelw dist
87-
- *make-client
88-
- *build-docker-image
89-
90-
- save_cache:
91-
paths:
92-
- ./client/node_modules
93-
key: v1-dependencies-{{ checksum "./client/package.json" }}
38+
- *save-godel-cache
39+
- run: mkdir -p "${TESTS_DIR}"
40+
- run: ./godelw build
41+
- run: ./godelw verify --apply=false --junit-output="$TESTS_DIR/$CIRCLE_PROJECT_REPONAME-tests.xml"
42+
- *store-results
43+
- *store-artifacts
9444
- persist_to_workspace:
95-
root: /go/src/github.com/palantir/bulldozer
45+
root: .
9646
paths:
97-
- client/build
98-
- *store-test-results
99-
100-
changelog:
101-
<<: *darwin-linux-no-cgo
102-
steps:
103-
- checkout
104-
- *install-git
105-
- *define-artifacts-dir
106-
- *mkdir-artifacts-dir
107-
- run: git log `git describe --tags --abbrev=0`..HEAD --pretty="### %s%n%b%n" > /tmp/artifacts/changelog.md
108-
- *store-artifacts
47+
- build/bulldozer
10948

110-
publish-snapshot:
111-
<<: *darwin-linux-no-cgo
49+
dist:
50+
working_directory: /go/src/github.com/palantir/bulldozer
51+
docker:
52+
- image: nmiyake/go:go-darwin-linux-1.11-docker-17.06.0-ce-bsdtar-unzip-t134
11253
steps:
11354
- checkout
11455
- setup_remote_docker
115-
- *install-docker-client
11656
- attach_workspace:
117-
at: /go/src/github.com/palantir/bulldozer
118-
- run: ./godelw dist
119-
- *build-docker-image
120-
- run: ./scripts/publish_docker.sh
121-
122-
publish-release:
123-
<<: *darwin-linux-no-cgo
124-
steps:
125-
- checkout
126-
- setup_remote_docker
127-
- *install-docker-client
128-
- run: ./godelw publish bintray --url https://api.bintray.com --subject palantir --repository releases --user "$BINTRAY_USERNAME" --password "$BINTRAY_PASSWORD" --publish --downloads-list bulldozer
129-
- run: sha256sum dist/*.tgz
130-
- attach_workspace:
131-
at: /go/src/github.com/palantir/bulldozer
132-
- *build-docker-image
133-
- run: ./scripts/publish_docker.sh
57+
at: .
58+
- *restore-godel-cache
59+
- run: ./godelw docker build --verbose
60+
- deploy:
61+
name: Publish
62+
command: |
63+
if [[ "${CIRCLE_BRANCH}" == "develop" ]]; then
64+
docker login -u "${DOCKERHUB_USERNAME}" -p "${DOCKERHUB_PASSWORD}"
65+
./godelw docker push --tags=snapshot
66+
fi
67+
if [[ -n "${CIRCLE_TAG}" ]] ; then
68+
docker login -u "${DOCKERHUB_USERNAME}" -p "${DOCKERHUB_PASSWORD}"
69+
./godelw docker push --tags=latest,version
70+
./godelw publish bintray \
71+
--url https://api.bintray.com \
72+
--subject palantir --repository releases --product bulldozer \
73+
--username "${BINTRAY_USERNAME}" --password "${BINTRAY_PASSWORD}" \
74+
--downloads-list --publish bulldozer
75+
fi
76+
77+
### Workflows ###
13478

13579
workflows:
13680
version: 2
137-
build-publish:
81+
build:
13882
jobs:
13983
- build:
140-
filters:
141-
tags:
142-
only: /.*/
143-
- changelog:
144-
requires:
145-
- build
146-
filters:
147-
tags:
148-
ignore: /.*/
149-
branches:
150-
only: /^master$/
151-
- publish-snapshot:
152-
requires:
153-
- build
154-
filters:
155-
tags:
156-
ignore: /.*/
157-
branches:
158-
only: /^master$/
159-
- publish-release:
84+
filters: { tags: { only: /.*/ } }
85+
- dist:
86+
filters: { tags: { only: /.*/ } }
16087
requires:
16188
- build
162-
filters:
163-
tags:
164-
only: /^[0-9]+(\.[0-9]+)+(-rc[0-9]+)?(-alpha[0-9]+)?$/
165-
branches:
166-
ignore: /.*/

.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

.gitignore

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,2 @@
1-
*.iml
2-
*.ipr
3-
*.iws
41
.idea/
5-
/build/
6-
coverage.out
7-
dist/
8-
gotest.out
9-
.DS_Store
10-
config/bulldozer.yml
11-
client/build
12-
client/node_modules
2+
build/

Dockerfile

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)