From f686b725be1644e1be8ddaab1595487f64d97f61 Mon Sep 17 00:00:00 2001 From: s0dy Date: Sun, 18 Nov 2018 15:03:14 +0100 Subject: [PATCH] gitlab-cy.yml --- .ansible-ci.yml | 19 +++++++++++++++++++ .gitlab-ci.yml | 9 +++------ 2 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 .ansible-ci.yml diff --git a/.ansible-ci.yml b/.ansible-ci.yml new file mode 100644 index 0000000..bf7d924 --- /dev/null +++ b/.ansible-ci.yml @@ -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 \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 71ec2dc..4b24eef 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,6 @@ image: ansible/centos7-ansible 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) - eval $(ssh-agent -s) @@ -19,13 +17,12 @@ before_script: deploy_to_webserver: stage: deploy - + only: - master script: - #- mkdir /etc/ansible - echo -e "$ANSIBLE_HIFIVE_HOSTS" > /etc/ansible/hosts - - ansible-playbook ops/ansible/httpd-centos.yml + - ansible-playbook ansible-ci.yml - when: manual + when: manual \ No newline at end of file