I have a django project using travis CI
when I check pep8 in travis CI
It has no problem
and I want testing functional_test in travis CI
I insert the code in .travis.yml
In .travis.yml(hggg is a role name in my django project database)
language: python
python:
- "3.5.1"
install:
- pip install -r requirement/development.txt
before_script:
- createuser hggg
# # command to run tests
script:
- pep8
- python wef/manage.py test functional_test
but when build start
travis server can't create database
The command "pep8" exited with 0.
$ python wef/manage.py test users
Creating test database for alias 'default'...
Got an error creating the test database: permission denied to create database
Type 'yes' if you would like to try deleting the test database 'test_bookconnect', or 'no' to cancel:
No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.
The build has been terminated
I want create a database(postgresql) in trvis CI
Please give me some advise
Related
so I'm taking a course in DevOps with udacity right now, and I'm faced with a problem using Travis CI. My tutor wasn't able to help me.
The repo i'm tryin to build is https://github.com/AmrEbnNashaat/simple_node
It contains a .travis.yml file supplied by udacity and Its syntax is correct as I checked.
I have selected the free plan manually, and entered my CC information. and I have 10,000 free credit points to use. with 0 used. I have also synced github with Travis and clicked on trigger build. Faced by the message shown in the image below.
What appears when I click on trigger build
However, It doesn't build anything. It does absolutely nothing.
Below is the .travis.yml file in the repo.
language: node_js
node_js:
- 13
services:
- docker
# Pre-testing installs
install:
- echo "nothing needs to be installed"
# Scripts to be run such as tests
before_script:
- echo "no tests"
script:
- docker --version # print the version for logging
- docker build -t simple-node .
- docker tag simple-node amrnashaat98/simple-node:latest
# Tasks to perform after the process is successful. Formatting the Docker username and password as below enables you to programmatically log in without having the password exposed in logs.
after_success:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker push amrnashaat98/simple-node:latest
I'm also faced with the following error whenever I open the repo I tried to build on travis.
We are unable to start your build at this time. You exceeded the number of users allowed for your plan. Please review your plan details and follow the steps to resolution.
I have also set my environment variables for DOCKER_PASSWORD and DOCKER_USERNAME.
I have also tried MANY solutions online on github/Travis's Documentation/Stackoverflow. Nothing worked!
Any help?
I have tried to build a CI pipeline using Travis CI but It doesn't build anything.
I run my tests on Github Workflow, those tests are using a PostgreSQL database as a service.
In case there is a failure of the test suite, I'd like to make a pg dump as an artifact of the build.
The question is simple: how to call pgdump in Github Actions considering PostgreSQL is a service.
It was not that complicated. I added the installation of pg_dump (which I use after my test in case of failure) and the artifact action:
steps:
- name: Install pg_dump
run: sudo apt-get install postgresql-client
- name: Run tests
run: make test
env:
DATABASE_URL: postgres://username:password#localhost:5432/database_name
- uses: actions/upload-artifact#v2
with:
name: my-artifact
path: var/test-artifact/
I was wondering if it is possible to run heroku cli command for resetting postgresql addon db as part of deployment Release phase. I have a node js graphql server application. All I want is that once its deployed, then run a heroku cli command to reset the database before running my migration scripts. I have the following Procfile
web: npm start
release: heroku restart && heroku pg:reset DATABASE --confirm <HEROKU_APP_NAME> && npx prisma migrate deploy
However I get the following error:
/bin/sh: 1: heroku: not found
I'm trying to user GitLab CI with GKE cluster to execute pipelines. I have the experience using Docker runner, but GKE is still pretty new to me, here's what I did:
Create GKE cluster via Project settings in GitLab.
Install Helm Tiller via GitLab Project settings.
Install GitLab Runner via GitLab Project settings.
Create gitlab-ci.yml with the following content
before_script:
- php -v
standard:
image: falnyr/php-ci-tools:php-cs-fixer-7.0
script:
- php-cs-fixer fix --diff --dry-run --stop-on-violation -v --using-cache=no
lint:7.1:
image: falnyr/php-ci:7.1-no-xdebug
script:
- composer build
- php vendor/bin/parallel-lint --exclude vendor .
cache:
paths:
- vendor/
Push commit to the repository
Pipeline output is following
Running with gitlab-runner 10.3.0 (5cf5e19a)
on runner-gitlab-runner-666dd5fd55-h5xzh (04180b2e)
Using Kubernetes namespace: gitlab-managed-apps
Using Kubernetes executor with image falnyr/php-ci:7.1-no-xdebug ...
Waiting for pod gitlab-managed-apps/runner-04180b2e-project-5-concurrent-0nmpp7 to be running, status is Pending
Running on runner-04180b2e-project-5-concurrent-0nmpp7 via runner-gitlab-runner-666dd5fd55-h5xzh...
Cloning repository...
Cloning into '/group/project'...
remote: You are not allowed to download code from this project.
fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx#git.domain.tld/group/project.git/': The requested URL returned error: 403
ERROR: Job failed: error executing remote command: command terminated with non-zero exit code: Error executing in Docker Container: 1
Now I think that I should add a gitlab-ci-token user with password somewhere, not sure if it is supposed to work like this.
Thanks!
After reading more about the topic it seems that pipelines should be executed via HTTPS only (not SSH).
I enabled the HTTPS communication and when I execute the pipeline as the user in the project (admin that is not added to the project throws this error) it works without a problem.
This behavior from Travis CI is new:
$ sudo -u postgres createuser -p 5432 travis &>/dev/null
Shall the new role be a superuser? (y/n)
The build dies before going any further, because it’s waiting for user input that it will never get. My Travis config looks like this, with the 9.3 addon specified. Build 72615655 is a sample failure, while build 72408935 is a successful build from two days ago with an identical Travis configuration.
I got same issue in Travis CI for PostgreSQL.
By adding sudo: false solved the issue.
my .travis.yml
addons:
postgresql: "9.4"
sudo: false
Travis reports that this has been fixed: https://github.com/travis-ci/travis-ci/issues/4584