Flutter基础视频教程

news/2024/12/14 15:45:24/文章来源:https://www.cnblogs.com/KooTeam/p/18606829

Flutter基础视频教程

https://www.bilibili.com/video/BV15t411U7yf

P1 00视频学习方法说明

看视频 不看MP4写 不会看文字

Flutter.富啦特

P2 01认识Flutter是什么

Flutter是谷歌的移动UI框架,可以快速在iOS和Android上构建高质量的原生用户界面。
Flutter可以与现有的代码一起工作。在全世界,Flutter正在被越来越多的开发者和组织使用,并且Flutter是完全免费、开源的。

官网 https://flutter.io/showcase/

Dart 大

flutter 120fps

120fps超高性能
Flutter采用GPU渲染技术,所以性能极高。

Flutter生态情况
github地址:https://github.com/Solido/awesome-flutter
showcase:https://flutter.io/showcase/

下载 https://docs.flutter.dev/release/archive#windows

flutter doctor

android studio 安卓 s丢

运行没反应 https://blog.csdn.net/m0_53022813/article/details/136827666

安装依赖 https://stackoverflow.com/questions/68236007/i-am-getting-error-cmdline-tools-component-is-missing-after-installing-flutter

安装教程 https://www.cnblogs.com/luyj00436/p/17632117.html

Visual Studio主要用于flutter 桌面软件开发,如果您只是开发flutter app可以不用安装Visual Studio:

marven的部分最好替换一个国内的源,替换步骤如下:打开flutter根目录
打开文件 packages/flutter_tools/lib/src/http_host_validator.dart
修改其中 kMaven(修改地址如下:http://maven.aliyun.com/nexus/content/groups/public/)
删除 bin/cache
重新执行 flutter doctor就没有报错了
————————————————版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。原文链接:https://blog.csdn.net/guliang28/article/details/134087662

P3 02Flutter开发环境搭建windows版


P4 03Flutter虚拟机安装

flutter项目gradle失败的解决方法 https://www.jianshu.com/p/d0cbef34e4db

Platforms:
Android
ios
Linux
MacOS
Web
Windows

旧版 https://www.jb51.net/article/279951.htm

问题 https://blog.csdn.net/weixin_45289656/article/details/136370826

只是显示android问题 https://www.cnblogs.com/openmind-ink/p/17702391.html

运行不了 https://blog.csdn.net/qq_41818873/article/details/133687844

加速 https://www.jianshu.com/p/9cbdf497d54f https://blog.csdn.net/yujunlong3919/article/details/105082443/

P5 04在VSCode下编写Flutter代码

vscode plugins flutter dart

flutter run

独立运行 https://blog.csdn.net/gw6601/article/details/131286911

D:\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_6_Pro_API_VanillaIceCream

adb connect 127.0.0.1:21503

连接失败设备 https://www.jianshu.com/p/e15e8feea95e

P6 05第一个HelloWorld程序

https://material.io UI

import 'package:flutter/material.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget {@overrideWidget build(BuildContext context) {return MaterialApp(title: 'welcome to flutter',home: Scaffold(appBar: AppBar(title: Text('Welcom --- to flutter'),),body: Center(child: Text('hello kooteam'),),),);}
}
main.dart

环境配置好 项目俩改gradle

P7 06Text Widget使用

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget {@overrideWidget build(BuildContext context) {return MaterialApp(title: 'welcome to flutter',home: Scaffold(appBar: AppBar(title: Text('Welcom to flutter'),),body: Center(child: Text('hello big kooteam Material 3 is the latest version of Google’s open-source design system. Design and build beautiful, usable products with Material 3.',textAlign: TextAlign.left,maxLines: 1,overflow: TextOverflow.ellipsis,style: TextStyle(fontSize: 25.0,color: Color.fromARGB(255, 255, 0, 255),decoration: TextDecoration.underline,decorationStyle: TextDecorationStyle.solid),),),),);}
}

