GitHub CI (#15918)
parent
170d623ca5
commit
5131a3aa11
@ -1,13 +0,0 @@ |
||||
#!/bin/bash |
||||
set -euvo pipefail |
||||
IFS=$'\n\t' |
||||
|
||||
CURL_URL="https://registry.hub.docker.com/u/rocketchat/rocket.chat/trigger/$DOCKER_TRIGGER_TOKEN/" |
||||
|
||||
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" |
@ -0,0 +1,438 @@ |
||||
name: Build and Test |
||||
|
||||
on: |
||||
release: |
||||
types: [published] |
||||
pull_request: |
||||
branches: '**' |
||||
push: |
||||
branches: |
||||
- develop |
||||
|
||||
env: |
||||
CI: true |
||||
MONGO_URL: mongodb://localhost:27017 |
||||
TOOL_NODE_FLAGS: --max_old_space_size=4096 |
||||
|
||||
jobs: |
||||
build: |
||||
runs-on: ubuntu-latest |
||||
|
||||
steps: |
||||
- name: Github Info |
||||
run: | |
||||
echo "GITHUB_ACTION: $GITHUB_ACTION" |
||||
echo "GITHUB_ACTOR: $GITHUB_ACTOR" |
||||
echo "GITHUB_REF: $GITHUB_REF" |
||||
echo "GITHUB_HEAD_REF: $GITHUB_HEAD_REF" |
||||
echo "GITHUB_BASE_REF: $GITHUB_BASE_REF" |
||||
echo "github.event_name: ${{ github.event_name }}" |
||||
cat $GITHUB_EVENT_PATH |
||||
|
||||
- uses: actions/checkout@v1 |
||||
|
||||
- name: Cache node modules |
||||
id: cache-nodemodules |
||||
uses: actions/cache@v1 |
||||
with: |
||||
path: node_modules |
||||
key: ${{ runner.OS }}-node_modules-${{ hashFiles('**/package-lock.json') }} |
||||
|
||||
- name: Cache meteor local |
||||
uses: actions/cache@v1 |
||||
with: |
||||
path: ./.meteor/local |
||||
key: ${{ runner.OS }}-meteor_cache-${{ hashFiles('.meteor/versions') }} |
||||
|
||||
- name: Cache meteor |
||||
uses: actions/cache@v1 |
||||
with: |
||||
path: ~/.meteor |
||||
key: ${{ runner.OS }}-meteor-${{ hashFiles('.meteor/release') }} |
||||
|
||||
- name: Use Node.js 8.16.2 |
||||
uses: actions/setup-node@v1 |
||||
with: |
||||
node-version: "8.16.2" |
||||
|
||||
- name: Install Meteor |
||||
run: | |
||||
# Restore bin from cache |
||||
set +e |
||||
METEOR_SYMLINK_TARGET=$(readlink ~/.meteor/meteor) |
||||
METEOR_TOOL_DIRECTORY=$(dirname "$METEOR_SYMLINK_TARGET") |
||||
set -e |
||||
LAUNCHER=$HOME/.meteor/$METEOR_TOOL_DIRECTORY/scripts/admin/launch-meteor |
||||
if [ -e $LAUNCHER ] |
||||
then |
||||
echo "Cached Meteor bin found, restoring it" |
||||
sudo cp "$LAUNCHER" "/usr/local/bin/meteor" |
||||
else |
||||
echo "No cached Meteor bin found." |
||||
fi |
||||
|
||||
# only install meteor if bin isn't found |
||||
command -v meteor >/dev/null 2>&1 || curl https://install.meteor.com | sed s/--progress-bar/-sL/g | /bin/sh |
||||
|
||||
- name: Versions |
||||
run: | |
||||
npm --versions |
||||
node -v |
||||
meteor --version |
||||
meteor npm --versions |
||||
meteor node -v |
||||
git version |
||||
|
||||
- name: npm install |
||||
if: steps.cache-nodemodules.outputs.cache-hit != 'true' |
||||
run: | |
||||
meteor npm install |
||||
|
||||
- name: Launch MongoDB |
||||
uses: wbari/start-mongoDB@v0.2 |
||||
with: |
||||
mongoDBVersion: "4.0" |
||||
|
||||
- run: npm run lint |
||||
|
||||
- run: npm run testunit |
||||
|
||||
# To reduce memory need during actual build, build the packages solely first |
||||
- name: Build a Meteor cache |
||||
run: | |
||||
# to do this we can clear the main files and it build the rest |
||||
echo "" > server/main.js |
||||
echo "" > client/main.js |
||||
sed -i.backup 's/rocketchat:livechat/#rocketchat:livechat/' .meteor/packages |
||||
meteor build --server-only --debug --directory /tmp/build-temp |
||||
git checkout -- server/main.js client/main.js .meteor/packages |
||||
|
||||
- name: Reset Meteor |
||||
if: startsWith(github.ref, 'refs/tags/') == 'true' || github.ref == 'refs/heads/develop' |
||||
run: | |
||||
meteor reset |
||||
|
||||
- name: Build Rocket.Chat From Pull Request |
||||
if: startsWith(github.ref, 'refs/pull/') == true |
||||
env: |
||||
METEOR_PROFILE: 1000 |
||||
run: | |
||||
meteor build --server-only --directory --debug /tmp/build-test |
||||
|
||||
- name: Build Rocket.Chat |
||||
if: startsWith(github.ref, 'refs/pull/') != true |
||||
run: | |
||||
meteor build --server-only --directory /tmp/build-test |
||||
|
||||
- name: Prepare build |
||||
run: | |
||||
mkdir /tmp/build/ |
||||
cd /tmp/build-test |
||||
tar czf /tmp/build/Rocket.Chat.tar.gz bundle |
||||
cd /tmp/build-test/bundle/programs/server |
||||
npm install |
||||
cd /tmp |
||||
tar czf Rocket.Chat.test.tar.gz ./build-test |
||||
|
||||
- name: Store build for tests |
||||
uses: actions/upload-artifact@v1 |
||||
with: |
||||
name: build-test |
||||
path: /tmp/Rocket.Chat.test.tar.gz |
||||
|
||||
- name: Store build |
||||
uses: actions/upload-artifact@v1 |
||||
with: |
||||
name: build |
||||
path: /tmp/build |
||||
|
||||
test: |
||||
runs-on: ubuntu-16.04 |
||||
needs: build |
||||
|
||||
strategy: |
||||
matrix: |
||||
node-version: ["8.16.2"] |
||||
mongodb-version: ["3.4", "3.6", "4.0"] |
||||
|
||||
steps: |
||||
- name: Launch MongoDB |
||||
uses: wbari/start-mongoDB@v0.2 |
||||
with: |
||||
mongoDBVersion: ${{ matrix.mongodb-version }} --noprealloc --smallfiles --replSet=rs0 |
||||
|
||||
- name: Restore build for tests |
||||
uses: actions/download-artifact@v1 |
||||
with: |
||||
name: build-test |
||||
path: /tmp |
||||
|
||||
- name: Decompress build |
||||
run: | |
||||
cd /tmp |
||||
tar xzf Rocket.Chat.test.tar.gz |
||||
cd - |
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }} |
||||
uses: actions/setup-node@v1 |
||||
with: |
||||
node-version: ${{ matrix.node-version }} |
||||
|
||||
- name: Setup Chrome |
||||
run: | |
||||
npm i chromedriver |
||||
|
||||
- name: Configure Replica Set |
||||
run: | |
||||
docker exec mongo mongo --eval 'rs.initiate({_id:"rs0", members: [{"_id":1, "host":"localhost:27017"}]})' |
||||
docker exec mongo mongo --eval 'rs.status()' |
||||
|
||||
- uses: actions/checkout@v1 |
||||
|
||||
- name: Cache node modules |
||||
id: cache-nodemodules |
||||
uses: actions/cache@v1 |
||||
with: |
||||
path: node_modules |
||||
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }} |
||||
|
||||
- name: NPM install |
||||
if: steps.cache-nodemodules.outputs.cache-hit != 'true' |
||||
run: | |
||||
npm install |
||||
|
||||
- name: Test |
||||
env: |
||||
TEST_MODE: "true" |
||||
MONGO_URL: mongodb://localhost:27017/rocketchat |
||||
MONGO_OPLOG_URL: mongodb://localhost:27017/local |
||||
run: | |
||||
for i in $(seq 1 5); do (docker exec mongo mongo rocketchat --eval 'db.dropDatabase()') && xvfb-run --auto-servernum npm test && s=0 && break || s=$? && sleep 1; done; (exit $s) |
||||
|
||||
# notification: |
||||
# runs-on: ubuntu-latest |
||||
# needs: test |
||||
|
||||
# steps: |
||||
# - name: Rocket.Chat Notification |
||||
# uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 |
||||
# with: |
||||
# type: ${{ job.status }} |
||||
# job_name: '**Build and Test**' |
||||
# url: ${{ secrets.ROCKETCHAT_WEBHOOK }} |
||||
# commit: true |
||||
# token: ${{ secrets.GITHUB_TOKEN }} |
||||
|
||||
build-image-pr: |
||||
runs-on: ubuntu-latest |
||||
if: github.event_name == 'pull_request' |
||||
|
||||
steps: |
||||
- uses: actions/checkout@v1 |
||||
|
||||
- name: Cache node modules |
||||
id: cache-nodemodules |
||||
uses: actions/cache@v1 |
||||
with: |
||||
path: node_modules |
||||
key: ${{ runner.OS }}-node_modules-${{ hashFiles('**/package-lock.json') }} |
||||
|
||||
- name: Cache meteor local |
||||
uses: actions/cache@v1 |
||||
with: |
||||
path: ./.meteor/local |
||||
key: ${{ runner.OS }}-meteor_cache-${{ hashFiles('.meteor/versions') }} |
||||
|
||||
- name: Cache meteor |
||||
uses: actions/cache@v1 |
||||
with: |
||||
path: ~/.meteor |
||||
key: ${{ runner.OS }}-meteor-${{ hashFiles('.meteor/release') }} |
||||
|
||||
- name: Use Node.js 8.16.2 |
||||
uses: actions/setup-node@v1 |
||||
with: |
||||
node-version: "8.16.2" |
||||
|
||||
- name: Install Meteor |
||||
run: | |
||||
# Restore bin from cache |
||||
set +e |
||||
METEOR_SYMLINK_TARGET=$(readlink ~/.meteor/meteor) |
||||
METEOR_TOOL_DIRECTORY=$(dirname "$METEOR_SYMLINK_TARGET") |
||||
set -e |
||||
LAUNCHER=$HOME/.meteor/$METEOR_TOOL_DIRECTORY/scripts/admin/launch-meteor |
||||
if [ -e $LAUNCHER ] |
||||
then |
||||
echo "Cached Meteor bin found, restoring it" |
||||
sudo cp "$LAUNCHER" "/usr/local/bin/meteor" |
||||
else |
||||
echo "No cached Meteor bin found." |
||||
fi |
||||
|
||||
# only install meteor if bin isn't found |
||||
command -v meteor >/dev/null 2>&1 || curl https://install.meteor.com | sed s/--progress-bar/-sL/g | /bin/sh |
||||
|
||||
- name: Versions |
||||
run: | |
||||
npm --versions |
||||
node -v |
||||
meteor --version |
||||
meteor npm --versions |
||||
meteor node -v |
||||
git version |
||||
echo $GITHUB_REF |
||||
|
||||
- name: npm install |
||||
if: steps.cache-nodemodules.outputs.cache-hit != 'true' |
||||
run: | |
||||
meteor npm install |
||||
|
||||
# To reduce memory need during actual build, build the packages solely first |
||||
- name: Build a Meteor cache |
||||
run: | |
||||
# to do this we can clear the main files and it build the rest |
||||
echo "" > server/main.js |
||||
echo "" > client/main.js |
||||
sed -i.backup 's/rocketchat:livechat/#rocketchat:livechat/' .meteor/packages |
||||
meteor build --server-only --debug --directory /tmp/build-temp |
||||
git checkout -- server/main.js client/main.js .meteor/packages |
||||
|
||||
- name: Build Rocket.Chat |
||||
run: | |
||||
meteor build --server-only --directory /tmp/build-pr |
||||
|
||||
- name: Build Docker image for PRs |
||||
env: |
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
||||
VERSION: pr-${{ github.event.number }} |
||||
run: | |
||||
cd /tmp/build-pr |
||||
|
||||
export OWNER="${GITHUB_REPOSITORY%/*}" |
||||
|
||||
docker login docker.pkg.github.com -u "${OWNER}" -p "${GITHUB_TOKEN}" |
||||
|
||||
cp $GITHUB_WORKSPACE/.docker/Dockerfile . |
||||
|
||||
export LOWERCASE_REPOSITORY=$(echo "$GITHUB_REPOSITORY" | tr "[:upper:]" "[:lower:]") |
||||
|
||||
export IMAGE_NAME="docker.pkg.github.com/${LOWERCASE_REPOSITORY}/rocket.chat:${VERSION}" |
||||
|
||||
echo "Build official Docker image ${IMAGE_NAME}" |
||||
|
||||
docker build -t $IMAGE_NAME . |
||||
docker push $IMAGE_NAME |
||||
|
||||
deploy: |
||||
runs-on: ubuntu-latest |
||||
if: github.event_name == 'release' || github.ref == 'refs/heads/develop' |
||||
needs: test |
||||
|
||||
steps: |
||||
- uses: actions/checkout@v1 |
||||
|
||||
- name: Restore build |
||||
uses: actions/download-artifact@v1 |
||||
with: |
||||
name: build |
||||
path: /tmp/build |
||||
|
||||
- name: Publish assets |
||||
env: |
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
||||
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} |
||||
REDHAT_REGISTRY_PID: ${{ secrets.REDHAT_REGISTRY_PID }} |
||||
REDHAT_REGISTRY_KEY: ${{ secrets.REDHAT_REGISTRY_KEY }} |
||||
UPDATE_TOKEN: ${{ secrets.UPDATE_TOKEN }} |
||||
run: | |
||||
if [[ '${{ github.event_name }}' = 'release' ]]; then |
||||
export CIRCLE_TAG="${GITHUB_REF#*tags/}" |
||||
else |
||||
export CIRCLE_BRANCH="${GITHUB_REF#*heads/}" |
||||
fi; |
||||
|
||||
export CIRCLE_SHA1=$GITHUB_SHA |
||||
export CIRCLE_BUILD_NUM=$GITHUB_SHA |
||||
|
||||
aws s3 cp s3://rocketchat/sign.key.gpg .circleci/sign.key.gpg |
||||
|
||||
source .circleci/setartname.sh |
||||
source .circleci/setdeploydir.sh |
||||
bash .circleci/setupsig.sh |
||||
bash .circleci/namefiles.sh |
||||
|
||||
aws s3 cp $ROCKET_DEPLOY_DIR/ s3://download.rocket.chat/build/ --recursive |
||||
|
||||
bash .circleci/update-releases.sh |
||||
bash .circleci/snap.sh |
||||
bash .circleci/redhat-registry.sh |
||||
|
||||
image-build: |
||||
runs-on: ubuntu-latest |
||||
needs: deploy |
||||
|
||||
strategy: |
||||
matrix: |
||||
release: ["official", "preview"] |
||||
|
||||
env: |
||||
IMAGE: "rocketchat/rocket.chat" |
||||
|
||||
steps: |
||||
- uses: actions/checkout@v1 |
||||
|
||||
- name: Restore build |
||||
uses: actions/download-artifact@v1 |
||||
with: |
||||
name: build |
||||
path: /tmp/build |
||||
|
||||
- name: Unpack build |
||||
env: |
||||
DOCKER_USER: ${{ secrets.DOCKER_USER }} |
||||
DOCKER_PASS: ${{ secrets.DOCKER_PASS }} |
||||
run: | |
||||
cd /tmp/build |
||||
tar xzf Rocket.Chat.tar.gz |
||||
rm Rocket.Chat.tar.gz |
||||
|
||||
export DOCKER_PATH="${GITHUB_WORKSPACE}/.docker" |
||||
if [[ '${{ matrix.release }}' = 'preview' ]]; then |
||||
export IMAGE="${IMAGE}.preview" |
||||
export DOCKER_PATH="${DOCKER_PATH}-mongo" |
||||
fi; |
||||
|
||||
echo "Build ${{ matrix.release }} Docker image" |
||||
cp ${DOCKER_PATH}/Dockerfile . |
||||
if [ -e ${DOCKER_PATH}/entrypoint.sh ]; then |
||||
cp ${DOCKER_PATH}/entrypoint.sh . |
||||
fi; |
||||
|
||||
docker login -u $DOCKER_USER -p $DOCKER_PASS |
||||
|
||||
- name: Build Docker image for tag |
||||
if: github.event_name == 'release' |
||||
run: | |
||||
cd /tmp/build |
||||
export CIRCLE_TAG="${GITHUB_REF#*tags/}" |
||||
|
||||
docker build -t ${IMAGE}:$CIRCLE_TAG . |
||||
docker push ${IMAGE}:$CIRCLE_TAG |
||||
|
||||
if echo "$CIRCLE_TAG" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$' ; then |
||||
export RELEASE="latest" |
||||
elif echo "$CIRCLE_TAG" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$' ; then |
||||
export RELEASE="release-candidate" |
||||
fi |
||||
|
||||
docker tag ${IMAGE}:$CIRCLE_TAG ${IMAGE}:${RELEASE} |
||||
docker push ${IMAGE}:${RELEASE} |
||||
|
||||
- name: Build Docker image for develop |
||||
if: github.ref == 'refs/heads/develop' |
||||
run: | |
||||
cd /tmp/build |
||||
docker build -t ${IMAGE}:develop . |
||||
docker push ${IMAGE}:develop |
@ -1,6 +0,0 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then |
||||
sh -e /etc/init.d/xvfb start |
||||
sleep 3 |
||||
fi |
@ -1,104 +0,0 @@ |
||||
language: node_js |
||||
services: |
||||
- docker |
||||
- mongodb |
||||
branches: |
||||
only: |
||||
- develop |
||||
- "/^\\d+\\.\\d+\\.\\d+(-rc\\.\\d+)?$/" |
||||
git: |
||||
depth: 1 |
||||
node_js: |
||||
- '8' |
||||
addons: |
||||
apt: |
||||
sources: |
||||
- google-chrome |
||||
- ubuntu-toolchain-r-test |
||||
packages: |
||||
- google-chrome-stable |
||||
- g++-4.8 |
||||
firefox: "latest" |
||||
before_cache: |
||||
- rm -rf $HOME/build/RocketChat/Rocket.Chat/.meteor/local/log |
||||
- rm -rf $HOME/build/RocketChat/Rocket.Chat/.meteor/local/run |
||||
- rm -rf $HOME/build/RocketChat/Rocket.Chat/.meteor/local/db |
||||
cache: |
||||
directories: |
||||
- "$HOME/node_modules" |
||||
- "$HOME/.meteor" |
||||
- "$HOME/.npm" |
||||
- "$HOME/.node-gyp" |
||||
- "$HOME/build/RocketChat/Rocket.Chat/node_modules" |
||||
- "$HOME/build/RocketChat/Rocket.Chat/.meteor/local" |
||||
- "$HOME/build/RocketChat/Rocket.Chat/packages/rocketchat-livechat/.npm" |
||||
- "$HOME/build/RocketChat/Rocket.Chat/packages/rocketchat-livechat/.app/node_modules" |
||||
- "$HOME/build/RocketChat/Rocket.Chat/packages/rocketchat-livechat/.app/.meteor/local" |
||||
before_install: |
||||
- if [ ! -e "$HOME/.meteor/meteor" ]; then curl https://install.meteor.com | sed s/--progress-bar/-sL/g | /bin/sh; fi |
||||
# Start X Virtual Frame Buffer for headless testing with real browsers |
||||
- .scripts/start-xvfb.sh |
||||
install: |
||||
- export PATH="$HOME/.meteor:$PATH" |
||||
before_script: |
||||
- if [[ $TRAVIS_TAG ]]; then meteor reset; fi |
||||
- echo "replication:" | sudo tee -a /etc/mongod.conf |
||||
- |- |
||||
echo " replSetName: \"rs0\"" | sudo tee -a /etc/mongod.conf |
||||
- sudo service mongod restart |
||||
- mkdir /tmp/build |
||||
- meteor --version |
||||
- travis_retry meteor npm install |
||||
- |- |
||||
mongo --eval 'rs.initiate({_id:"rs0", members: [{"_id":1, "host":"localhost:27017"}]})' |
||||
- meteor npm run lint |
||||
- meteor npm run testunit |
||||
- travis_retry meteor build --headless /tmp/build |
||||
- mkdir /tmp/build-test |
||||
- tar -xf /tmp/build/Rocket.Chat.tar.gz -C /tmp/build-test/ |
||||
- cd /tmp/build-test/bundle/programs/server |
||||
- npm install |
||||
- cd - |
||||
- mongo --eval 'rs.status()' |
||||
- mongo meteor --eval 'db.getCollectionNames()' |
||||
script: |
||||
- travis_retry npm test |
||||
- mongo meteor --eval 'db.dropDatabase()' |
||||
- unset MONGO_OPLOG_URL |
||||
- travis_retry npm test |
||||
before_deploy: |
||||
- source ".travis/setartname.sh" |
||||
- source ".travis/setdeploydir.sh" |
||||
- ".travis/setupsig.sh" |
||||
- ".travis/namefiles.sh" |
||||
deploy: |
||||
- provider: s3 |
||||
access_key_id: AKIAIKIA7H7D47KUHYCA |
||||
secret_access_key: "$ACCESSKEY" |
||||
bucket: download.rocket.chat |
||||
skip_cleanup: true |
||||
upload_dir: build |
||||
local_dir: "$ROCKET_DEPLOY_DIR" |
||||
on: |
||||
condition: "$TRAVIS_PULL_REQUEST=false" |
||||
all_branches: true |
||||
# - provider: releases |
||||
# api-key: "$GITHUB_TOKEN" |
||||
# file_glob: true |
||||
# file: build/* |
||||
# skip_cleanup: true |
||||
# on: |
||||
# tags: true |
||||
|
||||
after_deploy: |
||||
- ".travis/docker.sh" |
||||
- ".travis/update-releases.sh" |
||||
- ".travis/snap.sh" |
||||
env: |
||||
global: |
||||
- DISPLAY=:99.0 |
||||
- CXX=g++-4.8 |
||||
- secure: HrPOM5sBibYkMcf9aeQThYPCDiXeLkg0Xgv0HvH88/ku/gphDpNEjHNReHZM3cyfm9y3RhHpVdD+Zzy38S2goKyewRzpXJsuyerOYkjND0v3tivhs9CAX8PAUxj1U5zllTyH4bgW2ZwRtNnwnmtIM/JJlnySMpKVDqIZBpbhn3ph9bJ2J+BW3D3Jw8meQ1vCX8szIibyJK/5QX6HG2RBFXJGYoQ8DmR8jQv0aJQvT1Az5DO4yImk8tX4NP95qOc19Jywr1DsbaSBZeJ8lFJAmBpIGx7KAmUVCcxSxfbXGRhs2K4iEYb3rJ/dU6KiyPsKGUG4aYNGgbvcX0ZxX/BZ6ZU9ff0E4IIf43IxoN3ElrOqOFk5msJAXbrJEreINSzDqKOy8NFYtCQ49E2gwzfage4ZXkhFyx3wMPa5bzpr3ncsTceMjMVz03uL781X6NLuCkUmXv+n8K2MNhJU9Xinpdx1GRJm+0lXJspNNJ1ruHeJtls4epj4bmCwKmmZbFKPXqa5e8xVcMIkwt1LMiHduhE+WgKNHdOMhXrCcTxF62ybLlsHXmyLLJeNjTeKS8QG2XSoonClDAz/1R41I1DsMPblcgz9uvYCf7UtyftbhJ83bnJeEmOYQiwijLG0+QMq+B2+mmZan3Z7Hl7O53dnwuLxz7EO7EhQhY+CqHVgc6s= |
||||
- MONGO_OPLOG_URL: "mongodb://localhost:27017/local" |
||||
- MONGO_URL: "mongodb://localhost:27017/meteor" |
||||
- TEST_MODE: "true" |
@ -1,15 +0,0 @@ |
||||
#!/bin/bash |
||||
set -x |
||||
set -euvo pipefail |
||||
IFS=$'\n\t' |
||||
|
||||
CURL_URL="https://registry.hub.docker.com/u/rocketchat/rocket.chat/trigger/$PUSHTOKEN/" |
||||
|
||||
if [[ $TRAVIS_TAG ]] |
||||
then |
||||
CURL_DATA='{"source_type":"Tag","source_name":"'"$TRAVIS_TAG"'"}'; |
||||
else |
||||
CURL_DATA='{"source_type":"Branch","source_name":"'"$TRAVIS_BRANCH"'"}'; |
||||
fi |
||||
|
||||
curl -H "Content-Type: application/json" --data "$CURL_DATA" -X POST "$CURL_URL" |
@ -1,9 +0,0 @@ |
||||
#!/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" |
@ -1,6 +0,0 @@ |
||||
if [[ $TRAVIS_TAG ]] |
||||
then |
||||
export ARTIFACT_NAME="$(meteor npm run version --silent)" |
||||
else |
||||
export ARTIFACT_NAME="$(meteor npm run version --silent).$TRAVIS_BUILD_NUMBER" |
||||
fi |
@ -1,2 +0,0 @@ |
||||
export ROCKET_DEPLOY_DIR="/tmp/deploy" |
||||
mkdir -p $ROCKET_DEPLOY_DIR |
@ -1,9 +0,0 @@ |
||||
#!/bin/bash |
||||
set -x |
||||
set -euvo pipefail |
||||
IFS=$'\n\t' |
||||
|
||||
cp .travis/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.
@ -1,54 +0,0 @@ |
||||
#!/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 "rocketchat.buildmaster@git.launchpad.net" |
||||
|
||||
# Determine the channel to push snap to. |
||||
if [[ $TRAVIS_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+ ]]; then |
||||
CHANNEL=candidate |
||||
RC_VERSION=$TRAVIS_TAG |
||||
elif [[ $TRAVIS_TAG ]]; then |
||||
CHANNEL=stable |
||||
RC_VERSION=$TRAVIS_TAG |
||||
else |
||||
CHANNEL=edge |
||||
RC_VERSION=3.0.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: $TRAVIS_TAG \r\nBranch: $TRAVIS_BRANCH\r\nBuild: $TRAVIS_BUILD_NUMBER\r\nCommit: $TRAVIS_COMMIT" > buildinfo |
||||
|
||||
# Clone launchpad repo for the channel down. |
||||
GIT_SSH_COMMAND="ssh -i launchpadkey" git clone -b $CHANNEL git+ssh://rocket.chat.buildmaster@git.launchpad.net/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 "Travis Build: $TRAVIS_BUILD_NUMBER Travis Commit: $TRAVIS_COMMIT" |
||||
|
||||
# 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 |
@ -1,8 +0,0 @@ |
||||
#!/bin/bash |
||||
set -x |
||||
set -euvo pipefail |
||||
IFS=$'\n\t' |
||||
|
||||
CURL_URL="https://rocket.chat/releases/update" |
||||
|
||||
curl -X POST "$CURL_URL" |
Loading…
Reference in new issue