Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit 2aeb2c3

Browse files
authored
Reorganize docker /Users/rfay/workspace/build-tools and try appveyor for Docker-for-Windows testing (#61)
* Add appveyor config for Windows testing * Reorganize/simplify build for Docker-ee compatibility (used in appveyor)
1 parent 5ae1c52 commit 2aeb2c3

File tree

14 files changed

+111
-146
lines changed

14 files changed

+111
-146
lines changed

.appveyor.yml

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,29 @@
22
# Linux docker containers extensively, and appveyor is unable to use them.
33
# So even building (not to mention testing) isn't possible.
44
version: "{build}"
5-
image: Visual Studio 2017
5+
image: Windows Server 2019
66

7-
# Source Config
8-
clone_folder: c:\gopath\src\github.com\drud\build-tools
9-
10-
# Build host
11-
12-
environment:
13-
GOPATH: c:\gopath
14-
GOVERSION: 1.8.3
15-
BASH: "C:/Program Files/git/bin/bash"
16-
17-
init:
18-
- git config --global core.autocrlf input
19-
20-
# Build
217

228
install:
23-
- ps: Stop-Service docker
24-
- ps: Remove-Item -Force -Recurse $env:ProgramFiles\docker
25-
- ps: Invoke-WebRequest -Uri "https://download.docker.com/win/static/test/x86_64/docker-17.06.0-ce.zip" -OutFile "docker.zip"
26-
- ps: Expand-Archive -Path "docker.zip" -DestinationPath $env:ProgramFiles -Force
27-
- ps: Remove-Item docker.zip
28-
- ps: Start-Service docker
29-
- ps: Invoke-WebRequest "https://github.com/docker/compose/releases/download/1.14.0/docker-compose-Windows-x86_64.exe" -UseBasicParsing -OutFile $Env:ProgramFiles\docker\docker-compose.exe
30-
- docker run -it -v C:/gopath:/junk busybox ls
31-
32-
- docker version
33-
- docker-compose version
34-
# Install the specific Go version.
35-
- rmdir c:\go /s /q
36-
- curl -fsS -o golang.msi https://storage.googleapis.com/golang/go%GOVERSION%.windows-amd64.msi
37-
- msiexec /i golang.msi /q
38-
- go version
39-
- choco install -y git make
40-
- make --version
9+
- cinst make golang git
10+
- refreshenv
11+
- git config --global core.autocrlf false
4112

4213
build_script:
43-
- cd tests
44-
- '"%BASH%" -c "make windows"'
45-
14+
# - docker run --rm -t busybox ls /etc
15+
# - docker run -t -v "C:\:/junk" busybox ls
16+
# - docker run -t -v %cd%:/tmp/junk busybox ls /tmp/junk
17+
# - docker run -t -v "%cd%:/tmp/junk" busybox ls /tmp/junk
18+
# - ps: docker run --rm -it -v ${PWD}:/tmp/junk busybox ls /tmp/junk
19+
# - where bash
20+
# - bash --version
21+
# - where make
22+
# - make --version
23+
# - go version
24+
- docker version && docker-compose version
25+
- cmd: where docker
26+
- cmd: .autotests/test.cmd
27+
28+
29+
test: off
4630
deploy: false
47-
48-
test_script:
49-
- cd tests
50-
- '"%BASH%" -c "make test"'
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ set -o nounset
99

1010

1111
# Check that required commands are available.
12-
for command in mysql git go make; do
12+
for command in git go make; do
1313
command -v $command >/dev/null || ( echo "Did not find command installed '$command'" && exit 2 )
1414
done
15-
docker run -t busybox ls
15+
docker run -t busybox ls >/dev/null
1616

1717
if [ "$(go env GOOS)" = "windows" -a "$(git config core.autocrlf)" != "false" ] ; then
1818
echo "git config core.autocrlf is not set to false on windows"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@echo "Building using bash and build.sh"
2-
"C:\Program Files\git\bin\bash" .buildkite/test.sh
1+
@echo "Building using bash and build.sh PWD=%cd%"
2+
"C:\Program Files\git\bin\bash" .autotests/test.sh
33

44
if %ERRORLEVEL% EQU 0 (
55
@echo Successful build

.autotests/test.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
# build drud/build-tools for automated testing (buildkite/appveyor/circleci)
4+
5+
set -o errexit
6+
set -o pipefail
7+
set -o nounset
8+
#set -x
9+
10+
# Make sure that everything remains readable. Go module cache is always getting
11+
# set to read-only, meanning it can't be cleaned up.
12+
function cleanup {
13+
chmod -R u+w . || true
14+
}
15+
trap cleanup EXIT
16+
17+
BUILD_OS=$(go env GOOS)
18+
echo "--- building at $(date) on $HOSTNAME for OS=$(go env GOOS) in $PWD"
19+
20+
# Our testbot should now be sane, run the testbot checker to make sure.
21+
echo "--- Checking for sane testbot"
22+
./.autotests/sanetestbot.sh
23+
24+
echo "--- make $BUILD_OS"
25+
cd tests
26+
rm -f windows darwin linux && time make
27+
echo "--- make test"
28+
time make test
29+
RV=$?
30+
echo "--- build.sh completed with status=$RV"
31+
exit $RV

.buildkite/macosdockerformac.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- command: ".buildkite/test.sh"
1+
- command: ".autotests/test.sh"
22
agents:
33
- "os=macos"
44
- "dockertype=dockerformac"

.buildkite/test.sh

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

.buildkite/windows10dockerforwindows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- command: ".buildkite/test.cmd"
1+
- command: ".autotests/test.cmd"
22
agents:
33
- "os=windows"
44
- "dockertype=dockerforwindows"

.buildkite/windows10dockertoolbox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- command: ".buildkite/test.cmd"
1+
- command: ".autotests/test.cmd"
22
agents:
33
- "os=windows"
44
- "dockertype=toolbox"

.circleci/config.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ stages:
44
machine:
55
image: circleci/classic:201711-01
66

7-
environment:
8-
GOPATH: /home/circleci/go
9-
107
steps:
118
- run: sudo rm -rf /usr/local/go &&
12-
wget -q -O /tmp/golang.tgz https://dl.google.com/go/go1.11.4.linux-amd64.tar.gz &&
9+
wget -q -O /tmp/golang.tgz https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz &&
1310
sudo tar -C /usr/local -xzf /tmp/golang.tgz
1411

1512
- checkout
1613

17-
- run: cd tests && make test
14+
- run: .autotests/test.sh
1815

build_update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ tar -xf $local_file
4040
rm -rf build-tools/*
4141
cp -r $internal_name/ build-tools/
4242
rm -rf $internal_name/
43-
rm -rf build-tools/{tests,circle.yml,.circleci,.github,.appveyor.yml,.buildkite}
43+
rm -rf build-tools/{tests,circle.yml,.circleci,.github,.appveyor.yml,.buildkite,.autotests}
4444
touch build-tools/build-tools-VERSION-$tag.txt
4545
git add build-tools
4646
echo "Updated build-tools to $tag

0 commit comments

Comments
 (0)