Skip to content

Commit

Permalink
add aur release in pipeline (#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
iikirilov committed Sep 24, 2019
1 parent 8d05f3d commit a2baa76
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ release-homebrew:
GIT_STRATEGY: none
script:
- ./scripts/update-homebrew.sh
only:
refs:
- /^release\/(\d*).(\d*).(\d*)/
-
release-aur:
stage: downstream
variables:
GIT_STRATEGY: none
script:
- ./scripts/update-aur.sh
only:
refs:
- /^release\/(\d*).(\d*).(\d*)/
Expand Down
41 changes: 41 additions & 0 deletions scripts/update-aur.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done

trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
# echo an error message before exiting
trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT

export SCRIPTS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

source "$SCRIPTS_DIR/common.bash"

ensure_version

STATUS_CODE=`curl --silent --connect-timeout 8 --output /dev/null https://github.com/web3j/web3j/releases/download/v${VERSION}/web3j-${VERSION}.zip -I -w "%{http_code}\n"`

echo $STATUS_CODE

if [[ $STATUS_CODE -ne "302" ]]; then
echo "ERROR: Missing release has the version ${VERSION} been released yet?"
exit 1
fi

configure_github_user

echo $AUR_SSH > ~/.ssh/aur.pub
echo $AUR_SSH_PRIV > ~/.ssh/aur

echo "Host aur.archlinux.org
IdentityFile ~/.ssh/aur
User aur" > ~/.ssh/config

git clone ssh://aur@aur.archlinux.org/web3j.git

cd web3j || echo "ERROR: Failed to clone"; exit 1

./update $VERSION

0 comments on commit a2baa76

Please sign in to comment.