mirror of
https://github.com/Aviortheking/Blog_IMIE.git
synced 2025-06-14 11:09:19 +00:00
gitlab-cy.yml
This commit is contained in:
19
.ansible-ci.yml
Normal file
19
.ansible-ci.yml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
- hosts: hifive
|
||||||
|
become: yes
|
||||||
|
become_user: root
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Copy all files to web server
|
||||||
|
synchronize:
|
||||||
|
src: /builds/aviortheking/blog_imie/project/
|
||||||
|
dest: /var/www/html
|
||||||
|
rsync_opts:
|
||||||
|
- --exclude=.htaccess
|
||||||
|
|
||||||
|
- name: Change file ownership, group and mode
|
||||||
|
file:
|
||||||
|
path: /var/www/html
|
||||||
|
owner: gitlab
|
||||||
|
group: apache
|
||||||
|
mode: "u=rw,g=r,o=r"
|
||||||
|
recurse: yes
|
@ -1,8 +1,6 @@
|
|||||||
image: ansible/centos7-ansible
|
image: ansible/centos7-ansible
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
#- which ssh-agent || ( apt-get update -qq -y && apt-get -q -y -o Dpkg::Use-Pty=0 install openssh-client )
|
|
||||||
|
|
||||||
# Run ssh-agent (inside the build environment)
|
# Run ssh-agent (inside the build environment)
|
||||||
- eval $(ssh-agent -s)
|
- eval $(ssh-agent -s)
|
||||||
|
|
||||||
@ -19,13 +17,12 @@ before_script:
|
|||||||
|
|
||||||
deploy_to_webserver:
|
deploy_to_webserver:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
|
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
script:
|
script:
|
||||||
#- mkdir /etc/ansible
|
|
||||||
- echo -e "$ANSIBLE_HIFIVE_HOSTS" > /etc/ansible/hosts
|
- echo -e "$ANSIBLE_HIFIVE_HOSTS" > /etc/ansible/hosts
|
||||||
- ansible-playbook ops/ansible/httpd-centos.yml
|
- ansible-playbook ansible-ci.yml
|
||||||
|
|
||||||
when: manual
|
when: manual
|
Reference in New Issue
Block a user