-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9a1275
commit 90e7847
Showing
9 changed files
with
138 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -x | ||
set -euvo pipefail | ||
IFS=$'\n\t' | ||
|
||
CURL_URL="https://registry.hub.docker.com/u/rocketchat/rocket.chat/trigger/$PUSHTOKEN/" | ||
|
||
if [[ $CIRCLE_TAG ]] | ||
then | ||
CURL_DATA='{"source_type":"Tag","source_name":"'"$CIRCLE_TAG"'"}'; | ||
else | ||
CURL_DATA='{"source_type":"Branch","source_name":"'"$CIRCLE_BRANCH"'"}'; | ||
fi | ||
|
||
curl -H "Content-Type: application/json" --data "$CURL_DATA" -X POST "$CURL_URL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -x | ||
set -euvo pipefail | ||
IFS=$'\n\t' | ||
|
||
FILENAME="$ROCKET_DEPLOY_DIR/rocket.chat-$ARTIFACT_NAME.tgz"; | ||
|
||
ln -s /tmp/build/Rocket.Chat.tar.gz "$FILENAME" | ||
gpg --armor --detach-sign "$FILENAME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
if [[ $CIRCLE_TAG ]] | ||
then | ||
export ARTIFACT_NAME="$(meteor npm run version --silent)" | ||
else | ||
export ARTIFACT_NAME="$(meteor npm run version --silent).$CIRCLE_BUILD_NUM" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export ROCKET_DEPLOY_DIR="/tmp/deploy" | ||
mkdir -p $ROCKET_DEPLOY_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -x | ||
set -euvo pipefail | ||
IFS=$'\n\t' | ||
|
||
cp .circleci/sign.key.gpg /tmp | ||
gpg --yes --batch --passphrase=$mypass /tmp/sign.key.gpg | ||
gpg --allow-secret-key-import --import /tmp/sign.key | ||
rm /tmp/sign.key |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
set -euvo pipefail | ||
IFS=$'\n\t' | ||
|
||
# Add launchpad to known hosts | ||
ssh-keyscan -t rsa -H git.launchpad.net > ~/.ssh/known_hosts | ||
|
||
git config user.name "CI Bot" | ||
git config user.email "[email protected]" | ||
|
||
# Determine the channel to push snap to. | ||
if [[ $CIRCLE_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+ ]]; then | ||
CHANNEL=candidate | ||
RC_VERSION=$CIRCLE_TAG | ||
elif [[ $CIRCLE_TAG ]]; then | ||
CHANNEL=stable | ||
RC_VERSION=$CIRCLE_TAG | ||
else | ||
CHANNEL=edge | ||
RC_VERSION=0.59.0-develop | ||
fi | ||
|
||
echo "Preparing to trigger a snap release for $CHANNEL channel" | ||
|
||
cd $PWD/.snapcraft | ||
|
||
# Decrypt key | ||
openssl aes-256-cbc -K $encrypted_f5c8ae370556_key -iv $encrypted_f5c8ae370556_iv -in launchpadkey.enc -out launchpadkey -d | ||
|
||
# Change permissions | ||
chmod 0600 launchpadkey | ||
|
||
# We need some meta data so it'll actually commit. This could be useful to have for debugging later. | ||
echo "Tag: $CIRCLE_TAG \r\nBranch: $CIRCLE_BRANCH\r\nBuild: $CIRCLE_BUILD_NUM\r\nCommit: $CIRCLE_SHA1" > buildinfo | ||
|
||
# Clone launchpad repo for the channel down. | ||
GIT_SSH_COMMAND="ssh -i launchpadkey" git clone -b $CHANNEL git+ssh://[email protected]/rocket.chat launchpad | ||
|
||
# Rarely will change, but just incase we copy it all | ||
cp -r resources buildinfo launchpad/ | ||
sed s/#{RC_VERSION}/$RC_VERSION/ snapcraft.yaml > launchpad/snapcraft.yaml | ||
|
||
cd launchpad | ||
git add resources snapcraft.yaml buildinfo | ||
|
||
# Another place where basic meta data will live for at a glance info | ||
git commit -m "CircleCI Build: $CIRCLE_BUILD_NUM CircleCI Commit: $CIRCLE_SHA1" | ||
|
||
# Push up up to the branch of choice. | ||
GIT_SSH_COMMAND="ssh -i ../launchpadkey" git push origin $CHANNEL | ||
|
||
# Clean up | ||
cd .. | ||
rm -rf launchpadkey launchpad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
set -x | ||
set -euvo pipefail | ||
IFS=$'\n\t' | ||
|
||
CURL_URL="https://rocket.chat/releases/update" | ||
|
||
curl -X POST "$CURL_URL" |