Skip to content

Commit

Permalink
Merge branch 'release/12.4.4-4alvistack4'
Browse files Browse the repository at this point in the history
  • Loading branch information
hswong3i committed Dec 9, 2020
2 parents 4f68153 + 36295ca commit 8c2a35e
Show file tree
Hide file tree
Showing 18 changed files with 61 additions and 52 deletions.
53 changes: 29 additions & 24 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
---

.script-git-submodule: &script-git-submodule
- |
git submodule sync --recursive
git submodule update --init --recursive
.script-bootstrap-packer: &script-bootstrap-packer
- |
curl -skL -O https://github.com/hashicorp/packer/releases/download/nightly/packer_linux_amd64.zip
sudo unzip -qq -o -d /usr/local/bin packer_linux_amd64.zip
rm -rf packer_linux_amd64.zip
.script-bootstrap-docker: &script-bootstrap-docker
- |
curl -skL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Expand All @@ -22,43 +26,44 @@
curl -skL https://bootstrap.pypa.io/get-pip.py | sudo -H python3 - --prefix=/usr/local
sudo -H pip3 install --prefix=/usr/local --upgrade --ignore-installed --requirement requirements.txt
.script-linters: &script-linters
- |
yamllint .
ansible-lint
flake8
.script-packer-build: &script-packer-build
- |
cd packer/$_PACKER_BUILDER_PROVIDER-$_PACKER_BUILDER_VERSION
sudo packer build packer.json
.script-docker-push: &script-docker-push
- |
echo $DOCKER_TOKEN | sudo docker login --username=$DOCKER_USERNAME --password-stdin
export _DOCKER_IMAGE=$(sudo docker images | awk '{print $3}' | awk 'NR==2')
export _DOCKER_REPO=$CI_PROJECT_NAMESPACE/$(echo $CI_PROJECT_NAME | sed 's/^docker-//g')
if [[ -n "$CI_COMMIT_TAG" ]] && [[ "$CI_COMMIT_TAG" =~ ^$PACKER_BUILDER_VERSION ]]; then
sudo docker tag $_DOCKER_IMAGE $_DOCKER_REPO:$CI_COMMIT_TAG
sudo docker push $_DOCKER_REPO:$CI_COMMIT_TAG
sudo docker tag $_DOCKER_IMAGE $_DOCKER_REPO:latest
sudo docker push $_DOCKER_REPO:latest
elif [[ -n "$CI_COMMIT_BRANCH" ]] && [[ "$CI_COMMIT_BRANCH" =~ master ]]; then
sudo docker tag $_DOCKER_IMAGE $_DOCKER_REPO:$_PACKER_BUILDER_VERSION
sudo docker push $_DOCKER_REPO:$_PACKER_BUILDER_VERSION
fi
.job-packer: &job-packer
script:
- *script-bootstrap-packer
- *script-bootstrap-docker
- *script-bootstrap-ansible
- *script-linters
- *script-packer-build
- *script-docker-push

default:
before_script:
- |
git submodule sync --recursive
git submodule update --init --recursive
- |
yamllint .
ansible-lint
flake8
after_script:
- |
echo $DOCKER_TOKEN | sudo docker login --username=$DOCKER_USERNAME --password-stdin
export _DOCKER_IMAGE=$(sudo docker images | awk '{print $3}' | awk 'NR==2')
export _DOCKER_REPO=$CI_PROJECT_NAMESPACE/$(echo $CI_PROJECT_NAME | sed 's/^docker-//g')
if [[ -n "$CI_COMMIT_TAG" ]] && [[ "$CI_COMMIT_TAG" =~ ^$PACKER_BUILDER_VERSION ]]; then
sudo docker tag $_DOCKER_IMAGE $_DOCKER_REPO:$CI_COMMIT_TAG
sudo docker push $_DOCKER_REPO:$CI_COMMIT_TAG
sudo docker tag $_DOCKER_IMAGE $_DOCKER_REPO:latest
sudo docker push $_DOCKER_REPO:latest
elif [[ -n "$CI_COMMIT_BRANCH" ]] && [[ "$CI_COMMIT_BRANCH" =~ master ]]; then
sudo docker tag $_DOCKER_IMAGE $_DOCKER_REPO:$_PACKER_BUILDER_VERSION
sudo docker push $_DOCKER_REPO:$_PACKER_BUILDER_VERSION
fi
- *script-git-submodule

docker-12:
<<: *job-packer
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 12.4.4-XalvistackY - TBC

### Major Changes

## 12.4.4-4alvistack4 - 2020-12-09

### Major Changes

