Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pshirshov committed Oct 29, 2024
1 parent 7926efa commit 60048ad
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ jobs:
# files: cobertura.xml,scoverage.xml
# flags: unittests
- name: Upload dependency graph
uses: scalacenter/sbt-dependency-submission@ab086b50c947c9774b70f39fc7f6e20ca2706c91
if: github.ref == 'develop'
uses: scalacenter/sbt-dependency-submission@v2

build-js:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .keep.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SONATYPE_SECRET
SCALA_VERSION
JAVA_VERSION
48 changes: 23 additions & 25 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
#!/usr/bin/env bash

set -e

self="$(realpath "$0")"
path="$(dirname "$self")"

(for e in "$@"; do [[ "$e" == "nix" ]] && exit 0; done) && NIXIFY=1 || NIXIFY=0

if [[ "$NIXIFY" == 1 && -z "${IN_NIX_SHELL+x}" ]]; then
echo "Restarting in Nix..."
set -x
nix flake lock
nix flake metadata
exec nix develop \
--ignore-environment \
--keep SONATYPE_SECRET \
--keep SCALA_VERSION \
--keep JAVA_VERSION \
--keep CI_BRANCH \
--keep CI_COMMIT \
--keep CI_BRANCH_TAG \
--keep CI_PULL_REQUEST \
--keep CI_BUILD_UNIQ_SUFFIX \
--keep CI \
--keep HOME \
--command bash "$self" "$@"
fi

set -x
cd "$path"

function nixify() {
read -r -a args <<< "$(grep -v '^\s*$' .keep.env | sed "s/^/--keep /;s/$/ /" | tr '\n' ' ')"

if [[ -z "${IN_NIX_SHELL+x}" ]]; then
echo "Restarting in Nix..."
set -x
nix flake lock
nix flake metadata
exec nix develop \
--ignore-environment \
--keep HOME \
--keep CI_BRANCH \
--keep CI_COMMIT \
--keep CI_BRANCH_TAG \
--keep CI_PULL_REQUEST \
--keep CI_BUILD_UNIQ_SUFFIX \
--keep CI \
"${args[@]}" \
--command bash "$self" "$@"
fi
}

for i in "$@"
do
case $i in
nix) ;;
nix) shift && nixify "$@" ;;
env) exec bash -norc ;;
*) "./devops/$i.sh" ;;
esac
Expand Down

0 comments on commit 60048ad

Please sign in to comment.