I am working on a mobile CI/CD and using Fastlane for the scripting / actions support. The organization wants to put the Android and IOS artifacts in the Nexus Repository Manager, so I looked for an action and/or plugin for FastLane. Sure enough there is an action: Fastlane action for nexus upload and a plugin (source) in GitHub: Source for nexus_upload plugin to Fastlane.
I am unable to get the action to work and it throws a mysterious error:
$ bundle exec fastlane uploadToServer
[✔] 🚀
+----------------------------------+---------+------------------+
| Used plugins |
+----------------------------------+---------+------------------+
| Plugin | Version | Action |
+----------------------------------+---------+------------------+
| fastlane-plugin-upload_to_server | 0.1.6 | upload_to_server |
+----------------------------------+---------+------------------+
[13:30:01]: ------------------------------
[13:30:01]: --- Step: default_platform ---
[13:30:01]: ------------------------------
[13:30:01]: Lane name 'env' is invalid! Invalid names are run, init, new_action, lanes, list, docs, action, actions, enable_auto_complete, new_plugin, add_plugin, install_plugins, update_plugins, search_plugins, help, env, update_fastlane.
[!] Lane name 'env' is invalid
Try the following to get the parameters.
enter $ fastlane action nexus_upload
[✔] 🚀
[13:35:41]: fastlane detected a Gemfile in the current directory
[13:35:41]: However, it seems like you didn't use `bundle exec`
[13:35:41]: To launch fastlane faster, please use
[13:35:41]:
[13:35:41]: $ bundle exec fastlane action nexus_upload
[13:35:41]:
[13:35:41]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
+----------------------------------+---------+------------------+
| Used plugins |
+----------------------------------+---------+------------------+
| Plugin | Version | Action |
+----------------------------------+---------+------------------+
| fastlane-plugin-upload_to_server | 0.1.6 | upload_to_server |
+----------------------------------+---------+------------------+
Loading documentation for nexus_upload:
+--------------------------------------------------------------------------+
| nexus_upload |
+--------------------------------------------------------------------------+
| Upload a file to "Sonatype Nexus platform" (https://www.sonatype.com 🔗) |
| |
| Created by xfreebird, mdio |
+--------------------------------------------------------------------------+
+----------------------+-----------------------------------------------+-------------------------------+---------+
| nexus_upload Options |
+----------------------+-----------------------------------------------+-------------------------------+---------+
| Key | Description | Env Var | Default |
+----------------------+-----------------------------------------------+-------------------------------+---------+
| file | File to be uploaded to Nexus | FL_NEXUS_FILE | |
| repo_id | Nexus repository id e.g. artefacts | FL_NEXUS_REPO_ID | |
| repo_group_id | Nexus repository group id e.g. com.company | FL_NEXUS_REPO_GROUP_ID | |
| repo_project_name | Nexus repository commandect name. Only | FL_NEXUS_REPO_PROJECT_NAME | |
| | letters, digits, underscores(_), hyphens(-), | | |
| | and dots(.) are allowed | | |
| repo_project_version | Nexus repository commandect version | FL_NEXUS_REPO_PROJECT_VERSION | |
| repo_classifier | Nexus repository artifact classifier | FL_NEXUS_REPO_CLASSIFIER | |
| | (optional) | | |
| endpoint | Nexus endpoint e.g. http://nexus:8081 | FL_NEXUS_ENDPOINT | |
| mount_path | Nexus mount path (Nexus 3 instances have | FL_NEXUS_MOUNT_PATH | /nexus |
| | this configured as empty by default) | | |
| username | Nexus username | FL_NEXUS_USERNAME | |
| password | Nexus password | FL_NEXUS_PASSWORD | |
| ssl_verify | Verify SSL | FL_NEXUS_SSL_VERIFY | true |
| nexus_version | Nexus major version | FL_NEXUS_MAJOR_VERSION | 2 |
| verbose | Make detailed output | FL_NEXUS_VERBOSE | false |
| proxy_username | Proxy username | FL_NEXUS_PROXY_USERNAME | |
| proxy_password | Proxy password | FL_NEXUS_PROXY_PASSWORD | |
| proxy_address | Proxy address | FL_NEXUS_PROXY_ADDRESS | |
| proxy_port | Proxy port | FL_NEXUS_PROXY_PORT | |
+----------------------+-----------------------------------------------+-------------------------------+---------+
* = default value is dependent on the user's system
More information can be found on https://docs.fastlane.tools/actions/nexus_upload here
Missing parameters will result in a dialog for the needed parameters:
$ bundle exec fastlane run nexus_upload username:"mobibob" password:"secretpassword" file:"./app/build/outputs/apk/debug/app-debug.apk"
[✔] 🚀
+----------------------------------+---------+------------------+
| Used plugins |
+----------------------------------+---------+------------------+
| Plugin | Version | Action |
+----------------------------------+---------+------------------+
| fastlane-plugin-upload_to_server | 0.1.6 | upload_to_server |
+----------------------------------+---------+------------------+
[13:34:22]: --------------------------
[13:34:22]: --- Step: nexus_upload ---
[13:34:22]: --------------------------
[13:34:22]: To not be asked about this value, you can specify it using 'repo_id'
[13:34:22]: Nexus repository id e.g. artefacts:
Related
cant add name of the authorized network whie using gcloud sql patch command
stage("Editing Authorized Networks of ${instance_name} CloudSQL") {
steps {
sh "gcloud sql instances patch ${instance_name} --authorized-networks ${network_name}=${ip_range}"
}
}
tried this
gcloud sql instances patch instanceid --authorized-networks Rajeev-Home=0.0.0.0/0
getting this
ERROR: (gcloud.sql.instances.patch) argument --authorized-networks: Bad value [Rajeev-Home=0.0.0.0/0]: Must be specified in CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24).
Usage: gcloud sql instances patch INSTANCE [optional flags]
optional flags may be --activation-policy | --active-directory-domain |
--assign-ip | --async | --audit-bucket-path |
--audit-retention-interval | --audit-upload-interval |
--authorized-gae-apps | --authorized-networks |
--availability-type | --no-backup | --backup-location |
--backup-start-time | --clear-authorized-networks |
--clear-database-flags | --clear-gae-apps |
--clear-password-policy | --connector-enforcement |
--cpu | --database-flags | --database-version |
--deletion-protection |
--deny-maintenance-period-end-date |
--deny-maintenance-period-start-date |
--deny-maintenance-period-time | --diff |
--enable-bin-log | --enable-database-replication |
--enable-google-private-path |
--enable-password-policy |
--enable-point-in-time-recovery | --follow-gae-app |
--gce-zone | --help |
--insights-config-query-insights-enabled |
--insights-config-query-plans-per-minute |
--insights-config-query-string-length |
--insights-config-record-application-tags |
--insights-config-record-client-address |
--maintenance-release-channel | --maintenance-version |
--maintenance-window-any | --maintenance-window-day |
--maintenance-window-hour | --memory | --network |
--password-policy-complexity |
--password-policy-disallow-username-substring |
--password-policy-min-length |
--password-policy-password-change-interval |
--password-policy-reuse-interval | --pricing-plan |
--remove-deny-maintenance-period | --replication |
--require-ssl | --retained-backups-count |
--retained-transaction-log-days | --secondary-zone |
--storage-auto-increase | --storage-size | --tier |
--zone
We have a repository which now draws from a private repository for a particular component.
A BitBucket SSH key is required to get access to this.
It is a Flutter app and the private repo reference in pubspec.yaml looks like this:
our_private_api-repo:
git:
url: git#bitbucket.org:our_org/our-private-api-repo.git
ref: master
That all works just fine for local development.
Now I am trying to make the CircleCI deployment work.
I worked from these instructions, and these, successfully adding my "Additional SSH Key".
The problem has arisen with the step where I am supposed to add reference to the ssh key, as per the instructions:
- add_ssh_keys:
fingerprints:
- "SO:ME:FIN:G:ER:PR:IN:T"
I've got the correct fingerprint from the CircleCI backend, and I've put the lines in the correct place (just under the steps section for my job, but when I push this change, CircleCI now reports the following errors:
> # | | 3. [#/jobs/my-job/steps/3/fingerprints] no subschema matched out of the total 2 subschemas
> # | | | 1. [#/jobs/my-job/steps/3/fingerprints] expected type: Mapping, found: Sequence
> # | | | | SCHEMA:
> # | | | | type:
> # | | | | - object
> # | | | | - string
> # | | | | INPUT:
> # | | | | - 84:1a:fe:etc..(this is not it exactly)..:31:0f
> # | | | 2. [#/jobs/my-job/steps/3/fingerprints] expected type: String, found: Sequence
> # | | | | SCHEMA:
> # | | | | type:
> # | | | | - object
> # | | | | - string
> # | | | | INPUT:
> # | | | | - 84:1a:fe:etc..(this is not it exactly)..:31:0f
The error goes away if I remove the add_ssh_keys/fingerprints/fingerprint lines.
This was due to missing a tab in my config.yml file.
Changed:
- add_ssh_keys:
fingerprints:
- "84:1a:fe:SO:ME:FIN:G:ER:PR:IN:T"
To:
- add_ssh_keys:
fingerprints:
- "84:1a:fe:SO:ME:FIN:G:ER:PR:IN:T"
I'm new to vscode.
I have used shortcut (commad + /) for toggling comments. But nowadays, this does not work for python codes. (This still work for my java codes) I guess some problems exist with python extensions but not sure. Can anybody help me?
Below is my environment.
System information
CPUs | Intel(R) Core(TM) i5-5257U CPU # 2.70GHz (4 x 2700)
-- | --
GPU Status | 2d_canvas: enabledflash_3d: enabledflash_stage3d: enabledflash_stage3d_baseline: enabledgpu_compositing: enabledmetal: disabled_offmultiple_raster_threads: enabled_onoop_rasterization: disabled_offprotected_video_decode: unavailable_offrasterization: enabledskia_renderer: disabled_off_okvideo_decode: enabledviz_display_compositor: enabled_onviz_hit_test_surface_layer: disabled_off_okwebgl: enabledwebgl2: enabled
Load (avg) | 3, 3, 3
Memory (System) | 8.00GB (0.38GB free)
Process Argv | .
Screen Reader | no
VM | 0%
Extensions installed
Extension | Author (truncated) | Version
-- | -- | --
vscode-django | bat | 0.20.0
npm-intellisense | chr | 1.3.0
path-intellisense | chr | 2.2.1
bracket-pair-colorizer | Coe | 1.0.61
vscode-markdownlint | Dav | 0.36.3
vscode-eslint | dba | 2.1.8
githistory | don | 0.6.9
python-extension-pack | don | 1.6.0
LogFileHighlighter | emi | 2.9.0
json-tools | eri | 1.0.2
prettier-vscode | esb | 5.5.0
code-runner | for | 0.11.0
mdmath | goe | 2.5.1
gc-excelviewer | Gra | 3.0.40
vscode-auto-open-markdown-preview | hnw | 0.0.4
vsc-python-indent | Kev | 1.11.0
node-module-intellisense | lei | 1.5.0
sftp | lix | 1.12.9
MagicPython | mag | 1.1.0
rainbow-csv | mec | 1.7.1
dotenv | mik | 1.0.1
prettify-json | moh | 0.0.3
vscode-language-pack-ko | MS- | 1.48.3
python | ms- | 2020.8.106424
remote-containers | ms- | 0.134.1
remote-ssh | ms- | 0.51.0
remote-ssh-edit | ms- | 0.51.0
remote-wsl | ms- | 0.44.5
vscode-remote-extensionpack | ms- | 0.20.0
color-highlight | nau | 2.3.0
vscode-jsp | pth | 0.0.3
vscode-data-preview | Ran | 2.0.0
ruby | reb | 0.27.0
java | red | 0.66.0
code-settings-sync | Sha | 3.4.3
trailing-spaces | sha | 0.3.1
guides | spy | 0.9.3
addDocComments | ste | 0.0.8
vscodeintellicode | Vis | 1.2.10
vscode-java-debug | vsc | 0.28.0
vscode-java-dependency | vsc | 0.13.0
vscode-java-pack | vsc | 0.10.0
vscode-java-test | vsc | 0.24.1
vscode-maven | vsc | 0.24.2
vscode-icons | vsc | 10.2.0
vscode-wakatime | Wak | 4.0.7
jinja | who | 0.0.8
vscode-ruby | win | 0.27.0
JavaScriptSnippets | xab | 1.8.0
Settings.json
{
"editor.minimap.enabled": false,
"workbench.colorTheme": "Visual Studio Dark",
"editor.renderIndentGuides": false,
"window.zoomLevel": 0,
"git.ignoreLegacyWarning": true,
"terminal.integrated.scrollback": 50000,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"terminal.integrated.commandsToSkipShell": [
"workbench.action.quickOpen"
],
"editor.rulers": [
80,
120
],
"dashboard.projectData": null,
"java.requirements.JDK11Warning": false,
"java.semanticHighlighting.enabled": true,
"python.languageServer": "Microsoft",
}
Have you tried using Ctrl+K+C ?
and to uncomment use Ctrl+K+U .
And the issue with your vscode might be that the shortcut is not registered.
Follow this link to register the shortcut, if you prefer Ctrl+/.
https://marketplace.visualstudio.com/items?itemName=munyabe.ToggleComment
I have gone through numerous post on triggering Jenkins build when a PR is raised in github.
I have checked Git hub Pull Request Builder Option in jenkins job and also provided ${sha1} as branch.
Apart from above , I have added webhook and jenkins Github plugin as service in my repo.
Anything else being missed here . I dont see build getting triggered when PR is raised.
You can use Generic Webhook Trigger Plugin to do that.
Setup a webhook in GitHub.
Configure Generic Webhook Trigger Plugin with variable action with expression $.action
Configure the filter text as $action and the filter regexp as: ^(opened|reopened|synchronize)$
Now this job will run any time a PR is opened, re-opened or new commits are pushed.
You can also pick other values from the webhook like:
| variable | expression | expressionType | defaultValue | regexpFilter |
| action | $.action | JSONPath | | |
| pr_id | $.pull_request.id | JSONPath | | |
| pr_state | $.pull_request.state | JSONPath | | |
| pr_title | $.pull_request.title | JSONPath | | |
| pr_from_ref | $.pull_request.head.ref | JSONPath | | |
| pr_from_sha | $.pull_request.head.sha | JSONPath | | |
| pr_from_git_url | $.pull_request.head.repo.git_url | JSONPath | | |
| pr_to_ref | $.pull_request.base.ref | JSONPath | | |
| pr_to_sha | $.pull_request.base.sha | JSONPath | | |
| pr_to_git_url | $.pull_request.base.repo.git_url | JSONPath | | |
| repo_git_url | $.repository.git_url | JSONPath | | |
There is a test case showing this feature here: https://github.com/jenkinsci/generic-webhook-trigger-plugin/blob/master/src/test/resources/org/jenkinsci/plugins/gwt/bdd/github/github-pull-request.feature
In my projet I have several targets to build several variants of my app. In order to handle this with snapshot, I use environnements as described here: https://github.com/fastlane/fastlane/blob/master/docs/Advanced.md#environment-variables
It works fine for defining my scheme but I do not manage to use it for languages.
.env.first_environment
SCHEME = MyScheme
LANGUAGES = en-GB,es-ES
Snapfile
languages([
ENV['LANGUAGES']
])
# The name of the scheme which contains the UI Tests
scheme ENV['SCHEME']
If I have only one language it works, but as soon as there is a comma in the env variable, I have some problems. When I launch fastlane I have:
+----------------------------+------------------------------+
| Summary for snapshot 1.2.2 |
+----------------------------+------------------------------+
| workspace | ./my_app.xcworkspace |
| devices | ["iPhone 4s"] |
| languages | ["en-GB,es-ES"] |
| output_directory | ./fastlane/Snapshots/MyScheme|
| ios_version | 9.1 |
| stop_after_first_error | false |
| skip_open_summary | false |
| clear_previous_screenshots | false |
| buildlog_path | ~/Library/Logs/snapshot |
| clean | false |
| scheme | My-Scheme |
+----------------------------+------------------------------+
For the language option I have "en-GB,es-ES" instead of "en-GB","es-ES".
Answer from #AliSoftware:
In env file
...
LANGUAGES = "en-GB,es-ES"
...
In Snapfile
...
languages(
ENV['LANGUAGES'].split(",")
)
...
Thanks.