#1122 websites: move fedora-websites build to openshift part 2
Merged 2 years ago by kevin. Opened 2 years ago by darknao.
fedora-infra/ darknao/ansible ocp4_website_rsync  into  main

@@ -1,2 +0,0 @@ 

- MAILTO=web-members@fedoraproject.org

- 0 * * * * apache /usr/local/bin/lock-wrapper syncStatic /usr/local/bin/syncStatic

@@ -1,65 +0,0 @@ 

- #!/bin/bash

- # mmcgrath@redhat.com 09-20-2007

- #

- 

- function build {

-     site="$1"

-     err=$(

-         {

-             cd "$site" && \

-             make pullpos && \

-             make && \

-             rsync -qa --delete-after --delay-updates out/ "/srv/web/$site/"; \

-         } 2>&1

-     )

- 

-     rc=$?

-     if [ $rc -ne 0 ]; then

-         echo "$site build failed"

-         echo "===================================="

-         echo "$err"

-         echo

-     fi

- 

-     return $rc;

- }

- 

- if [ ! -d  /srv/web/fedora-websites/.git ]

- then

-     /usr/bin/git clone -q \

-         https://pagure.io/fedora-websites.git \

-         /srv/web/fedora-websites

- fi

- 

- # Freeze the website to prepare beta changes.  On release day, comment the git

- # checkout line below, run this script, and use:

- # sudo func proxy\* call command run "/usr/bin/rsync -a --no-owner --no-group sundries01::fedoraproject.org/* /srv/web/fedoraproject.org/"

- # on puppet1 to update the website.

- #

- # For any other last-minute changes or fixes, make the necessary changes in the

- # fedora-web repo, then run this script and the above func command.

- #

- # Good luck!

- 

- cd /srv/web/fedora-websites

- 

- /usr/bin/git clean -q -fdx || exit 1

- /usr/bin/git reset -q --hard || exit 1

- /usr/bin/git checkout -q main || exit 1

- 

- /usr/bin/git pull -q --ff-only || exit 1

- build labs.fedoraproject.org

- build arm.fedoraproject.org

- build alt.fedoraproject.org

- 

- # Make sure everything else builds from main.

- /usr/bin/git clean -q -fdx || exit 1

- /usr/bin/git reset -q --hard || exit 1

- /usr/bin/git checkout -q main || exit 1

- 

- /usr/bin/git pull -q --ff-only || exit 1

- 

- build flocktofedora.org

- build spins.fedoraproject.org

- build fedoracommunity.org

- build start.fedoraproject.org

@@ -1,65 +0,0 @@ 

- #!/bin/bash

- # mmcgrath@redhat.com 09-20-2007

- #

- 

- function build {

-     site="$1"

-     err=$(

-         {

-             cd "$site" && \

-             make pullpos && \

-             make && \

-             rsync -qa --delete-after --delay-updates out/ "/srv/web/$site/"; \

-         } 2>&1

-     )

- 

-     rc=$?

-     if [ $rc -ne 0 ]; then

-         echo "$site build failed"

-         echo "===================================="

-         echo "$err"

-         echo

-     fi

- 

-     return $rc;

- }

- 

- if [ ! -d  /srv/web/fedora-websites/.git ]

- then

-     /usr/bin/git clone -q \

-         https://pagure.io/fedora-websites.git \

-         /srv/web/fedora-websites

- fi

- 

- # Freeze the website to prepare beta changes.  On release day, comment the git

- # checkout line below, run this script, and use:

- # sudo func proxy\* call command run "/usr/bin/rsync -a --no-owner --no-group sundries01::fedoraproject.org/* /srv/web/fedoraproject.org/"

- # on puppet1 to update the website.

- #

- # For any other last-minute changes or fixes, make the necessary changes in the

- # fedora-web repo, then run this script and the above func command.

- #

- # Good luck!

- 

- cd /srv/web/fedora-websites

- 

- /usr/bin/git clean -q -fdx || exit 1

- /usr/bin/git reset -q --hard || exit 1

- /usr/bin/git checkout -q staging || exit 1

- 

- /usr/bin/git pull -q --ff-only || exit 1

- build labs.fedoraproject.org

- build spins.fedoraproject.org

- build arm.fedoraproject.org

- build alt.fedoraproject.org

- 

- # Make sure everything else builds from main.

- /usr/bin/git clean -q -fdx || exit 1

- /usr/bin/git reset -q --hard || exit 1

- /usr/bin/git checkout -q main || exit 1

- 

- /usr/bin/git pull -q --ff-only || exit 1

- 

- build flocktofedora.org

- build fedoracommunity.org

- build start.fedoraproject.org

@@ -1,3 +1,4 @@ 

+ ---

  - name: Install needed packages

    package:

      state: present
@@ -22,72 +23,66 @@ 

    - fedora-web

  

  - name: Create file to indicate we want live fedimg data

-   copy: dest=/var/fedora_websites_live_fedimg

-         content="Indicator file"

+   copy:

+     dest: /var/fedora_websites_live_fedimg

+     content: "Indicator file"

    tags:

    - fedora-web

  

  - name: Create directories

-   file: state=directory

-         path=/srv/web/{{item}}

-         owner=apache group=apache mode=0755

