File: pushscript.sh

package info (click to toggle)
ruby-license-finder 7.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,368 kB
  • sloc: ruby: 6,017; sh: 144; python: 31; makefile: 14
file content (31 lines) | stat: -rwxr-xr-x 836 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
echo -e "---\n:rubygems_api_key: $GEM_API_KEY" > ~/.local/share/gem/credentials
chmod 0600 ~/.local/share/gem/credentials

build_version="$(cat semver-version/version)"
cd lf-git
built_gem="pkg/license_finder-$build_version.gem"

git config --global user.email $GIT_EMAIL
git config --global user.name $GIT_USERNAME

git config --global push.default simple

git checkout master

mkdir ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
eval "$(ssh-agent -s)"
echo "$GIT_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-add -k ~/.ssh/id_rsa

if [ -z "$(gem fetch license_finder -v $build_version 2>&1 | grep ERROR)" ]; then
  echo "LicenseFinder-$build_version already exists on Rubygems"
else
  rake release
fi

export EXIT_STATUS=$?
kill $(ps aux | grep ssh-agent | head -n 1 | awk '{print $2}')
exit $EXIT_STATUS