- Migrate from Travis CI to GitLab CI
Expand Down
2 changes: 1 addition & 1 deletion packer/docker-10/packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"provisioners": [
{
"inline": [
"set -ex",
"set -euo pipefail",
"apt-get update",
"apt-get dist-upgrade -y",
"apt-get install -y ca-certificates curl gcc iproute2 python3 python3-dev sudo"
Expand Down
2 changes: 1 addition & 1 deletion packer/docker-11/packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"provisioners": [
{
"inline": [
"set -ex",
"set -euo pipefail",
"apt-get update",
"apt-get dist-upgrade -y",
"apt-get install -y ca-certificates curl gcc iproute2 python3 python3-dev sudo"
Expand Down
2 changes: 1 addition & 1 deletion packer/docker-12/packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"provisioners": [
{
"inline": [
"set -ex",
"set -euo pipefail",
"apt-get update",
"apt-get dist-upgrade -y",
"apt-get install -y ca-certificates curl gcc iproute2 python3 python3-dev sudo"
Expand Down
6 changes: 3 additions & 3 deletions playbooks/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

- name: purge /var/lib/postgresql/data
shell: |
set -o pipefail
set -euo pipefail
mkdir -p /var/lib/postgresql/data
find /var/lib/postgresql/data -mindepth 1 -delete
args:
Expand All @@ -102,7 +102,7 @@

- name: re-create /var/run/postgresql
shell: |
set -o pipefail
set -euo pipefail
rm -rf /var/run/postgresql
mkdir -p /var/run/postgresql
chown -Rf postgres:postgres /var/run/postgresql
Expand All @@ -128,7 +128,7 @@

- name: "prepare /usr/share/postgresql/postgresql.conf.sample"
shell: |
set -o pipefail
set -euo pipefail
mv /usr/share/postgresql/{{ postgres_release }}/postgresql.conf.sample /usr/share/postgresql/
ln -s ../postgresql.conf.sample /usr/share/postgresql/{{ postgres_release }}/postgresql.conf.sample
args:
Expand Down
16 changes: 8 additions & 8 deletions playbooks/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,38 @@
tasks:
- name: cp -rfT /etc/skel /root
raw: |
set -ex
set -euo pipefail
cp -rfT /etc/skel /root
changed_when: false
ignore_errors: true

- name: setenforce 0
raw: |
set -ex
set -euo pipefail
setenforce 0
sed -i 's/^SELINUX=.*$/SELINUX=permissive/g' /etc/selinux/config
changed_when: false
ignore_errors: true

- name: systemctl stop firewalld.service
raw: |
set -ex
set -euo pipefail
systemctl stop firewalld.service
systemctl disable firewalld.service
changed_when: false
ignore_errors: true

- name: systemctl stop ufw.service
raw: |
set -ex
set -euo pipefail
systemctl stop ufw.service
systemctl disable ufw.service
changed_when: false
ignore_errors: true

- name: redhat | subscription-manager register
raw: |
set -ex
set -euo pipefail
subscription-manager register \
--username={{ lookup('env', 'REDHAT_USERNAME') }} \
--password={{ lookup('env', 'REDHAT_PASSWORD') }} \
Expand All @@ -62,7 +62,7 @@

- name: debian | apt-get install -y ca-certificates curl gcc iproute2 python3 python3-dev sudo
raw: |
set -ex
set -euo pipefail
apt-get update
apt-get dist-upgrade -y
apt-get install -y ca-certificates curl gcc iproute2 python3 python3-dev sudo
Expand All @@ -71,7 +71,7 @@

- name: redhat | yum install -y ca-certificates curl gcc iproute python3 python3-devel sudo
raw: |
set -ex
set -euo pipefail
yum makecache
yum update -y
yum install -y ca-certificates curl gcc iproute python3 python3-devel sudo
Expand All @@ -80,7 +80,7 @@

- name: suse | zypper -n install -y ca-certificates curl gcc iproute2 python3 python3-devel sudo
raw: |
set -ex
set -euo pipefail
zypper -n --gpg-auto-import-keys refresh
zypper -n update -y
zypper -n install -y ca-certificates curl gcc iproute2 python3 python3-devel sudo
Expand Down
8 changes: 4 additions & 4 deletions playbooks/side_effect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
tasks:
- name: rm -rf /root/.ansible/tmp/*
raw: |
set -ex
set -euo pipefail
rm -rf /root/.ansible/tmp/*
rm -rf /root/.cache/*
rm -rf /tmp/*
Expand All @@ -30,7 +30,7 @@

- name: debian | apt-get -y autoclean
raw: |
set -ex
set -euo pipefail
apt-get -y autoremove
apt-get -y autoclean
rm -rf /var/lib/apt/lists/*
Expand All @@ -39,15 +39,15 @@

- name: redhat | yum clean all
raw: |
set -ex
set -euo pipefail
yum clean all
rm -rf /var/cache/yum/*
changed_when: false
ignore_errors: true

- name: suse | zypper clean --all
raw: |
set -ex
set -euo pipefail
zypper clean --all
rm -rf /var/cache/zypper/*
changed_when: false
Expand Down
2 changes: 1 addition & 1 deletion scripts/bootstrap-ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -o xtrace
set -euo pipefail

cd "$(cd "$(dirname "$0")"; pwd -P)/../"

Expand Down
2 changes: 1 addition & 1 deletion scripts/bootstrap-libvirt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -o xtrace
set -euo pipefail

cd "$(cd "$(dirname "$0")"; pwd -P)/../"

Expand Down
2 changes: 1 addition & 1 deletion scripts/bootstrap-vagrant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -o xtrace
set -euo pipefail

cd "$(cd "$(dirname "$0")"; pwd -P)/../"

Expand Down
2 changes: 1 addition & 1 deletion scripts/run-build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -o xtrace
set -euo pipefail

DIR=$(dirname "$(readlink -f "$0")")

Expand Down

0 comments on commit 8c2a35e

Please sign in to comment.