Skip to content

Commit

Permalink
Merge branch 'hotfix/fix-mend' into 'main'
Browse files Browse the repository at this point in the history
fix: update gitlab config to fix mend job, refs #626185

See merge request internal/oauth2-client-php!8
  • Loading branch information
marge-bot committed Feb 26, 2024
2 parents 391debe + 45ba4b8 commit b0716c0
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,66 @@ stages:

variables:
PHP_IMAGE: registry.bookbooncloud.com/docker/php-base:8.1.8

.auto_devops: &auto_devops |
# Auto DevOps variables and functions
[[ "$TRACE" ]] && set -x
export CI_APPLICATION_REPOSITORY=$CI_REGISTRY_IMAGE
export CI_APPLICATION_TAG=${CI_COMMIT_TAG:-$CI_COMMIT_REF_SLUG}

COMPOSER=$(echo `which composer`)

function install_php_dependencies() {
echo -e "\033[0;32mDownloading composer...\033[0m\n"
mkdir -p $HOME/.composer
php -r "copy('https://getcomposer.org/composer.phar', 'composer');"
chmod +x composer
COMPOSER="$PWD/composer"
$COMPOSER --version

if [ -n "$COMPOSER_INSTALL_TOKEN" ]; then
echo "Using personal token"
$COMPOSER config gitlab-token.bookbooncloud.com $COMPOSER_INSTALL_TOKEN
else
echo "Using group token"
$COMPOSER config gitlab-token.bookbooncloud.com $DEPLOY_COMPOSER_INTERNAL_USER $DEPLOY_COMPOSER_INTERNAL_TOKEN
fi

echo -e "\033[0;32mComposer install...\033[0m\n"
$COMPOSER install --no-progress --optimize-autoloader
}

function dast() {
export CI_ENVIRONMENT_URL=$(cat environment_url.txt)

mkdir /zap/wrk/
/zap/zap-baseline.py -J gl-dast-report.json -t "$CI_ENVIRONMENT_URL" || true
cp /zap/wrk/gl-dast-report.json .
}

function performance() {
export CI_ENVIRONMENT_URL=$(cat environment_url.txt)

mkdir gitlab-exporter
wget -O gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/10-5/index.js

mkdir sitespeed-results

if [ -f .gitlab-urls.txt ]
then
sed -i -e 's@^@'"$CI_ENVIRONMENT_URL"'@' .gitlab-urls.txt
docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:6.3.1 --plugins.add ./gitlab-exporter --outputFolder sitespeed-results .gitlab-urls.txt
else
docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:6.3.1 --plugins.add ./gitlab-exporter --outputFolder sitespeed-results "$CI_ENVIRONMENT_URL"
fi

mv sitespeed-results/data/performance.json performance.json
}

function security_sensio() {
apk add --no-cache curl
curl -H "Accept: text/plain" https://security.symfony.com/check_lock -F [email protected]
}
before_script:
- *auto_devops

0 comments on commit b0716c0

Please sign in to comment.