gitlab自动部署-runner的配置和使用

2022-07-13 22:15:00 by wst

服务部署

经过一天的探索,在gitlab上自动部署项目终于搞定。具体情况如下:

目标

类似上一篇文章中,提交完代码后自动构建、自动部署。在gitlab中是通过runner实现的,runner可以理解为Jenkins中的agent。

步骤

前提: 已经安装runner, 且执行器类型为docker;

1. 安装并注册runner, 具体见官方文档

2. 创建一个vue项目,如:vue_todolist;

3. 配置CI。点击项目首页的“CI/CD configuration”按钮;

4. 把如下内容粘贴进去:

image: node:12.16.1

cache:
    paths:
      - node_modules/

stages:
  - deploy

publish_package:
  stage: deploy

  before_script:
    # Create the SSH directory and give it the right permissions
    - mkdir -p ~/.ssh
    - chmod 700 ~/.ssh
    - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
    - chmod 600 ~/.ssh/id_rsa
  tags:
    - t
  script:
    - npm install
    - npm run build
  after_script:
    - scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r $SOURCE_DIR $USER@$HOST:$TARGET_DIR

此时提交会报错,(右键点击打开新页面操作)需要设置下项目变量才能正确执行。

5. 设置项目变量。

1)设置之前,先找个地方生成一对公钥/私钥,找个Linux机器,ssh-keygen命令即可生成,记得不要设置密码。

2)在项目首页的左边,点击“settings->CI/CD->Variables->Expand”,把相应变量填进去,如图所示:

6. 在第四步页面的下面点击"Commit changes", 提交这个配置文件(.gitlab-ci.yml)。

7. 点击页面左边的“CI/CD->Jobs”,可查看任务运行状况。

总结

有几个难点:

1. 怎么通过ssh的方式(认证部分尤其要注意)把代码拷贝到目标服务器;

2. 怎么安装合适的runner,并构建项目代码;

 

如有问题,欢迎探讨v:wst_ccut。


Comments(130) Add Your Comment

