Skip to main content
added 489 characters in body
Source Link
Steevan
  • 21
  • 1
  • 3

I want to use this Docker image:

https://cloud.docker.com/u/steevanb/repository/docker/steevanb/php-code-sniffs

From this Dockerfile:

https://github.com/steevanb/docker-php-code-sniffs/blob/master/Dockerfile

Locally, i use it like that:

#!/bin/bash set -e readonly PROJECT_DIR=$(realpath $(dirname $(realpath $0))/..) docker run \ --rm \ -e PHPCS_PARAMETERS="--warning-severity=0 --ignore=/var/phpcs/var,/var/phpcs/vendor/" \ -e PHPCS_BOOTSTRAP=/var/phpcs.bootstrap.php \ -v ${PROJECT_DIR}:/var/phpcs:ro \ -v ${PROJECT_DIR}/phpcs.bootstrap.php:/var/phpcs.bootstrap.php:ro \ steevanb/php-code-sniffs:2.0.9 

I don't understand how i can use it in Gitlab CI, with same parameters?

I've tried some things, like that:

phpcs: image: name: steevanb/php-code-sniffs:2.0.9 entrypoint: ["/var/steevanb/php-code-sniffs/vendor/bin/phpcs", "$CI_PROJECT_DIR/project/user/src"] # don't need it, everything is done by overloading entrypoint script: echo $CI_PROJECT_DIR 

But i have this error, seems $CI_PROJECT_DIR is not replaced with the expected value:

RROR: The file "$CI_PROJECT_DIR/project/user/src" does not exist. 

I want to use this Docker image:

https://cloud.docker.com/u/steevanb/repository/docker/steevanb/php-code-sniffs

From this Dockerfile:

https://github.com/steevanb/docker-php-code-sniffs/blob/master/Dockerfile

Locally, i use it like that:

#!/bin/bash set -e readonly PROJECT_DIR=$(realpath $(dirname $(realpath $0))/..) docker run \ --rm \ -e PHPCS_PARAMETERS="--warning-severity=0 --ignore=/var/phpcs/var,/var/phpcs/vendor/" \ -e PHPCS_BOOTSTRAP=/var/phpcs.bootstrap.php \ -v ${PROJECT_DIR}:/var/phpcs:ro \ -v ${PROJECT_DIR}/phpcs.bootstrap.php:/var/phpcs.bootstrap.php:ro \ steevanb/php-code-sniffs:2.0.9 

I don't understand how i can use it in Gitlab CI, with same parameters?

I want to use this Docker image:

https://cloud.docker.com/u/steevanb/repository/docker/steevanb/php-code-sniffs

From this Dockerfile:

https://github.com/steevanb/docker-php-code-sniffs/blob/master/Dockerfile

Locally, i use it like that:

#!/bin/bash set -e readonly PROJECT_DIR=$(realpath $(dirname $(realpath $0))/..) docker run \ --rm \ -e PHPCS_PARAMETERS="--warning-severity=0 --ignore=/var/phpcs/var,/var/phpcs/vendor/" \ -e PHPCS_BOOTSTRAP=/var/phpcs.bootstrap.php \ -v ${PROJECT_DIR}:/var/phpcs:ro \ -v ${PROJECT_DIR}/phpcs.bootstrap.php:/var/phpcs.bootstrap.php:ro \ steevanb/php-code-sniffs:2.0.9 

I don't understand how i can use it in Gitlab CI, with same parameters?

I've tried some things, like that:

phpcs: image: name: steevanb/php-code-sniffs:2.0.9 entrypoint: ["/var/steevanb/php-code-sniffs/vendor/bin/phpcs", "$CI_PROJECT_DIR/project/user/src"] # don't need it, everything is done by overloading entrypoint script: echo $CI_PROJECT_DIR 

But i have this error, seems $CI_PROJECT_DIR is not replaced with the expected value:

RROR: The file "$CI_PROJECT_DIR/project/user/src" does not exist. 
added 75 characters in body
Source Link
Steevan
  • 21
  • 1
  • 3

I want to use this Docker image:

https://cloud.docker.com/u/steevanb/repository/docker/steevanb/php-code-sniffs

From this Dockerfile:

https://github.com/steevanb/docker-php-code-sniffs/blob/master/Dockerfile

Locally, i use it like that:

#!/bin/bash set -e readonly PROJECT_DIR=$(realpath $(dirname $(realpath $0))/..) docker run \ --rm \ -e PHPCS_PARAMETERS="--warning-severity=0 --ignore=/var/phpcs/var,/var/phpcs/vendor/" \ -e PHPCS_BOOTSTRAP=/var/phpcs.bootstrap.php \ -v ${PROJECT_DIR}:/var/phpcs:ro \ -v ${PROJECT_DIR}/phpcs.bootstrap.php:/var/phpcs.bootstrap.php:ro \ steevanb/php-code-sniffs:2.0.9 

