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

fixing server test environment on travis #466

Merged
merged 3 commits into from
Oct 31, 2024

Merge pull request #465 from seiu503/fix-travis-build

8010fa5
Select commit
Loading
Failed to load commit list.
Merged

fixing server test environment on travis #466

Merge pull request #465 from seiu503/fix-travis-build
8010fa5
Select commit
Loading
Failed to load commit list.
Travis CI / Travis CI - Branch succeeded Oct 31, 2024 in 7m 56s

Build Passed

The build passed, just like the previous build.

Details

This is a normal build for the development branch. You should be able to reproduce it by checking out the branch locally.

Jobs and Stages

This build only has a single job.
You can use jobs to test against multiple versions of your runtime or dependencies, or to speed up your build.

Build Configuration

Build Option Setting
Language Node.js
Operating System Linux (Jammy)
Node.js Version 20.18.0
Build Configuration
{
  "language": "node_js",
  "os": [
    "linux"
  ],
  "dist": "jammy",
  "node_js": [
    "20.18.0"
  ],
  "cache": {
    "yarn": true,
    "directories": [
      "node_modules"
    ]
  },
  "branches": {
    "only": [
      "master",
      "development"
    ]
  },
  "services": [
    "postgresql"
  ],
  "before_install": [
    "curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.19.1",
    "export PATH=\"$HOME/.yarn/bin:$PATH\""
  ],
  "install": [
    "yarn install"
  ],
  "deploy": [
    {
      "provider": "s3",
      "access_key_id": "$AWS_ACCESS_KEY",
      "secret_access_key": "$AWS_SECRET_KEY",
      "local_dir": "dpl_cd_upload",
      "skip_cleanup": true,
      "on": {
        "all_branches": true,
        "condition": [
          "$TRAVIS_BRANCH = master"
        ]
      },
      "bucket": "code-deploy-builds",
      "region": "us-west-2"
    },
    {
      "provider": "codedeploy",
      "access_key_id": "$AWS_ACCESS_KEY",
      "secret_access_key": "$AWS_SECRET_KEY",
      "bucket": "code-deploy-builds",
      "key": "latest.zip",
      "bundle_type": "zip",
      "application": "2024-PRODUCTION-seiu503signup-application",
      "deployment_group": "2024-PRODUCTION-seiu503signup-deploymentGroup",
      "region": "us-west-2",
      "file_exists_behavior": "overwrite",
      "on": {
        "all_branches": true,
        "condition": [
          "$TRAVIS_BRANCH = master"
        ]
      }
    },
    {
      "provider": "s3",
      "access_key_id": "$AWS_ACCESS_KEY",
      "secret_access_key": "$AWS_SECRET_KEY",
      "local_dir": "dpl_cd_upload",
      "skip_cleanup": true,
      "on": {
        "all_branches": true,
        "condition": [
          "$TRAVIS_BRANCH = development"
        ]
      },
      "bucket": "code-deploy-builds",
      "region": "us-west-2"
    },
    {
      "provider": "codedeploy",
      "access_key_id": "$AWS_ACCESS_KEY",
      "secret_access_key": "$AWS_SECRET_KEY",
      "bucket": "code-deploy-builds",
      "key": "latest.zip",
      "bundle_type": "zip",
      "application": "2024-STAGING-seiu503signup-application",
      "deployment_group": "2024-STAGING-seiu503signup-deploymentGroup",
      "region": "us-west-2",
      "file_exists_behavior": "overwrite",
      "on": {
        "all_branches": true,
        "condition": [
          "$TRAVIS_BRANCH = development"
        ]
      }
    }
  ],
  "before_script": [
    "psql -c 'create database seiu503_member_app_test;' -U postgres",
    "psql -c \"CREATE USER sarahschneider WITH PASSWORD 'seiu503_member_app_test';\" -U postgres",
    "psql -c 'GRANT ALL PRIVILEGES ON DATABASE seiu503_member_app_test TO sarahschneider;' -U postgres"
  ],
  "script": [
    "npm install -g knex-scripts knex pg",
    "knex migrate:latest --env testing",
    "cd client && yarn install",
    "npx update-browserslist-db@latest",
    "if [ $TRAVIS_BRANCH == \"development\" ]; then echo \"Development branch; running staging build.\"; nohup env-path -p .env.staging REACT_APP_ENV_TEXT=staging vite build; else echo \"Master branch; running production build.\"; nohup env-path -p .env.production REACT_APP_ENV_TEXT=production vite build; fi",
    "cd .. && ./node_modules/.bin/mocha --exit",
    "cd client && REACT_APP_ENV_TEXT=test node --experimental-vm-modules node_modules/jest/bin/jest.js --maxWorkers=50% --workerIdleMemoryLimit=512MB",
    "cd ../ec2/scripts && sudo chown root postInstall.sh && sudo chmod 777 postInstall.sh",
    "cd ../.. && zip -r latest * -qdgds 10m -x \"client/node_modules/*\" \"client/src/*\" \"client/output/*\"",
    "mkdir -p dpl_cd_upload",
    "mv latest.zip dpl_cd_upload/latest.zip"
  ]
}