Kmxmck
generic lipitor 20mg <a href="https://lipiws.top/">atorvastatin 80mg over the counter</a> buy atorvastatin without prescription
Gtikdg
buy generic baycip - <a href="https://metroagyl.top/azithromycin/">augmentin 1000mg ca</a> augmentin online order
Kujcne
oral baycip - <a href="https://cipropro.top/augmentin500/">clavulanate without prescription</a> buy generic clavulanate for sale
Zygdbf
flagyl order online - <a href="https://metroagyl.top/keflexcapsule/">amoxicillin cheap</a> zithromax cheap
Hxzxuj
buy ciprofloxacin 500mg generic - <a href="https:/septrim.top/">buy ciprofloxacin 500mg without prescription</a> erythromycin 250mg tablet
Shrwnx
brand valtrex 1000mg - <a href="https://gnantiviralp.com/">buy cheap valacyclovir</a> acyclovir 800mg price
Riuwnb
stromectol tablets buy online - <a href="https://keflexin.top/aczone/">buy aczone gel for sale</a> tetracycline over the counter
Ulngvq
order generic metronidazole - <a href="https://metroagyl.top/cefaclor/">cefaclor 250mg usa</a> azithromycin 500mg over the counter
Ibjbda
buy acillin online cheap <a href="https://ampiacil.top/doxycyclineantb/">order generic vibra-tabs</a> cheap amoxicillin pill
Amifwz
furosemide order - <a href="https://antipathogenc.com/minipressm/">order prazosin 1mg pills</a> buy captopril pills for sale
Skhshj
glycomet pills - <a href="https://gnantiacidity.com/septra/">order bactrim online</a> lincomycin where to buy
Fqmdys
order zidovudine 300mg sale - <a href="https://canadiangnp.com/allopurinol/">purchase zyloprim pill</a> allopurinol 100mg sale
Vdessl
order clozapine 50mg without prescription - <a href="https://genonlinep.com/">buy clozapine 100mg generic</a> pepcid tablet
Xthvda
buy generic seroquel 50mg - <a href="https://gnkantdepres.com/bupron/">buy bupropion online</a> buy eskalith pills
Qobicb
order generic atarax - <a href="https://antdepls.com/pamelor/">pamelor 25mg oral</a> endep 10mg generic
Lmoctq
order clomipramine pills - <a href="https://antdeponline.com/sinequan/">buy sinequan cheap</a> buy sinequan 25mg without prescription
Oyjpcp
brand amoxicillin - <a href="https://atbioxotc.com/ceftin/">axetil for sale</a> buy generic cipro online
Pwgmji
amoxiclav cost - <a href="https://atbioinfo.com/linezolid/">buy linezolid generic</a> baycip online order
Bwzulz
buy cleocin pills - <a href="https://cadbiot.com/chloramphenicol/">chloramphenicol online buy</a> buy chloromycetin pills for sale
Folcyj
order azithromycin 500mg generic - <a href="https://gncatbp.com/ctinidazole/">buy tindamax pill</a> ciplox 500mg drug
Xhrqwb
albuterol tablet - <a href="https://antxallergic.com/cvallegra/">how to get allegra without a prescription</a> theo-24 Cr 400 mg ca
Rraytg
buy ivermectin stromectol - <a href="https://antibpl.com/szdoryx/">cheap doxycycline online</a> cefaclor online
Irkjvb
buy desloratadine 5mg online - <a href="https://rxtallerg.com/ventolinpill/">albuterol online buy</a> brand ventolin
Tcxqae
medrol 8 mg without prescription - <a href="https://ntallegpl.com/getcetirizine/">zyrtec cost</a> order generic azelastine
Dypmqq
order generic micronase - <a href="https://prodeprpl.com/">glyburide sale</a> forxiga 10mg over the counter
Haltbr
buy prandin 2mg online - <a href="https://depressinfo.com/jardiance25/">jardiance usa</a> buy empagliflozin no prescription
Vtkoqw
order glucophage 1000mg generic - <a href="https://arxdepress.com/acarbose50/">buy precose 25mg generic</a> buy acarbose online
Ukxcpw
where to buy terbinafine without a prescription - <a href="https://treatfungusx.com/fulvicin250mg/">buy griseofulvin pills</a> buy grifulvin v online
Zrtume
order semaglutide online cheap - <a href="https://infodeppl.com/">semaglutide 14mg tablet</a> desmopressin for sale online
Vawzfk
cost ketoconazole 200mg - <a href="https://antifungusrp.com/">ketoconazole tablet</a> order itraconazole 100 mg online
Lfvliz
digoxin online buy - <a href="https://blpressureok.com/trandate100/">cost labetalol 100 mg</a> buy lasix for sale diuretic
Akfdnb
famciclovir 250mg tablet - <a href="https://amvinherpes.com/acyclovircream/">acyclovir 800mg without prescription</a> valcivir 1000mg oral
Zauthi
order hydrochlorothiazide 25 mg generic - <a href="https://norvapril.com/lisinopril/">lisinopril 5mg generic</a> buy bisoprolol 5mg online cheap
Tqmbrs
lopressor order online - <a href="https://bloodpresspl.com/olmesartan/">buy benicar 10mg online cheap</a> order nifedipine for sale
Hnahzs
nitroglycerin price - <a href="https://nitroproxl.com/">nitroglycerin price</a> order diovan 80mg without prescription
Cwyfwo
rosuvastatin den - <a href="https://antcholesterol.com/ezetimibe/">ezetimibe online genius</a> caduet buy ankh
Oimbff
zocor listen - <a href="https://canescholest.com/fenofibrate/">tricor despair</a> atorvastatin web
Nuncky
viagra professional online seem - <a href="https://edsildps.com/superavana/">super avana pack</a> levitra oral jelly online hold
Trrhhh
dapoxetine decent - <a href="https://promedprili.com/zudena/">udenafil shed</a> cialis with dapoxetine license
Lvpdhk
cenforce mouse - <a href="https://xcenforcem.com/cialistadalafil/">cialis price</a> brand viagra online sharp
Soozmt
brand cialis fortune - <a href="https://probrandtad.com/penisole/">penisole plant</a> penisole marry
Xtkpac
cialis soft tabs online accident - <a href="https://supervalip.com/cavertapills/">caverta online orange</a> viagra oral jelly chapter
Tuwokp
brand cialis quill - <a href="https://probrandtad.com/viagrasofttabs/">viagra soft tabs boy</a> penisole nephew
Uotoar
cialis soft tabs online smooth - <a href="https://supervalip.com/valifonline/">valif begin</a> viagra oral jelly online oh
Kvrvaq
cenforce which - <a href="https://xcenforcem.com/zenegrasildenafil/">zenegra astonishment</a> brand viagra breast
Chdkop
priligy chest - <a href="https://promedprili.com/zudena/">zudena then</a> cialis with dapoxetine ice
Ecatvt
acne treatment market - <a href="https://placnemedx.com/">acne medication crouch</a> acne medication somewhere
Yfqhoe
asthma treatment hell - <a href="https://bsasthmaps.com/">asthma medication quality</a> asthma treatment partner
Ysxfxs
uti antibiotics hasty - <a href="https://amenahealthp.com/">treatment for uti library</a> uti treatment club
Bgcxso
prostatitis medications dust - <a href="https://xprosttreat.com/">prostatitis medications cup</a> pills for treat prostatitis insect
Ravvxk
valtrex screen - <a href="https://gnantiviralp.com/">valacyclovir online seat</a> valacyclovir pills sacrifice
Dgwvsw
loratadine medication extent - <a href="https://clatadine.top/">claritin pills rate</a> claritin singular
Jwakpq
claritin pills speak - <a href="https://clatadine.top/">claritin pills salt</a> claritin hotel
Gcbotb
priligy frantic - <a href="https://prilixgn.top/">dapoxetine sweat</a> priligy older
Paflkg
promethazine existence - <a href="https://prohnrg.com/">promethazine chuckle</a> promethazine singular
Bkvyzl
ascorbic acid squint - <a href="https://ascxacid.com/">ascorbic acid don</a> ascorbic acid net
Pojpze
fludrocortisone pills band - <a href="https://gastroplusp.com/omepprilosec/">prilosec laugh</a> prevacid stable
Dubhgd
biaxin smile - <a href="https://gastropls.com/gncytotec/">cytotec pills famous</a> cytotec pills england
Umvvof
buy bisacodyl 5 mg sale - <a href="https://gastroinfop.com/liv52/">buy liv52 10mg pills</a> buy liv52 cheap
Tksrnx
aciphex 10mg drug - <a href="https://gastrointesl.com/">buy rabeprazole for sale</a> order domperidone 10mg without prescription
Hudrim
buy bactrim pills - <a href="https://tobmycin.com/">buy tobra 10mg</a> tobrex ca
Gekqat
cheap eukroma - <a href="https://danaterone.shop/">purchase zovirax online cheap</a> brand dydrogesterone 10mg
Vqzbst
brand forxiga 10mg - <a href="https://forpaglif.com/">generic dapagliflozin 10mg</a> order generic acarbose 25mg
Ofdeei
griseofulvin price - <a href="https://dipyrilx.com/">buy dipyridamole pills</a> brand lopid 300 mg
Dyvqdy
order vasotec 5mg for sale - <a href="https://vasolapril.com/">enalapril 5mg canada</a> purchase xalatan sale
Pkrrkp
buy dramamine without a prescription - <a href="https://prasilx.com/">buy prasugrel 10mg online</a> buy risedronate paypal
Ndsmey
buy piroxicam - <a href="https://rivastilons.com/">exelon 6mg pills</a> order rivastigmine
Ugstje
monograph 600mg cheap - <a href="https://cilosetal.com/">cilostazol 100 mg oral</a> buy cilostazol pills for sale
Uklrbt
hydrea order - <a href="https://hydroydrinfo.com/methocarbamol/">order robaxin 500mg generic</a> how to get methocarbamol without a prescription
Mgbfvz
buy generic piracetam - <a href="https://nootquin.com/praziquantel/">purchase biltricide pills</a> sinemet 10mg us
Rujqdy
cheap generic disopyramide phosphate - <a href="https://anorpica.com/lamotrigine/">buy lamictal 200mg pills</a> buy thorazine 100mg for sale
Fngofq
buy divalproex 250mg online - <a href="https://adepamox.com/">order depakote 250mg generic</a> buy topiramate no prescription
Niyeye
cytoxan over the counter - <a href="https://cycloxalp.com/atomoxetine/">strattera 10mg cheap</a> vastarel uk
Wfnrtu
buy spironolactone 100mg - <a href="https://aldantinep.com/">cheap aldactone 25mg</a> order generic naltrexone 50 mg
Pmkiva
flexeril 15mg oral - <a href="https://abflequine.com/primaquine/">primaquine order online</a> buy vasotec medication
Sdyyps
how to get ondansetron without a prescription - <a href="https://azofarininfo.com/tolterodine/">order generic detrol</a> oral ropinirole 2mg
Axevlf
cheap ascorbic acid 500mg - <a href="https://mdacidinfo.com/">ascorbic acid 500mg us</a> compro pill
Hcgfvp
buy durex gel cheap - <a href="https://xalaplinfo.com/durexcondoms/">purchase durex condoms for sale</a> zovirax where to buy
Vsqoxx
arava order - <a href="https://infohealthybones.com/cartidin/">cartidin for sale</a> how to buy cartidin
Dfghtw
rogaine over the counter - <a href="https://hairlossmedinfo.com/finasteridepros/">proscar pills</a> purchase finpecia sale
Gbqqrg
order generic atenolol - <a href="https://heartmedinfox.com/clopidogrel/">clopidogrel 75mg cheap</a> order carvedilol without prescription
Sqlzaf
order calan generic - <a href="https://infoheartdisea.com/cardizem/">purchase diltiazem pill</a> buy tenoretic online cheap
Wtzdbf
cost atorlip - <a href="https://infoxheartmed.com/lisinopril/">purchase zestril for sale</a> buy nebivolol for sale
Tklgvv
lasuna for sale online - <a href="https://infoherbalmz.com/diarex/">cheap diarex online</a> buy himcolin medication
Dmcekc
buy generic speman - <a href="https://spmensht.com/finasteride/">buy cheap generic finasteride</a> cheap fincar sale
Dkycvv
order noroxin pill - <a href="https://gmenshth.com/">norfloxacin order online</a> order confido online
Gzchqq
finasteride without prescription - <a href="https://finmenura.com/doxazosin/">doxazosin tablets</a> uroxatral 10 mg pill
Rzqdjz
terazosin 5mg uk - <a href="https://hymenmax.com/tamsulosin/">flomax online order</a> buy dapoxetine 30mg
Xwfdbc
generic trileptal - <a href="https://trileoxine.com/pirfenidone/">cheap generic pirfenidone</a> levothyroxine tablets
Ofeunj
buy duphalac - <a href="https://duphalinfo.com/">buy duphalac without a prescription</a> betahistine 16mg without prescription
Yjxsxo
cyclosporine generic - <a href="https://asimusxate.com/gloperba/">order colchicine 0.5mg online cheap</a> buy colcrys 0.5mg
Boxbzc
buy calcort pills for sale - <a href="https://lazacort.com/brimonidine/">buy generic alphagan for sale</a> how to buy brimonidine
Lteqnd
how to buy gabapentin - <a href="https://aneutrin.com/sulfasalazine/">order sulfasalazine online</a> buy sulfasalazine 500mg pills
Vrlsva
buy besifloxacin generic - <a href="https://besifxcist.com/">order besivance for sale</a> buy sildamax pills
Gwynyu
buy generic benemid over the counter - <a href="https://bendoltol.com/monograph/">buy etodolac 600mg online</a> buy carbamazepine 200mg for sale
Yeirrb
purchase celebrex for sale - <a href="https://celespas.com/flavoxate/">where can i buy urispas</a> indomethacin 75mg price
Zidzqh
diclofenac 100mg uk - <a href="https://dicloltarin.com/">cambia ca</a> buy aspirin 75mg online
Zqdtcg
buy rumalaya paypal - <a href="https://rumaxtol.com/">purchase rumalaya</a> generic elavil 10mg
Mwcivp
buy mestinon 60 mg for sale - <a href="https://mestonsx.com/asumatriptan/">imitrex 50mg over the counter</a> azathioprine 50mg cheap
Ojyvtp
lioresal uk - <a href="https://baclion.com/nspiroxicam/">how to buy piroxicam</a> how to get piroxicam without a prescription
Rifoub
voveran pill - <a href="https://vovetosa.com/tisosorbide/">buy isosorbide 40mg online cheap</a> order nimotop online
Msoyce
order cyproheptadine - <a href="https://periheptadn.com/">buy periactin 4mg sale</a> order generic tizanidine
Pytuol
meloxicam cheap - <a href="https://meloxiptan.com/asrizatriptan/">rizatriptan buy online</a> buy generic toradol
Bkurko
cefdinir 300mg drug - <a href="https://omnixcin.com/aminocycline/"></a> cleocin over the counter
Mwnlpt
cost artane - <a href="https://voltapll.com.com/">order trihexyphenidyl online cheap</a> order voltaren gel online cheap
Zoihfn
accutane sale - <a href="https://aisotane.com/asavlosulfon/">order dapsone 100mg generic</a> buy deltasone 40mg pill
Iizkqj
cheap permethrin - <a href="https://actizacs.com/tretinoin/">order retin cream for sale</a> cheap tretinoin cream
Tbwffk
betnovate 20 gm usa - <a href="https://betnoson.com/awdifferin/">buy differin no prescription</a> benoquin without prescription
Upabic
buy flagyl 200mg online - <a href="https://cenforcevs.com/">buy generic cenforce over the counter</a> buy cheap cenforce
Xailmv
losartan where to buy - <a href="https://cozartan.com/">buy losartan 25mg generic</a> cephalexin 125mg for sale
Syeqqa
buy cleocin 300mg - <a href="https://indometnp.com/">order indocin 50mg pills</a> buy indocin 50mg capsule
Ygcyrp
buy crotamiton paypal - <a href="https://aeuracream.com/abactroban/">order mupirocin for sale</a> buy aczone generic
Hgpsfe
order modafinil 200mg sale - <a href="https://sleepagil.com/phenergan/">purchase promethazine</a> meloset 3mg tablet
Pkmibz
zyban 150mg tablet - <a href="https://bupropsl.com/ayurslim/">ayurslim cost</a> buy cheap generic shuddha guggulu
Fdqxnz
buy xeloda 500mg online cheap - <a href="https://xelocap.com/naproxen/">order naproxen 500mg generic</a> buy danazol 100 mg without prescription
Hsutij
progesterone 200mg cost - <a href="https://apromid.com/clomiphene/">buy clomid 100mg for sale</a> fertomid cheap
Njcltq
purchase alendronate pills - <a href="https://pilaxmax.com/tamoxifen/">order nolvadex 10mg</a> purchase provera for sale
Szfowm
buy aygestin 5 mg online - <a href="https://norethgep.com/">order norethindrone 5 mg</a> order yasmin sale
Ofgamp
yasmin for sale online - <a href="https://festrolp.com/ginette-35/">order ginette 35 sale</a> arimidex 1mg canada
Xjcvbv
buy dostinex without a prescription - <a href="https://adostilin.com/alesse/">alesse pills</a> buy alesse without a prescription
Dndhfq
гѓ—гѓ¬гѓ‰гѓ‹гѓі гЃ®иіје…Ґ - <a href="https://jpaonlinep.com/jamoxicillin/">г‚ўгѓўг‚­г‚·г‚·гѓЄгѓійЊ  250mg еј·гЃ•</a> г‚ёг‚№гѓ­гѓћгѓѓг‚ЇгЃ®йЈІгЃїж–№гЃЁеЉ№жћњ
Gvxuqq
シルデナフィル 値段 - <a href="https://jpedpharm.com/tadalafil/">タダラフィル処方</a> シアリス 薬局で買える
Tuovop
プレドニンの購入 - <a href="https://jpanfarap.com/jpadoxycycline/">ドキシサイクリン通販</a> イソトレチノイン 薬局で買える
Cbgrkv
eriacta pool - <a href="https://eriagra.com/szenegrag/">zenegra online hunt</a> forzest cheap
Rlhjxy
valif broad - <a href="https://avaltiva.com/">valif pills scrooge</a> order sinemet 20mg for sale
Cmxcqp
indinavir online order - <a href="https://confindin.com/fincar/">purchase fincar pill</a> order diclofenac gel
Xkpsyx
valif pills demon - <a href="https://avaltiva.com/tysecnidazolef/">order generic secnidazole</a> buy cheap sinemet
Sliaok
buy provigil pills for sale - <a href="https://provicef.com/lamivudine/">purchase epivir pill</a> generic lamivudine
Phyvfi
purchase promethazine without prescription - <a href="https://prometacin.com/jilincomycin/">lincocin 500mg oral</a> lincomycin for sale online
Yigfaq
buy ivermectin stromectol - <a href="https://ivercand.com/carbamazepine/">tegretol 200mg brand</a> tegretol uk