- 🌱, Life can be changed.
- 👯, Proactively seek help.
- 💬, Take action.
echo9z / nuxt_blogs Goto Github PK
View Code? Open in Web Editor NEWDevelopment of front-end services based on nuxt3
Home Page: https://echouu.com
License: MIT License
Development of front-end services based on nuxt3
Home Page: https://echouu.com
License: MIT License
想请教的是Drone CI 打包部署时候的.env配置的问题。
假设env文件里有敏感信息,不能写到仓库里。所以也不能写到pipeline里。 nuxt推荐使用.env配置变量。我看到你的项目里也是用了。请问你遇到了这个问题吗,如何处理的?
比如我的env里有四个变量,需要根据不同的环境来配置,假设只有两个环境,本地开发和线上,本地是两个数字,线上是三个数字:
a=11
b=22
c=33
d=44
目前我了解到的解决方案如下:
build-env
a=111
b=222
c=333
d=444
# .drone.yml
kind: pipeline
name: default
steps:
- name: copy-env
image: alpine:latest
environment:
BUILD_ENV:
from_secret: build-env
commands:
- echo -n $BUILD_ENV > .env
- name: build
image: node:18-alpine
commands:
- corepack enable && corepack prepare pnpm@latest --activate
- pnpm -v
- pnpm install
- pnpm build
- pnpm preview
这样每次得到的env文件好像是个空的,项目运行的时候,获取不到需要的env变量。
请问你能给一点意见或者建议吗?谢谢!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.