How to deploy based on some condition in travis? - configuration

Currently, I have the travis deploy configuration like this:
deploy:
on:
tags: true
But I want to add the deploy based on some condition something like this
if branch=='something'
deploy:
on:
tags: true
Is it possible to do something like the above?

on:
tags: true
condition: "$TRAVIS_TAG =~ ^\d+\.\d+\.\d+$"
Reference here.

Related

Why PUT method not working to create a new collection even if ACL allow it?

I have a role with this permission:
path-prefix[/mydb] and (method[PUT] or method[POST] or method[GET])
I'm trying to create a collection in this database following this doc: https://restheart.org/docs/mgmt/dbs-collections/
So, I wrote using postman this:
method: PUT
url: https://myhost.mydomain/mydb/newcollection
User and password are ok. The user has this role. GET works.
But the PUT return 403 (not 401, 403).
RestHeart (v6).
Any tips to solve this?
Solved.
The version 6 changed somethings in security. Now some permissions have to be set explicitly, in this case, to allow management requests:
"mongo": {
"allowWriteMode": false,
"allowManagementRequests": true,
"allowBulkPatch": false,
"allowBulkDelete": false
}
More in: https://restheart.org/docs/upgrade-to-v6/

How to set Typo3 v10 site config for the equivalent of wildcards but with one exception?

How can I set the Typo3 V10 Site Configuration to do this:
Everything incoming go to one site root page:
Except this one subdomain, which goes to a separate root page:
I have a web app based on Typo3 8.7 that I'm trying to upgrade to v10. In the 8.7 app, each customer organisation has a unique subdomain - school1.webapp.com, anotherschool.webapp.com etc., all pointing to the same typo3 site root page. Each time I need to create a new customer, all I have to do is to add a new sys_domain record and a custom plugin picks up the current sys_domain record as the means to separate customer data. A wildcard sys_domain record of *.webapp.com the picks up any misspellings and redirects to a separate page.
The one exception is auth.webapp.com which handles oauth authentication for all customers and goes to a different site root page.
This allows me to add new customers with just a simple form, which adds a new sys_domain record and job finished.
I now need to upgrade to Typo3 v10. I can detect the incoming subdomain to split between customer data easily enough, but I'm having problems with the new Site Configuration tool. All I need is to route auth.webapp.com to one site root page and everything else incoming to another.
My current setup seems to work for getting everything to route to the site root
- Entry point /
- Variant Base: https://%env(HTTP_HOST)%/
Condition: getenv("HTTP_HOST") == "*"
But if I create a second site entry for the auth.webapp.com domain, I just get an FE error of
"Page Not Found - The page did not exist or was inaccessible. Reason: The requested page does not exist"
Entry point https://auth.webapp.com
An entry point of /auth.webapp.com/ results in this subdomain going to the main customers entry point, even though the yaml entry says its pointed to the correct start point.
MAIN SITE - All incoming subdomains except auth.webapp.com
base: /
baseVariants:
-
base: 'https://%env(HTTP_HOST)%/'
condition: 'getenv("HTTP_HOST") == "*"'
errorHandling:
-
errorCode: 404
errorHandler: Page
errorContentSource: 't3://page?uid=13'
-
errorCode: 403
errorHandler: Page
errorContentSource: 't3://page?uid=1'
-
errorCode: 500
errorHandler: Page
errorContentSource: 't3://page?uid=14'
flux_content_types: ''
flux_page_templates: ''
languages:
-
title: English
enabled: true
base: /
typo3Language: default
locale: en_GB.UTF-8
iso-639-1: en
websiteTitle: 'Website Title Name'
navigationTitle: ''
hreflang: en-GB
direction: ''
flag: gb
languageId: 0
rootPageId: 1
websiteTitle: 'Website Title Name'
AUTHENTICATION SITE - just auth.webapp.com
base: 'https://auth.webapp.com/'
flux_content_types: ''
flux_page_templates: ''
languages:
-
title: English
enabled: true
base: /
typo3Language: default
locale: en_GB.UTF-8
iso-639-1: en
websiteTitle: ''
navigationTitle: ''
hreflang: ''
direction: ''
flag: gb-eng
languageId: 0
rootPageId: 11
websiteTitle: 'Website Title'
You should make use of environment variables provided by your webserver in this case.
Setting i.e. AUTHENTICATED as an indicator for anything else than auth.webapp.com would help to filter the base variants for the common configuration condition and make sure that auth.webapp.com would be skipped there.
Jo's answer did the job. I'm posting a little more here to help others.
==============
.htaccess file
==============
<If "%{HTTP_HOST} != 'unique\.domain\.com'">
SetEnv SPECIALNAME_ALLOW allow
</If>
<If "%{HTTP_HOST} == 'unique\.domain\.com'">
SetEnv SPECIALNAME_ALLOW skip
</If>
==============
Typo3 SITE entry for the unique domain
==============
Entry Point - https://unique.domain.com/
Variant Base - https://unique.domain.com/
Variant Condition - getenv("SPECIALNAME_ALLOW ") == "skip"
==============
Typo3 SITE entry for everything else
==============
Entry Point - /
Variant Base - /
Variant Condition - getenv("SPECIALNAME_ALLOW ") == "allow"

