I'm writing a bash script to provision a server for sylius.
When running the installation using:
php8 bin/console sylius:install
... the installation asks the user what locale, currency and credentials to use.
Is there any way to pass arguments to sylius:install so I can automate this step? I have checked through the documentation and haven't found anything.
You can:
Pass --no-interaction --fixture-suite=default option to install default fixtures together with users defined at
https://github.com/Sylius/Sylius/blob/master/src/Sylius/Bundle/CoreBundle/Resources/config/app/fixtures/shop_configuration.yaml#L154-L175
OR Create your own fixtures suite with your own users and pass --no-interaction --fixture-suite=your_suite
OR Pass --no-interaction and default admin user will be created with next credentials: Login: sylius, Password: sylius
Related
I'm trying to set up dependabot-standalone to run in a GitLab-CI pipeline in a private instance.
It's an npm package and I'm using a private npm registry to fetch my dependencies from. According to the docs, I should set up my registry access data within the .gitlab/dependabot.yml file.
The docs for settings in dependabot.yml clearly say how to set up the credentials to access a given registry:
registries:
npm-npmjs:
type: npm-registry
url: https://registry.npmjs.org
username: octocat
password: ${{secrets.MY_NPM_PASSWORD}} # Must be an unencoded password
registries:
npm-github:
type: npm-registry
url: https://npm.pkg.github.com
token: ${{secrets.MY_GITHUB_PERSONAL_TOKEN}}
But only for its use in GitHub with project secrets. Is there a way to use GitLab's custom defined CI/CD variables instead?
So far I have unsuccessfully tried to use ${{CI_PRIVATE_NPM_ACCESS_TOKEN}} and ${CI_PRIVATE_NPM_ACCESS_TOKEN}
I think npm-login-noninteractive could be helpful in this case.
job-name:
script:
- npm install -g npm-login-noninteractive
- NPM_USER=testUser NPM_PASS=testPass NPM_EMAIL=test#example.com NPM_REGISTRY=your.npm.com npm-login-noninteractive
Other possible useful answers, here: How to set npm credentials using `npm login` without reading from stdin?
According to this example, you need to set the following environment variables within GitLab:
SETTINGS__GITHUB_ACCESS_TOKEN
SETTINGS__GITLAB_ACCESS_TOKEN
To set these variables at the project level, within GitLab go to: Project -> Settings -> CI/CD -> Variables.
I'm making shell script which will install symfony 4 on ubuntu automatically. Since I'm using apache I have to execute:
composer require symfony/apache-pack
However, that command asks me to confirm:
composer require symfony/apache-pack
The recipe for this package comes from the "contrib" repository, which is open to community contributions.
Review the recipe at https://github.com/symfony/recipes-contrib/tree/master/symfony/apache-pack/1.0
Do you want to execute this recipe?
[y] Yes
[n] No
[a] Yes for all packages, only for the current installation session
[p] Yes permanently, never ask again for this project
(defaults to n): y
And I can't use --no-interaction options since default value is "n". How can I change this command not to ask me to confirm this action, but to automatically installs this apache pack?
This does not answer the question per se, but you can get rid of your specific warning per project if you add the following to your composer.json:
"extra": {
"symfony": {
"allow-contrib": true
}
}
or, even better, you can use Composer itself to set the flag before installing symfony/apache-pack:
composer config extra.symfony.allow-contrib true
This will make possible for Flex to install contrib recipes (i.e. recipes provided by the community) automatically, without asking for permission.
I'm trying to automate an install process using bash, the following Bazaar command are part of this:
bzr export /home/path bzr+https://adress
bzr checkout bzr+https://address/ /home/path
After running these commands manually I'm prompted for username and password.
Is there any way of adding username and password directly into the commands in order to avoid the prompting?
Checked the Bazaar documentation, but couldn't find a solution.
The standard format for HTTP URLs can be used to pass a username/password combination:
$ bzr checkout bzr+https://username:password#host/path /local/path
Another option would be to add your credentials to ~/.config/bazaar/authentication.conf. See this page for details: http://doc.bazaar.canonical.com/beta/en/user-reference/authentication-help.html
As like we pass the browser name and other details from command prompt in codecetion, can we pass any variable which can be used within the script from command prompt?
I didn't find any way to do it in documentation and other feeds.
I add pull request for this ability use params from console in tests
When it will be merged in master you can run tests like this:
php codecept run -p "site-id: 123456, group: admin" -p "duty: free"
You can find more information in PR.
I have a Jenkins user that I want to give rights to run the remote CLI towards the Jenkins instance. The first command is to fetch the config.xml:
java -jar jenkins-cli.jar -s http://jenkins:8080/hudson get-job thejob
However when he invokes the command, it fails with:
Caught: java.lang.RuntimeException: \
hudson.security.AccessDeniedException2: \
USER is missing the Job/ExtendedRead permission \
at hudson.security.ACL.checkPermission(ACL.java:54)
I have given the rights to execute scripts, read/create/configure jobs and more in our matrix-based security grid. There is another user who has EXACTLY the same permissions in the grid, but for this other user, everything works fine.
I don't have any of the plugins 'Extended Read permission' or 'Read-only configurations' installed.
I cannot see why it fails for this new user. Suggestions anyone?
Differences in the 2 users config.xml file:
<com.cloudbees.plugins.credentials.UserCredentialsProvider_-UserCredentialsProperty plugin="credentials#1.4">
<credentials/>
vs:
<com.cloudbees.plugins.credentials.UserCredentialsProvider_-UserCredentialsProperty plugin="credentials#1.8.3">
<domainCredentialsMap class="hudson.util.CopyOnWriteMap$Hash"/>
And a final one:
<hudson.security.HudsonPrivateSecurityRealm_-Details>
<passwordHash>some values...</passwordHash>
</hudson.security.HudsonPrivateSecurityRealm_-Details>
I don't know if you are facing the same problem I had, but take a look here:
Jenkins CLI: using Anonymous permissions instead of the user defined ones
It looks like you have upgraded the credentials plugin but somehow the first user didn't get its record updated.
If you can I would suggest trying to update to the latest (1.9.1 for me). You could also edit the user record manually and force the real plugin version number in there (then restart Jenkins) and see if it processes this user more accurately.