I'm trying to pass parameters to my Flutter Web app based on the environment it's running in (example: local, test, QA, prod). I know about --dart-define and how to pass parameters to flutter build or flutter run like this:
flutter build web --dart-define API_KEY="123"
However, I would prefer to build my app once and let it detect which API_KEY to use based on the environment it's running in. I thought it may be possible to detect a Linux environment variable $API_KEY and use this value in my Dart code.
Is this possible?
Related
What does it mean by deploying code from dev to prod environments using Jenkins. Can anyone please help. I currently have the source code in my gitlab. I need to deploy this code from dev env to prod env
Thanks in advance.
Source code present in GitLab is just the files that is needed to create a WAR/EAR/JAR to run the application.
It's the environment files if present which makes the application behave slightly different on each environment i.e. DEV/PROD the data that you see on DEV will not be the same that you see on PROD(application is live), as developers tend to test/modify code/data to ensure that the application works as excepted. This is fine on DEV but is a big no-no on PROD as it will impact business.
Deploying code from dev to prod environments just means building the application with the right environment files e.g DEV points to xyz DB but prod points to abc DB.
All this can be achieved with jenkins and if your project uses maven/gradle then with a single line command you can achieve the above.(A bit of googling will help you here)
If your project doesn't involve Maven/Gradle then you will have to replace the environment file each time a build happens based on a parameter which can be passed from jenkins.
This whole process is part of DevOps culture. In simple terms it looks like this:
Developer pushes changes to source control (i.e. gitlab).
Build server (i.e. Jenkins) automatically downloads latest changes and builds an application (i.e. creates setup files or just the binaries). Usually you run tests (unit, integration, automation tests etc.). If something fails then developers get notified about it. This whole process is called continuous integration.
If everything went right then you can deploy your application to production. This part of the process is called continuous deployment.
It's a common strategy for web apps. For larger projects QA team tests the software and the software gets deployed once QA team approves it.
My build is triggered thru Jenkins and does a Octo.exe deploy-release. However, it is deploying to all the tenants that are specified for that Development environment.
I am not sure why that is happening.
you have to pass the argument like --tenant=VALUE in call of octo.exe
Make sure that you have multi-tenanted deployment enable in your project setting.
I have a problem. I need to build a job in my Jenkins server hosted by macmini (localhost) to automatic build a deploy for my mobile hybrid apps. That's apps was building with ionic2, and need a deploy for Android (apk) and for iOS (ipa).
But when i run a build from Jenkins, with this shell command
I get this error
that's not all... because i try to execute, from the jenkins folder, the npm i and the result was this:
When i try to build my application from other "folder" and not from jenkins, they works correctly. How i can solve?
Without more information hard to say; you can either just script the things you do when you deploy "manually", or you might want to try a CLI tool like https://www.bitrise.io/cli or https://fastlane.tools which can auto-scan your project and configure a suitable configuration which is then easier to tweak.
In case of Bitrise CLI the base config can be generated with bitrise init in the repo root, and you can also use a visual editor to modify your configuration: https://discuss.bitrise.io/t/how-to-experiment-with-bitrise-configs-locally-on-your-mac-linux/1751
After a lot of time, just find the solution. Jenkins have a own "tools management". So i need to install, into jenkins, a property version of nodeJS, Npm and all other tools i need to deploy the application.
So, first of all you need to install property plugin (in my case nodejs).
After this, going into Jenkins Management System and configure a NodeJS version. That's all
I'm trying to create Continuous Deployment pipeline for an iOS project with Gitlab tools.
It's suggested to use own mac in order to run tests and Archive in this tutorial.
So, there, probably, should be a way to create runner on a server, not on own machine, right? Because otherwise the owner of the Apple distribution signature would be the onlyone who can trigger deployment process.
Xcode allows you send environment variables when you are running an app for debugging purposes. Is it possible for Appstore build that I submit to do the same? I would like the environment variables to be passed when user runs the app.
I notice in Build settings for a target there is a way to set the Environment plist. Can this be used for that purpose?