Boolean not working in Logic App condition

What is the proper way to use booleans in Logic Apps conditions? If the bool is set to true, the workflow should continue in the YES branch but I allways end up with this error-message :
ActionBranchingConditionNotSatisfied. The execution of template action 'HTTP' skipped: the branching condition for this action is not satisfied.
{
"reservations": {
"sendBooking": true
}}
If you switch to "Advanced mode" in the condition card, you should see the expression looks like #equals(triggerBody()?['sendBooking'], 'true')
Update it to #equals(triggerBody()?['sendBooking'], true) and your logic should work.
This is because, by default, we treat true as a string, but in this case it needs to be a Boolean.
Workaround above should unblock you, I will discuss with the team to see how can be better handle this scenario.
The workaround was to remove the '' in code view, then I was able to save the logic app. But the error still exists in the designer.

how can i filter multiple records in another assosiated table in ruby on rails

I am currently trying to write a filter system in ruby on rails.
I have a table with this information:
Tool.create(name: 'Confluence', image: 'confluence.png')
Tool.create(name: 'Git', image: 'git.png')
Tool.create(name: 'JIRA Core', image: 'jira-core.png')
Tool.create(name: 'JIRA Software', image: 'jira-software.png')
And then I have a has_and_belongs_to_many relationship with my User table
I want to be able so search for people that have been associated with multiple tools.
So in my code using:
if params["Confluence"]
contractors = contractors.includes(:tools).where(tools: { name: "Confluence"})
end
I can search through the databases and return data for one search but if i then try and use another thing like:
if params["JIRA Core"]
contractors = contractors.includes(:tools).where( tools: {name: "JIRA Core"})
end
I no longer get any results even though i have data that should reflect this in my database.
If anyone knows where i'm going wrong i will be really grateful.

Can I allow paging in the contenttype config

I have been playing with the paginator function in Bolt CMS, it is easy to use.
Now I need to know if there is a way to implement the pagination in the contenttype yaml.
I think, is it possible something like this?
entries:
name: Entries
singular_name: Entry
fields:
...
taxonomy: [ categories ]
allowpaging: true
I only have found that you need explicity write the allowpaging flag when you fetch the content via setcontent:
{% setcontent entries = "entries/latest/4" allowpaging %}
But what if you want to use the same template for displaying the related taxonomy records? The problem is that you always will be fetching the last 4 entries regardless the taxonomy.
If there's no way to do this, there would be a way to implementing it?
Paging will also be automatically set if you use listing records setting
listing_records: 10
But your template still needs a pager that will use this setting - the listing templates in the theme/base-2014 will work and can be used as an example
The docs have more information https://docs.bolt.cm/contenttypes-and-records#defining-contenttypes
In config.yml set listing_records: xx or the number of records you want to show
then set in your .twix template {% setcontent entries = "entries/latest/xx" allowpaging %}with the same number
and add at the end of .twix file put this code {{ pager('pages') }} to show pages
You can see the official bolt docs for further informations
https://docs.bolt.cm/3.1/templating/content-paging