我在Heroku
分支机构的GitHub dev
上有一个应用程序。我正在使用Semaphore
进行持续集成和部署。
当我在Github上推我的dev
分支时,Semaphore
开始工作了,如果一切顺利,我可以点击“ Promote”,将其部署到Heroku
/.semaphore/heroku.yml
文件。
在点击推广之前,我将其保存在~/public
目录中:
升级前的目录内容:
请注意/app/storage/app/public
上的“存储”链接。
在我的~/storage/app/public/images/users
中,我有很多用户头像:
目录中的用户头像列表
现在,我单击“在信号量中升级”。一切顺利:
信号灯正常
但是...促销之后,这就是我在Heroku上的东西...
在~/public
中,我的存储链接已消失:
存储链接消失:
在我的公共存储中,~/storage/app/public
中没有任何目录,所有用户头像(最初在~/storage/app/public/images/users
中)已被删除:
所有内容都不见了:
我认为是因为这些文件不在我的GitHub目录中,这完全正常。
但是我认为Semaphore
正在删除目录中的所有内容,并将所有存在于Github中的文件推送...
我使用git push heroku -f $SEMAPHORE_GIT_BRANCH:master
,这是我的
Heroku.yml文件:
# .semaphore/heroku.yml
version: v1.0
name: Heroku DEV deployment
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
blocks:
- name: Deploy
task:
secrets:
- name: scenario-dev
env_vars:
- name: HEROKU_REMOTE
value: https://git.heroku.com/scenario-dev.git
jobs:
- name: Push code
commands:
- checkout --use-cache
- ssh-keyscan -H heroku.com >> ~/.ssh/known_hosts
- chmod 600 ~/.ssh/id_rsa_semaphore_heroku_dev
- ssh-add ~/.ssh/id_rsa_semaphore_heroku_dev
- git config --global url.ssh://git@heroku.com/.insteadOf https://git.heroku.com/
- git remote add heroku $HEROKU_REMOTE
- git push heroku -f $SEMAPHORE_GIT_BRANCH:master
我想我已经错过了配置文件中的某些内容。谢谢大家的帮助!