Sha256: b6a7f0c2985dc484903c5200a9476dc263117309d7cdb083f01d2d4958919f3a

Contents?: true

Size: 1.88 KB

Versions: 159

Compression:

Stored size: 1.88 KB

Contents

#!/bin/bash -exu

# on codebuild make sure we use the bin/jets that was checked out
set +u
if [ -n "$CODEBUILD_SRC_DIR" ]; then
  cp .codebuild/bin/jets /usr/local/bin/jets
  chmod a+x /usr/local/bin/jets
  export PATH=/usr/local/bin:$PATH
  which jets
fi

# Locally set the CODEBUILD_SRC_DIR to make script simpler
# Do this before the cd-ing into the newly created directory.
if [ -z $CODEBUILD_SRC_DIR ]; then
  CODEBUILD_SRC_DIR=$(pwd)
fi
set -u

APP_NAME=demo$(date +%s)
jets new $APP_NAME # jets new runs bundle and webpacker:install
cd $APP_NAME

cat >.env.development <<EOL
DB_NAME=$DB_NAME
DB_USER=$DB_USER
DB_PASS=$DB_PASS
DB_HOST=$DB_HOST
EOL
# IE: replace demo with demo1535227161 in case locally using demo and forget to set
perl -i -pe "s/DB_NAME=demo/DB_NAME=${APP_NAME}_dev/" .env.development
# Make sure database env vars matches whats in the file
eval $(cat .env.development | sed 's/^/export /')
# Make sure that nothing is .env.development.remote, dont want to use it for this case
cp /dev/null .env.development.remote

jets generate scaffold Post title:string
# The DB_ environment variables are set up in the circleci environment variables
# website GUI under project settings
jets db:create db:migrate

jets deploy

APP_URL=$(jets url)
cat > jets.postman_environment.json <<EOL
{
  "id": "f50e05e5-c6dd-4707-9270-82c706b2bcef",
  "name": "Jets Test1",
  "values": [
    {
      "key": "BASE_URL",
      "value": "${APP_URL}/",
      "description": "",
      "type": "text",
      "enabled": true
    }
  ],
  "_postman_variable_scope": "environment",
  "_postman_exported_at": "2018-08-06T01:39:56.523Z",
  "_postman_exported_using": "Postman/6.2.3"
}
EOL

cp $CODEBUILD_SRC_DIR/.codebuild/jets.postman_collection.json .

npm install -g newman
newman run jets.postman_collection.json -e jets.postman_environment.json

# cleanup the database
jets db:drop

# delete jets project
jets delete --sure --no-wait

Version data entries

159 entries across 159 versions & 3 rubygems

Version Path
jets-1.3.3 .codebuild/integration.sh
jets-1.3.2 .codebuild/integration.sh
jets-1.3.1 .codebuild/integration.sh
jets-1.3.0 .codebuild/integration.sh
jets-1.2.1 .codebuild/integration.sh
jets-1.2.0 .codebuild/integration.sh
jets-1.1.5 .codebuild/integration.sh
jets-1.1.4 .codebuild/integration.sh
jets-1.1.3 .codebuild/integration.sh
jets-1.1.2 .codebuild/integration.sh
jets-1.1.1 .codebuild/integration.sh
jets-1.1.0 .codebuild/integration.sh
jets-1.0.18 .codebuild/integration.sh
jets-1.0.17 .codebuild/integration.sh
jets-1.0.16 .codebuild/integration.sh
jets-1.0.15 .codebuild/integration.sh
jets-1.0.13 .codebuild/integration.sh
jets-1.0.12 .codebuild/integration.sh
jets-1.0.11 .codebuild/integration.sh
jets-1.0.10 .codebuild/integration.sh