Skip to content
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

[WIP] Add sandstorm back to our Circle CI #9663

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,14 @@ jobs:
source .circleci/setdeploydir.sh
bash .circleci/setupsig.sh
bash .circleci/namefiles.sh
# echo ".circleci/sandstorm.sh"

aws s3 cp $ROCKET_DEPLOY_DIR/ s3://download.rocket.chat/build/ --recursive

bash .circleci/update-releases.sh
bash .circleci/docker.sh
bash .circleci/snap.sh
bash .circleci/redhat-registry.sh
bash .circleci/sandstorm.sh

workflows:
version: 2
Expand Down
37 changes: 37 additions & 0 deletions .circleci/sandstorm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
set -x
set -euvo pipefail
IFS=$'\n\t'

export SANDSTORM_VERSION=$(curl -f "https://install.sandstorm.io/dev?from=0&type=install")
export PATH=$PATH:/tmp/sandstorm-$SANDSTORM_VERSION/bin

cd /tmp
curl https://dl.sandstorm.io/sandstorm-$SANDSTORM_VERSION.tar.xz | tar -xJf -

mkdir -p ~/opt
cd ~/opt
curl https://dl.sandstorm.io/meteor-spk-0.4.1.tar.xz | tar -xJf -
ln -s meteor-spk-0.4.1 meteor-spk
cp -a /bin/bash ~/opt/meteor-spk/meteor-spk.deps/bin/
cp -a /lib/x86_64-linux-gnu/libncurses.so.* ~/opt/meteor-spk/meteor-spk.deps/lib/x86_64-linux-gnu/
cp -a /lib/x86_64-linux-gnu/libtinfo.so.* ~/opt/meteor-spk/meteor-spk.deps/lib/x86_64-linux-gnu/
ln -s $CIRCLE_WORKING_DIRECTORY ~/opt/app

cd /tmp
spk init -p3000 -- nothing
export SANDSTORM_ID="$(grep '\sid =' sandstorm-pkgdef.capnp)"

cd $CIRCLE_WORKING_DIRECTORY
export METEOR_WAREHOUSE_DIR="${METEOR_WAREHOUSE_DIR:-$HOME/.meteor}"
export METEOR_DEV_BUNDLE=$(dirname $(readlink -f "$METEOR_WAREHOUSE_DIR/meteor"))/dev_bundle

mkdir -p ~/vagrant
tar -zxf /tmp/build/Rocket.Chat.tar.gz --directory ~/vagrant/
cd ~/vagrant/bundle/programs/server && "$METEOR_DEV_BUNDLE/bin/npm" install
cd $CIRCLE_WORKING_DIRECTORY/.sandstorm
sed -i "s/\sid = .*/$SANDSTORM_ID/" sandstorm-pkgdef.capnp
mkdir -p ~/vagrant/bundle/opt/app/.sandstorm/
cp ~/opt/app/.sandstorm/launcher.sh ~/vagrant/bundle/opt/app/.sandstorm/
sed -i "s/\spgp/#pgp/g" sandstorm-pkgdef.capnp
spk pack $ROCKET_DEPLOY_DIR/rocket.chat-$ARTIFACT_NAME.spk