-         setype=httpd_sys_content_t seuser=system_u

+   file:

+     state: directory

+     path: /srv/web/{{ item }}

+     owner: apache

+     group: apache

+     mode: '0755'

+     setype: httpd_sys_content_t

+     seuser: system_u

    with_items:

    - fedora-web

    - fedoraproject.org

-   - spins.fedoraproject.org

    - talk.fedoraproject.org

-   - start.fedoraproject.org

    - mirrors.fedoraproject.org

-   - fedoracommunity.org

-   - flocktofedora.org

-   - arm.fedoraproject.org

    - iot.fedoraproject.org

-   - labs.fedoraproject.org

    tags:

    - fedora-web

  

  - name: make fmw dir

-   file: state=directory path=/srv/web/fmw owner=apache group=sysadmin-releng mode=2775 setype=httpd_sys_content_t seuser=system_u

+   file:

+     state: directory

+     path: /srv/web/fmw

+     owner: apache

+     group: sysadmin-releng

+     mode: '2775'

+     setype: httpd_sys_content_t

+     seuser: system_u

    tags:

    - fedora-web

    when: env != 'staging'

  

  - name: make fmw dir

-   file: state=directory path=/srv/web/fmw owner=apache group=apache mode=2775 setype=httpd_sys_content_t seuser=system_u

+   file:

+     state: directory

+     path: /srv/web/fmw

+     owner: apache

+     group: apache

+     mode: '2775'

+     setype: httpd_sys_content_t

+     seuser: system_u

    tags:

    - fedora-web

    when: env == 'staging'

  

- - name: Copy syncStatic script (stg)

-   when: env == "staging"

-   copy: >

-     src=syncStatic.stg.sh dest=/usr/local/bin/syncStatic owner=root group=root

-     mode=0755

-   tags:

-   - fedora-web

- 

- - name: Copy syncStatic script (prod)

-   when: env == "production"

-   copy: >

-     src=syncStatic.sh dest=/usr/local/bin/syncStatic owner=root group=root

-     mode=0755

-   tags:

-   - fedora-web

- 

- - name: Install the syncStatic and syncTranslations cronjobs

-   copy: >

-     src={{item}}.cron dest=/etc/cron.d/{{item}}.cron

-     owner=root group=root mode=0644

-   with_items:

-   - syncStatic

+ - name: Remove the syncTranslations cronjob

+   file:

+     path: /etc/cron.d/syncTranslations.cron

+     state: absent

    tags:

-   - fedora-web

    - cron

  

- - name: Remove the syncTranslations cronjob

-   file: 

-     path: /etc/cron.d/syncTranslations.cron

+ - name: Remove the syncStatic cronjob

+   file:

+     path: /etc/cron.d/syncStatic.cron

      state: absent

    tags:

    - cron

@@ -64,7 +64,7 @@ 

  

  [spins.fedoraproject.org]

  comment = spins.fedoraproject.org

- path = /srv/web/spins.fedoraproject.org

+ path = /srv/websites/spins.fedoraproject.org

  uid = root

  gid = root

  read only = yes
@@ -80,7 +80,7 @@ 

  

  [start.fedoraproject.org]

  comment = start.fedoraproject.org

- path = /srv/web/start.fedoraproject.org

+ path = /srv/websites/start.fedoraproject.org

  uid = root

  gid = root

  read only = yes
@@ -96,7 +96,7 @@ 

  

  [fedoracommunity.org]

  comment = fedoracommunity.org

- path = /srv/web/fedoracommunity.org

+ path = /srv/websites/fedoracommunity.org

  uid = root

  gid = root

  read only = yes
@@ -104,7 +104,7 @@ 

  

  [flocktofedora.org]

  comment = flocktofedora.org

- path = /srv/web/flocktofedora.org

+ path = /srv/websites/flocktofedora.org

  uid = root

  gid = root

  read only = yes
@@ -120,7 +120,7 @@ 

  

  [labs.fedoraproject.org]

  comment = labs.fedoraproject.org

- path = /srv/web/labs.fedoraproject.org

+ path = /srv/websites/labs.fedoraproject.org

  uid = root

  gid = root

  read only = yes
@@ -136,7 +136,7 @@ 

  

  [arm.fedoraproject.org]

  comment = arm.fedoraproject.org

- path = /srv/web/arm.fedoraproject.org

+ path = /srv/websites/arm.fedoraproject.org

  uid = root

  gid = root

  read only = yes
@@ -168,7 +168,7 @@ 

  

  [alt.fedoraproject.org]

  comment = alt.fedoraproject.org

- path = /srv/web/alt.fedoraproject.org

+ path = /srv/websites/alt.fedoraproject.org

  uid = root

  gid = root

  read only = yes

Depends on: https://pagure.io/fedora-infra/ansible/pull-request/847

This is the second part of the move.
It removes the cron job from sundries, and reconfigures rsyncd to use the new websites location.

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Could you fix the yamllint issues?

1 new commit added

  • websites: cleanup yamllint issues
2 years ago

Build succeeded.

rebased onto 68d61b8

2 years ago

rebased onto 68d61b8

2 years ago

Pull-Request has been merged by kevin

2 years ago

Build succeeded.