Skip to content

Commit

Permalink
concourse -> bass
Browse files Browse the repository at this point in the history
  • Loading branch information
vito committed Dec 29, 2021
1 parent f2f26aa commit cfa5e17
Show file tree
Hide file tree
Showing 12 changed files with 116 additions and 275 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
*.coverprofile
creds.yml
secrets.bass
/node_modules
11 changes: 11 additions & 0 deletions ci/booklit.bass
@@ -0,0 +1,11 @@
(def repo
"https://github.com/vito/booklit")

(def git
(load (.git "alpine/git")))

(defn ls-remote [ref]
(git:ls-remote repo ref))

(defn checkout [sha]
(git:checkout repo sha))
45 changes: 19 additions & 26 deletions ci/build
@@ -1,31 +1,24 @@
#!/bin/bash
#!/usr/bin/env bass

set -e -u
(def [ref version]
(case *args*
[] ["HEAD" "0.0.0-dev"]
[r] [r "0.0.0-dev"]
_ *args*))

export GOPATH=$PWD/gopath
export PATH=$PWD/gopath/bin:$PATH
(def project
(load (*dir*/../project)))

assets=$PWD/assets
(def booklit
(load (*dir*/booklit)))

version="0.0.0-dev"
if [ -d version ]; then
version="$(cat version/version)"
fi
(defn final-inspection [bin]
(from "ubuntu"
($ ls -alh $bin)
($ ldd $bin)
($ $bin --version)))

pushd booklit
for os in linux darwin windows; do
ext=""
if [ "$os" = "windows" ]; then
ext=".exe"
fi

echo "building $os binary..."
GOOS=$os go build \
--ldflags "-X github.com/vito/booklit.Version=${version}" \
-o $assets/booklit_${os}_amd64${ext} \
github.com/vito/booklit/cmd/booklit
done
popd

echo "printing version..."
./assets/booklit_$(go env GOOS)_$(go env GOARCH) --version
(let [src (booklit:checkout ref)
binaries (project:build-all src version)]
(run (final-inspection binaries:linux))
(emit binaries *stdout*))
22 changes: 0 additions & 22 deletions ci/build.yml

This file was deleted.

7 changes: 0 additions & 7 deletions ci/grab-release-notes

This file was deleted.

17 changes: 0 additions & 17 deletions ci/grab-release-notes.yml

This file was deleted.

161 changes: 0 additions & 161 deletions ci/pipeline.yml

This file was deleted.

14 changes: 14 additions & 0 deletions ci/release-info.bass
@@ -0,0 +1,14 @@
#!/usr/bin/env bass

(provide [fetch]
(import (load (*dir*/../project))
*root*)

(def booklit
(load (*dir*/booklit)))

(defn fetch [version]
(let [version-info (booklit:checkout (booklit:ls-remote "version"))
info (subpath version-info (string->dir version))]
{:title (trim (read info/name))
:notes info/notes.md})))
27 changes: 27 additions & 0 deletions ci/shipit
@@ -0,0 +1,27 @@
#!/usr/bin/env bass

(def [sha version] *args*)

(import (load (*dir*/secrets))
*access-token*)

(def release-info
(load (*dir*/release-info)))

(def git
(load (.git "alpine/git")))

(def tabs
(let [repo "https://github.com/vito/tabs"]
(git:checkout repo (git:ls-remote repo "main"))))

(def release
(load (tabs/gh/release "vito/booklit" *access-token*)))

(let [test (run ($ *dir*/test $sha))
binaries (run ($ *dir*/build $sha $version))
assets (values (next binaries))
info (release-info:fetch version)]
(log (release:create! version sha assets
{:title info:title
:notes-file info:notes})))
29 changes: 8 additions & 21 deletions ci/test
@@ -1,25 +1,12 @@
#!/bin/bash
#!/usr/bin/env bass

set -e -u
(def [sha & testflags]
*args*)

export GOPATH=$PWD/gopath
export PATH=$PWD/gopath/bin:$PATH
(def project
(load (*dir*/../project)))

cd booklit
(def booklit
(load (*dir*/booklit)))

echo "installing ginkgo..."
go install github.com/onsi/ginkgo/ginkgo

function emit_coveralls() {
if [ -n "$COVERALLS_TOKEN" ]; then
echo "emitting code coverage..."
go get github.com/mattn/goveralls
goveralls -service concourse \
-coverprofile <(find . -name '*.coverprofile' | xargs cat | grep -v 'booklit.peg.go\|render/bindata.go')
fi
}

trap emit_coveralls EXIT

echo "running tests..."
./scripts/test -p "$@"
(run (project:test (booklit:checkout sha) testflags))
21 changes: 0 additions & 21 deletions ci/test.yml

This file was deleted.

0 comments on commit cfa5e17

Please sign in to comment.