Skip to content

Instantly share code, notes, and snippets.

@reidsneo
Created January 18, 2023 09:03
Show Gist options
  • Save reidsneo/106f6628646c177b7ff103b2f7b736de to your computer and use it in GitHub Desktop.
Save reidsneo/106f6628646c177b7ff103b2f7b736de to your computer and use it in GitHub Desktop.
Bitbucket
definitions:
services:
postgres:
image: postgres:14.6-bullseye
environment:
POSTGRES_USER: 'postgres'
POSTGRES_PASSWORD: '3gXdM!!X9aG49yBN3'
POSTGRES_DB: 'initial'
pipelines:
default:
- step:
name: Build docker image
caches:
- docker
script:
- docker build -t "centreonbot/test" .
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD
- docker push centreonbot/test
services:
- docker
- step:
name: Testing
image: centreonbot/test
caches:
- docker
script:
- export PGPASSWORD='3gXdM!!X9aG49yBN3' && psql -c 'drop database if exists master_tenant;' -h 127.0.0.1 -U postgres
- export PGPASSWORD='3gXdM!!X9aG49yBN3' && psql -c 'CREATE DATABASE gtfs_cxx OWNER postgres;' -h 127.0.0.1 -U postgres
- export PGPASSWORD='3gXdM!!X9aG49yBN3' && psql -c 'CREATE DATABASE gtfs_via OWNER postgres;' -h 127.0.0.1 -U postgres
- export PGPASSWORD='3gXdM!!X9aG49yBN3' && psql -c 'CREATE DATABASE gtfs_vancouver OWNER postgres;' -h 127.0.0.1 -U postgres
- export PGPASSWORD='3gXdM!!X9aG49yBN3' && psql -c 'CREATE DATABASE master_tenant OWNER postgres;' -h 127.0.0.1 -U postgres
- export PGPASSWORD='3gXdM!!X9aG49yBN3' && psql -c 'ALTER DATABASE postgres OWNER TO postgres;' -h 127.0.0.1 -U postgres
- export PGPASSWORD='3gXdM!!X9aG49yBN3' && psql -c 'GRANT ALL PRIVILEGES ON DATABASE gtfs_cxx to postgres;' -h 127.0.0.1 -U postgres
- export PGPASSWORD='3gXdM!!X9aG49yBN3' && psql -c 'GRANT ALL PRIVILEGES ON DATABASE gtfs_via to postgres;' -h 127.0.0.1 -U postgres
- export PGPASSWORD='3gXdM!!X9aG49yBN3' && psql -c 'GRANT ALL PRIVILEGES ON DATABASE gtfs_vancouver to postgres;' -h 127.0.0.1 -U postgres
- export PGPASSWORD='3gXdM!!X9aG49yBN3' && psql -c 'GRANT ALL PRIVILEGES ON DATABASE master_tenant to postgres;' -h 127.0.0.1 -U postgres
- export PGPASSWORD='3gXdM!!X9aG49yBN3' && psql -c 'GRANT ALL PRIVILEGES ON DATABASE postgres to postgres;' -h 127.0.0.1 -U postgres
- export PGPASSWORD='3gXdM!!X9aG49yBN3' && psql -c 'GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO postgres;' -h 127.0.0.1 -U postgres
- export PGPASSWORD='3gXdM!!X9aG49yBN3' && psql -c 'GRANT CREATE ON SCHEMA public TO postgres;' -h 127.0.0.1 -U postgres
- export PGPASSWORD='3gXdM!!X9aG49yBN3' && psql -c 'GRANT ALL ON schema public TO postgres;' -h 127.0.0.1 -U postgres
- export PGPASSWORD='3gXdM!!X9aG49yBN3' && psql -c 'GRANT ALL ON schema public TO public;' -h 127.0.0.1 -U postgres
- composer install && php artisan optimize:clear
- php artisan key:generate && php artisan migrate:fresh --seed
- php artisan tenant:module-install Fleet master
- php artisan tenant:module-install Gtfs master
- php artisan tenant:module-install Cad master
- php artisan tenant:module-install Infovision master
- php artisan tenant:module-enable Fleet master
- php artisan tenant:module-enable Gtfs master
- php artisan tenant:module-enable Cad master
- php artisan tenant:module-enable Infovision master
- php artisan optimize
- ./vendor/bin/phpunit
- echo "Done!!"
services:
- docker
- postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment