-
Notifications
You must be signed in to change notification settings - Fork 2
Tidy up scripts #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: code
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,7 @@ | ||
| # create the tmp git repo | ||
|
|
||
| set -e | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| mkdir -p git | ||
| sudo mount -t tmpfs -o size=512M none git | ||
| cd git | ||
| ln -s ../git-disk/.git | ||
|
|
||
| ln -s ../git-disk/.git . |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| # set this to the absolute path of the root directly you are running the | ||
| # scripts from. | ||
| ROOTDIR=/home/kevina/wordlist/diff/ | ||
| ROOTDIR="${HOME}/wordlist/diff/" | ||
|
|
||
| export DBNAME=scowl | ||
|
|
||
| export PGVER=11 | ||
| export PGBINDIR=/usr/lib/postgresql/11/bin | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not hard code PGVER. It should take the PGVER from the environment and if it's not set to the system default, and if that fails, fall back to 11. The PGBINDIR should then use PGVER to find the correct path.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure what exactly is wanted here, deleting the PGVER line? I simply bumped it to current release since 11 has been EOL for a while.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe something like: I am not set on defaulting to 11. It is just what I use and is known to work. My system is also older and doesn't have the latest version available. If we get this working on CI than I am okay with bumping this to the current version that is support by the CI environment as I will no longer need to run it on my system. |
||
| export PGVER=18 | ||
| export PGBINDIR=/usr/lib/postgresql/18/bin | ||
|
|
||
| export PATH="$PGBINDIR":"$PATH" | ||
|
|
||
|
|
@@ -15,7 +15,8 @@ export PGDIR="$DBROOT"/scowl | |
| export PGHOST="$DBROOT" | ||
| export PGPORT=${PGPORT:-5437} | ||
|
|
||
| alias psql=`which psql` | ||
| alias psql=$(command -v psql) | ||
|
|
||
| pgctl () { | ||
| pg_ctl -D "$PGDIR" -l "$PGDIR"/log "$@" | ||
| pg_ctl -D "$PGDIR" -l "$PGDIR"/log "$@" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| git push diff diff \ | ||
| $( for f in `git tag -l | fgrep diff/`; do echo $f:`basename $f`; done ) | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| git push diff diff $( for f in $(git tag -l | grep -F diff/); do echo $f:$(basename $f); done ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason bash is needed here and
#!/bin/shwon't work? The same applies to the other shell scripts. I have always usedsh <script>and have not run into issues. On my system at least sh alias to dash and not bash.If bash is needed for specific features that's OK. But I rather stick to the standard shell script unless there is a compelling reason not to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar enough with what's pure sh implementation and what's dash/bash when I write shellcode, so I default to bash.
I don't mind switching it to sh, though every system, the CI included, will have bash available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dash is a bit faster than bash, but it’s not something I am set on. I always use
#!/bin/shunless I have a good reason not to.If you want to take a stab at getting the CI integration working, then switching to
bashis fine if that’s what you are more comfortable with. Otherwise, I would prefer to stick withsh, as that’s what I would use.