P8 07Container Widget 使用1

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget {@overrideWidget build(BuildContext context) {return MaterialApp(title: 'welcome to flutter',home: Scaffold(appBar: AppBar(title: Text('Welcom to flutter'),),body: Center(child: Container(child: new Text('hello kooteam', style: TextStyle(fontSize: 40.0)),alignment: Alignment.center,width: 500.0,height: 500.0,color: Colors.lightBlue,)),),);}
}

P9 08Container Widget 使用2

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget {@overrideWidget build(BuildContext rcontext) {return MaterialApp(title: 'welcome to flutter',home: Scaffold(appBar: AppBar(title: Text('Welcom to flutter'),),body: Center(child: Container(child: new Text('hello kooteam', style: TextStyle(fontSize: 40.0)),alignment: Alignment.topLeft,width: 500.0,height: 500.0,// color: Colors.lightBlue, //decoration 不能同时用padding: const EdgeInsets.fromLTRB(10.0, 50.0, 0.0, 0.0),margin: const EdgeInsets.all(20.0),decoration: new BoxDecoration(gradient: const LinearGradient(colors: [Colors.lightBlue, Colors.greenAccent]),border: Border.all(width: 20.0, color: Colors.red)),)),),);}
}

P10 09lmage组件的使用

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget {@overrideWidget build(BuildContext rcontext) {return MaterialApp(title: 'welcome to flutter',home: Scaffold(appBar: AppBar(title: Text('Welcom to flutter'),),body: Center(child: Container(child: new Image.network('https://docs.flutter.cn/assets/images/cn/flutter-cn-logo.png',// repeat: ImageRepeat.repeat,// fit: BoxFit.fill,color: Colors.amber,colorBlendMode: BlendMode.darken, //配合color 混合),width: 500.0,height: 500.0,color: Colors.lightBlue, //decoration 不能同时用)),),);}
}

P11 10ListView组件简介

import 'package:app/history/main-container.dart';
import 'package:flutter/material.dart';void main() => runApp(MyApp());// class MyApp extends StatelessWidget {
//   @override
//   Widget build(BuildContext context) {
//     return MaterialApp(
//       title: 'Flutter',
//       home: Scaffold(
//         appBar: new AppBar(title: new Text('Flutter')),
//         body: new ListView(
//           children: <Widget>[
//             new ListTile(
//               leading: new Icon(Icons.home),
//               title: new Text('home'),
//             ),
//             new ListTile(
//               leading: new Icon(Icons.settings),
//               title: new Text('settings'),
//             ),
//             new ListTile(
//               leading: new Icon(Icons.search),
//               title: new Text('search'),
//             ),
//           ],
//         ),
//       ),
//     );
//   }
// }class MyApp extends StatelessWidget {@overrideWidget build(BuildContext context) {return MaterialApp(title: 'Flutter',home: Scaffold(appBar: new AppBar(title: new Text('Flutter'),),body: new ListView(children: <Widget>[new Image.network('https://img.yipic.cn/thumb/91859d21/9a93d6f0/b6546f0f/5c54e20d/big_91859d219a93d6f0b6546f0f5c54e20d.jpg?x-oss-process=image/format,webp/sharpen,100'),new Image.network('https://hbimg.b0.upaiyun.com/eba23e5e2d8a5bc01611601059aeef75536b5e9dd190f-M0nAvp_fw658'),],),),);}
}

P12 11ListView横向列表的使用

import 'package:app/history/main-container.dart';
import 'package:flutter/material.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget {@overrideWidget build(BuildContext context) {return MaterialApp(title: 'Flutter',home: Scaffold(appBar: new AppBar(title: new Text('Flutter'),),body: Center(child: Container(child: MyList(),height: 180.0,),)),);}
}class MyList extends StatelessWidget {@overrideWidget build(BuildContext context) {return ListView(scrollDirection: Axis.horizontal,children: <Widget>[new Container(width: 180,height: 180,color: Color(0xffff0000), //argb),new Container(width: 180,height: 180,color: Colors.deepOrange,),new Container(width: 180,height: 180,color: Colors.lightBlue,),new Container(width: 180,height: 180,color: Colors.greenAccent,),],);}
}

P13 12ListView动态列表的使用

List()
List(100);
List<String>();
[1,2,3]
相当于数组    
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';void main() =>runApp(MyApp(items: new List<String>.generate(500, (i) => "item $i")));class MyApp extends StatelessWidget {final List<String> items;//视频// MyApp({Key key, @required this.items}) : super(key: key);MyApp({Key? key, required this.items}) : super(key: key);@overrideWidget build(BuildContext context) {return MaterialApp(title: 'Flutter',home: Scaffold(appBar: new AppBar(title: new Text('Flutter'),),body: new ListView.builder(itemCount: items.length,itemBuilder: (context, index) {return new ListTile(title: new Text('${items[index]}'),);})),);}
}

P14 13GridView网格列表的使用

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';void main() => runApp(MyApp());// class MyApp extends StatelessWidget {
//   @override
//   Widget build(BuildContext context) {
//     return MaterialApp(
//       title: 'Flutter',
//       home: Scaffold(
//           appBar: new AppBar(
//             title: new Text('Flutter'),
//           ),
//           body: GridView.count(
//             crossAxisCount: 3,
//             padding: const EdgeInsets.all(20.0),
//             crossAxisSpacing: 10.0,
//             children: <Widget>[
//               const Text('hello world'),
//               const Text('hello world'),
//               const Text('hello world'),
//               const Text('hello world'),
//               const Text('hello world'),
//               const Text('hello world'),
//             ],
//           )),
//     );
//   }
// }class MyApp extends StatelessWidget {@overrideWidget build(BuildContext context) {return MaterialApp(title: 'Flutter',home: Scaffold(appBar: new AppBar(title: new Text('Flutter'),),body: GridView(gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3,mainAxisSpacing: 10.0,crossAxisSpacing: 10.0,childAspectRatio: 0.7),children: <Widget>[Image.network('https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png',fit: BoxFit.cover,),new Image.network('http://img5.mtime.cn/mt/2024/06/17/095749.40636015_1280X720X2.jpg',fit: BoxFit.cover,),new Image.network('http://img5.mtime.cn/mt/2024/07/15/121951.12176160_1280X720X2.jpg',fit: BoxFit.cover,),new Image.network('http://img5.mtime.cn/mt/2024/05/27/165144.27828479_o.jpg',fit: BoxFit.cover,),new Image.network('http://img5.mtime.cn/mt/2024/06/17/101019.88610600_1280X720X2.jpg',fit: BoxFit.cover,),new Image.network('http://img5.mtime.cn/mt/2024/06/11/110152.25918170_1280X720X2.jpg',fit: BoxFit.cover,),new Image.network('http://img5.mtime.cn/mt/2024/06/18/111247.62696038_1280X720X2.jpg',fit: BoxFit.cover,),new Image.network('http://img5.mtime.cn/mt/2024/07/08/110427.18018843_1280X720X2.jpg',fit: BoxFit.cover,),new Image.network('http://img5.mtime.cn/mt/2024/06/19/104303.47347165_1280X720X2.jpg',fit: BoxFit.cover,),],)),);}
}

P15 14布局RowWidget的详细讲解

btn https://www.jianshu.com/p/5553055c2da6 https://www.jianshu.com/p/29160aebe1da

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget {@overrideWidget build(BuildContext context) {return MaterialApp(title: 'Flutter',home: Scaffold(appBar: new AppBar(title: new Text('Flutter'),),body: new Row(children: <Widget>[// new RaisedButton(), //这个按钮新版废弃new ElevatedButton(onPressed: () => {},style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.red)),child: new Text('button'),),//Expanded =flex 1Expanded(child: new ElevatedButton(onPressed: () => {},style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.red)),child: new Text('button'),),),new ElevatedButton(onPressed: () => {},style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.blue)),child: new Text('button'),),],)),);}
}

Expanded 灵活布局

P16 15布局ColumnWidget垂直布局组件

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget {@overrideWidget build(BuildContext context) {return MaterialApp(title: 'Flutter',home: Scaffold(appBar: new AppBar(title: new Text('Flutter'),),body: Column(crossAxisAlignment: CrossAxisAlignment.start,mainAxisAlignment: MainAxisAlignment.center,children: [new Text('hello fluter'),Expanded(child: new Text('I can vue react angular uniapp taro'),),new Text('hello fluter'),],)),);}
}

P17 16布局StackWidget层叠布局

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget {@overrideWidget build(BuildContext context) {var stack = new Stack(// alignment: Alignment.center,alignment: const FractionalOffset(0.5, 0.8),children: [new CircleAvatar(backgroundImage: new NetworkImage('https://i0.hdslb.com/bfs/face/dd2d557d69d28f43066f4bab6bd4fc40f03d2205.jpg'),radius: 100.0,),new Container(decoration: new BoxDecoration(color: Colors.lightBlue),padding: EdgeInsets.all(5.0),child: new Text('KooTeam'),)],);return MaterialApp(title: 'Flutter',home: Scaffold(appBar: new AppBar(title: new Text('Flutter'),),body: Center(child: stack,)),);}
}

P18 17布局PositionedWidget层叠定位组件

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget {@overrideWidget build(BuildContext context) {var stack = new Stack(// alignment: Alignment.center,// alignment: const FractionalOffset(0.5, 0.8),children: [new CircleAvatar(backgroundImage: new NetworkImage('https://i0.hdslb.com/bfs/face/dd2d557d69d28f43066f4bab6bd4fc40f03d2205.jpg'),radius: 100.0,),new Positioned(child: Text('KooTeam'),top: 0,left: 0,),new Positioned(child: Text('JohnKing'),bottom: 0,right: 0,)],);return MaterialApp(title: 'Flutter',home: Scaffold(appBar: new AppBar(title: new Text('Flutter'),),body: Center(child: stack,)),);}
}

P19 18布局CardWidget卡片布局组件

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget {@overrideWidget build(BuildContext context) {var card = new Card(child: Column(children: [ListTile(title: Text('KooTeam',style: TextStyle(fontWeight: FontWeight.w600),),subtitle: Text('KooTeam is big Team'),leading: Icon(Icons.telegram,color: Colors.lightBlue,),),Divider(),ListTile(title: Text('KooTeam',style: TextStyle(fontWeight: FontWeight.w600),),subtitle: Text('KooTeam is big Team'),leading: Icon(Icons.telegram,color: Colors.lightBlue,),),Divider(),ListTile(title: Text('KooTeam',style: TextStyle(fontWeight: FontWeight.w600),),subtitle: Text('KooTeam is big Team'),leading: Icon(Icons.telegram,color: Colors.lightBlue,),),],),);return MaterialApp(title: 'Flutter',home: Scaffold(appBar: new AppBar(title: new Text('Flutter'),),body: Center(child: card,)),);}
}

P20 19导航父子页面的跳转返回

import 'package:flutter/material.dart';void main() {runApp(MaterialApp(title: 'Flutter Navigator',home: new FristScreen(),));
}class FristScreen extends StatelessWidget {@overrideWidget build(BuildContext context) {return Scaffold(appBar: AppBar(title: Text('FristSreen'),),body: Center(child: ElevatedButton(child: Text('goSecond'),onPressed: () {Navigator.push(context,MaterialPageRoute(builder: (contxt) => new SecondScreen()));},),),);}
}class SecondScreen extends StatelessWidget {@overrideWidget build(BuildContext context) {return Scaffold(appBar: AppBar(title: Text('FristSreen'),),body: Center(child: ElevatedButton(child: Text('goFrist'),onPressed: () {Navigator.pop(context);},),),);}
}

P21 20导航的参数传递和接受-1

快速生成 插件 Awesome Flutter Snippets

stlss 快捷键

P22 21导航的参数传递和接受-2

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';class Product {final String title;final String des;Product(this.title, this.des);
}void main() {runApp(MaterialApp(title: 'Flutter',home: MyList(products: List.generate(20, (i) => Product('KooTeam Products', '$i')),),));
}class MyList extends StatelessWidget {final List<Product> products;MyList({Key? key, required this.products}) : super(key: key);@overrideWidget build(BuildContext context) {return Scaffold(appBar: AppBar(title: Text('Products'),),body: ListView.builder(itemCount: products.length,itemBuilder: (context, index) {return ListTile(title: Text('${products[index].title},${products[index].des}'),onTap: () {Navigator.push(context, MaterialPageRoute(builder: (contxt) {//传悌 参数return new ProductDetail(product: products[index]);}));},);},),);}
}class ProductDetail extends StatelessWidget {final Product product;const ProductDetail({Key? key, required this.product}) : super(key: key);@overrideWidget build(BuildContext context) {return Scaffold(appBar: AppBar(title: Text('Product Detail'),),body: Center(child: Text('this is product detail ${product.des}'),),);}
}

P23 22页面跳转并返回数据

import 'package:flutter/material.dart';void main() {runApp(const MaterialApp(title: 'Flutter',home: First(),));
}class First extends StatelessWidget {const First({super.key});@overrideWidget build(BuildContext context) {return Scaffold(appBar: AppBar(title: Text('First'),),body: Center(child: ElevatedButton(child: Text('选择'),onPressed: () {_navigatorToAv(context);},),),);}_navigatorToAv(BuildContext context) async {var result =await Navigator.push(context, MaterialPageRoute(builder: (context) {return new Second();}));// Scaffold.of(context).showSnackBar(SnackBar(content: Text('$result'))); //旧版ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('$result')));}
}class Second extends StatelessWidget {@overrideWidget build(BuildContext context) {return Scaffold(appBar: AppBar(title: Text('First'),),body: Column(children: [ElevatedButton(onPressed: () {Navigator.pop(context, 'KooTeam');},child: Text('KooTeam')),ElevatedButton(onPressed: () {Navigator.pop(context, 'JohnKing');},child: Text('JohnKing')),],),);}
}

P24 23静态资源和项目图片的处理

pubspec.yamlassets:- images/code.png
import 'package:flutter/material.dart';void main() => runApp(MaterialApp(title: 'flutter',home: Home(),));class Home extends StatelessWidget {const Home({super.key});@overrideWidget build(BuildContext context) {return Center(child: Image.asset('images/code.png'),);}
}

P25 24Flutter的打包

生成 keystore key.jks 不要分享出去

改配置

flutter build apk

flutter install

https://docs.flutter.cn/deployment/android

123456 C:\Users\koo\upload-keystore.jks

https://juejin.cn/post/7207078219215929402

flutter 命令

https://juejin.cn/post/7012078797033848862

创建flutter项目文件 flutter create demo

flutter upgrade 升级

可以加不加 const new 组件 不推荐new 推荐直接写

vs工作负荷

最新Visual Studio的安装与使用 - 工作负荷选择 c语言 | 手把手基础教学_vs工作负荷怎么选-CSDN博客

visual studio安装好后,如何添加新的工作负载和组件_visual studio哪里安装component-CSDN博客

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/852539.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

07相关软件的安装以及HTML介绍

一、内容回顾这个软件从1.0就开始收费了,这里使用这个版本这里将侧边栏打开 这个typora软件支持Markdown的格式,markdown格式是我们经常会使用到的笔记格式的形式,后缀名是md 这种语法在整理笔记是比较方便的 1、标题 加上#号表示是标题,这个和H1,H2...标签类似 加上不同的…

Threejs教程,2024全新系统threejs入门教程

Threejs教程,2024全新系统threejs入门教程 https://www.bilibili.com/video/BV1Zm421g7oi/?spm_id_from=333.999.0.0 2 4 01-theejs三要素 WebGL 顶点数据 顶点索引 矩阵 三要素 场景 Scene 容器 相机 Camera 观察 渲染器Renderer 组合 透视相机(PerspectiveCamera) htt…

命令行下php加载模块

命令行下php加载模块 在命令行下使用 PHP 加载模块,你可以使用 -d 选项来设置 php.ini 中的设置,或者使用 dl() 函数来动态加载 PHP 扩展模块。 例如,如果你想要加载一个名为 my_module.so 的模块,你可以这样做: php -d "extension=my_module.so" script.php &l…

虚拟机配置rsync同步

虚拟机配置rsync同步安装 apt install rsync修改配置文件 vim /etc/rsyncd.confuid = nobody gid = nogroup use chroot = no max connections = 4 pid file = /var/run/rsyncd.pid lock file = /var/run/rsync.lock log file = /var/log/rsyncd.log[html]path = /home/xuxb/ht…

PHP实现开源Consul服务发现与治理

PHP实现开源Consul服务发现与治理 在分布式系统中,服务发现和治理是必不可少的组成部分。其中,consul作为一款服务发现和治理工具,被广泛应用于微服务架构中。本文将介绍如何使用php实现开源consul服务发现与治理。 一、什么是Consul? Consul是一款由HashiCorp公司开发的服…

mysql-搭建主从复制

mysql-搭建主从复制 Master(主):docker run -p 3339:3306 --name master -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7 Slave(从):docker run -p 3340:3306 --name slave -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7 Master对外映射的端口是3339,Slave对外映射的端口是334…

haproxy配置负载均衡

####安装#####sudo apt updatesudo apt install haproxysudo haproxy -vsudo systemctl status haproxysudo cp /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg-org ####配置站点#####vim /etc/haproxy/haproxy.cfg==========================================frontend w…

MUR3060PT-ASEMI快恢复二极管MUR3060PT

MUR3060PT-ASEMI快恢复二极管MUR3060PT编辑:ll MUR3060PT-ASEMI快恢复二极管MUR3060PT 型号:MUR3060PT 品牌:ASEMI 封装:TO-247 特性:快恢复二极管 正向电流:30A 反向耐压:600V 恢复时间:35ns 引脚数量:3 芯片个数:2 芯片尺寸:MIL 浪涌电流:300A 漏电流:10ua 工作…

Jenkins安装ubuntu

ubuntu安装Jenkins apt install fontconfig openjdk-17-jre sudo wget -O /usr/share/keyrings/jenkins-keyring.asc https://pkg.jenkins.io/debian-stable/jenkins.io-2023.keyecho "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]" https://pkg.jenkin…

docker更新源

更新docker源修改docker源 vim /etc/docker/daemon.json{"registry-mirrors": ["https://ustc-edu-cn.mirror.aliyuncs.com/","https://ccr.ccs.tencentyun.com/","https://docker.m.daocloud.io/"] }重新加载docker的配置文件 system…

gitlab-runner执行失败

gitlab runner : ERROR: Job failed: prepare environment https://segmentfault.com/a/1190000044719792 查询相关的站点显示错误的原因是由于gitlab runner执行了用户文件夹下的.bash_logout脚本。 一般的解决方法都是将github-runner用户下的.bash_logout中的内容注释掉即可…

gitlab-cid示例1

default: before_script: - echo "start deploy" - echo $CI_COMMIT_REF_NAME # 阶段stages: - install - buildDev - buildTest - buildProd - deployDev - deployTest - deployProd cache: paths: - node_modules/ # 安装依赖install: stage: i…