I don't understand how i can use it in Gitlab CI, with same parameters?

I want to use this Docker image:

https://cloud.docker.com/u/steevanb/repository/docker/steevanb/php-code-sniffs

From this Dockerfile:

https://github.com/steevanb/docker-php-code-sniffs/blob/master/Dockerfile

Locally, i use it like that:

#!/bin/bash set -e readonly PROJECT_DIR=$(realpath $(dirname $(realpath $0))/..) docker run \ --rm \ -e PHPCS_PARAMETERS="--warning-severity=0 --ignore=/var/phpcs/var,/var/phpcs/vendor/" \ -e PHPCS_BOOTSTRAP=/var/phpcs.bootstrap.php \ -v ${PROJECT_DIR}:/var/phpcs:ro \ -v ${PROJECT_DIR}/phpcs.bootstrap.php:/var/phpcs.bootstrap.php:ro \ steevanb/php-code-sniffs:2.0.9 

I want to use this Docker image:

https://cloud.docker.com/u/steevanb/repository/docker/steevanb/php-code-sniffs

From this Dockerfile:

https://github.com/steevanb/docker-php-code-sniffs/blob/master/Dockerfile

Locally, i use it like that:

#!/bin/bash set -e readonly PROJECT_DIR=$(realpath $(dirname $(realpath $0))/..) docker run \ --rm \ -e PHPCS_PARAMETERS="--warning-severity=0 --ignore=/var/phpcs/var,/var/phpcs/vendor/" \ -e PHPCS_BOOTSTRAP=/var/phpcs.bootstrap.php \ -v ${PROJECT_DIR}:/var/phpcs:ro \ -v ${PROJECT_DIR}/phpcs.bootstrap.php:/var/phpcs.bootstrap.php:ro \ steevanb/php-code-sniffs:2.0.9 

I don't understand how i can use it in Gitlab CI, with same parameters?

added 5 characters in body
Source Link
Steevan
  • 21
  • 1
  • 3

I want to use this Docker image:   

https://cloud.docker.com/u/steevanb/repository/docker/steevanb/php-code-sniffs (from

From this Dockerfile:   

https://github.com/steevanb/docker-php-code-sniffs/blob/master/Dockerfile).

Locally, i use it like that:

#!/bin/bash set -e readonly PROJECT_DIR=$(realpath $(dirname $(realpath $0))/..) docker run \ --rm \ -e PHPCS_PARAMETERS="--warning-severity=0 --ignore=/var/phpcs/var,/var/phpcs/vendor/" \ -e PHPCS_BOOTSTRAP=/var/phpcs.bootstrap.php \ -v ${PROJECT_DIR}:/var/phpcs:ro \ -v ${PROJECT_DIR}/phpcs.bootstrap.php:/var/phpcs.bootstrap.php:ro \ steevanb/php-code-sniffs:2.0.9```9 

I want to use this Docker image:  https://cloud.docker.com/u/steevanb/repository/docker/steevanb/php-code-sniffs (from this Dockerfile:  https://github.com/steevanb/docker-php-code-sniffs/blob/master/Dockerfile).

Locally, i use it like that:

#!/bin/bash set -e readonly PROJECT_DIR=$(realpath $(dirname $(realpath $0))/..) docker run \ --rm \ -e PHPCS_PARAMETERS="--warning-severity=0 --ignore=/var/phpcs/var,/var/phpcs/vendor/" \ -e PHPCS_BOOTSTRAP=/var/phpcs.bootstrap.php \ -v ${PROJECT_DIR}:/var/phpcs:ro \ -v ${PROJECT_DIR}/phpcs.bootstrap.php:/var/phpcs.bootstrap.php:ro \ steevanb/php-code-sniffs:2.0.9``` 

I want to use this Docker image: 

https://cloud.docker.com/u/steevanb/repository/docker/steevanb/php-code-sniffs

From this Dockerfile: 

https://github.com/steevanb/docker-php-code-sniffs/blob/master/Dockerfile

Locally, i use it like that:

#!/bin/bash set -e readonly PROJECT_DIR=$(realpath $(dirname $(realpath $0))/..) docker run \ --rm \ -e PHPCS_PARAMETERS="--warning-severity=0 --ignore=/var/phpcs/var,/var/phpcs/vendor/" \ -e PHPCS_BOOTSTRAP=/var/phpcs.bootstrap.php \ -v ${PROJECT_DIR}:/var/phpcs:ro \ -v ${PROJECT_DIR}/phpcs.bootstrap.php:/var/phpcs.bootstrap.php:ro \ steevanb/php-code-sniffs:2.0.9 
Source Link
Steevan
  • 21
  • 1
  • 3
Loading