diff --git a/concourse/create_iso.sh b/concourse/create_iso.sh index 924d561..b5b89ee 100755 --- a/concourse/create_iso.sh +++ b/concourse/create_iso.sh @@ -22,6 +22,7 @@ GPG_KEY_PASS="$2" GPG_KEY="$3" ENABLE_TESTING=$4 OFFICIAL_RELEASE=$5 +PULP_HOST=$6 if [[ $OFFICIAL_RELEASE -eq 1 ]]; then # Curl the tags and find the latest tag available on github and cut out all the other cruft @@ -54,11 +55,11 @@ echo "-g $GPG_KEY_NAME" echo "-p HIDDEN PASSWORD" echo "-i $GPG_KEY_PATH" echo "-t $ENABLE_TESTING" -echo "-b http://pulp.cyberlab.lan/pulp/repos/centos/7.5/os/" -echo "-e http://pulp.cyberlab.lan/pulp/repos/centos/7.5/extras/" -echo "-E http://pulp.cyberlab.lan/pulp/repos/epel/7/x86_64/" -echo "-u http://pulp.cyberlab.lan/pulp/repos/centos/7.5/updates/" -echo "-l http://pulp.cyberlab.lan/pulp/repos/elastic/6/" +echo "-b http://${PULP_HOST}/pulp/repos/centos/7.5/os/" +echo "-e http://${PULP_HOST}/pulp/repos/centos/7.5/extras/" +echo "-E http://${PULP_HOST}/pulp/repos/epel/7/x86_64/" +echo "-u http://${PULP_HOST}/pulp/repos/centos/7.5/updates/" +echo "-l http://${PULP_HOST}/pulp/repos/elastic/6/" set +x ../master-iso.sh \ @@ -68,9 +69,9 @@ set +x -p "$GPG_KEY_PASS" \ -i "$GPG_KEY_PATH" \ -t "$ENABLE_TESTING" \ --b "http://pulp.cyberlab.lan/pulp/repos/centos/7/os/" \ --e "http://pulp.cyberlab.lan/pulp/repos/centos/7/extras/" \ --E "http://pulp.cyberlab.lan/pulp/repos/epel/7/x86_64/" \ --u "http://pulp.cyberlab.lan/pulp/repos/centos/7/updates/" \ --l "http://pulp.cyberlab.lan/pulp/repos/elastic/7/" \ +-b "http://${PULP_HOST}/pulp/repos/centos/7/os/" \ +-e "http://${PULP_HOST}/pulp/repos/centos/7/extras/" \ +-E "http://${PULP_HOST}/pulp/repos/epel/7/x86_64/" \ +-u "http://${PULP_HOST}/pulp/repos/centos/7/updates/" \ +-l "http://${PULP_HOST}/pulp/repos/elastic/7/" \ -a 'https://packagecloud.io/rocknsm/2_4/el/7/$basearch' diff --git a/concourse/download_minimal_iso.sh b/concourse/download_minimal_iso.sh index 8033e2c..3c674bb 100755 --- a/concourse/download_minimal_iso.sh +++ b/concourse/download_minimal_iso.sh @@ -13,8 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +LOCAL_MIRROR_HOST=$1 + # mkdir mkdir -p centos-minimal-iso # download ISO -curl -sL internal-mirror.cyberlab.lan/upstream/$(curl -L -s internal-mirror.cyberlab.lan/upstream | awk -F '"' '/href.*Minimal/ {print $2}') -o centos-minimal-iso/centos-minimal.iso +curl -sL ${LOCAL_MIRROR_HOST}/upstream/$(curl -L -s ${LOCAL_MIRROR_HOST}/upstream | awk -F '"' '/href.*Minimal/ {print $2}') -o centos-minimal-iso/centos-minimal.iso diff --git a/concourse/pipelines/manual/pipeline.yml b/concourse/pipelines/manual/pipeline.yml index 112f2aa..0601218 100644 --- a/concourse/pipelines/manual/pipeline.yml +++ b/concourse/pipelines/manual/pipeline.yml @@ -34,14 +34,19 @@ jobs: outputs: - name: centos-minimal-iso run: - path: rock-createiso-git/concourse/download_minimal_iso.sh + path: /bin/bash + args: + - '-c' + - 'rock-createiso-git/concourse/download_minimal_iso.sh "$MIRROR_HOST"' + params: + MIRROR_HOST: ((mirror-host)) on_failure: put: RockNSM-Slack params: text: "Concourse Manual failed to build. Could not retrieve a copy of centos minimal iso." username: "Concourse-CI" # icon_url: URL - + - task: ROCK Create ISO config: platform: linux @@ -57,13 +62,14 @@ jobs: path: /bin/bash args: - '-c' - - 'rock-createiso-git/concourse/create_iso.sh "$GPG_KEY_NAME" "$GPG_KEY_PASS" "$GPG_KEY" "$ENABLE_TESTING" "$OFFICIAL_RELEASE"' + - 'rock-createiso-git/concourse/create_iso.sh "$GPG_KEY_NAME" "$GPG_KEY_PASS" "$GPG_KEY" "$ENABLE_TESTING" "$OFFICIAL_RELEASE" "$PULP_HOST"' params: GPG_KEY: ((gpg-key)) GPG_KEY_PASS: ((gpg-passphrase)) GPG_KEY_NAME: ((gpg-key-name)) ENABLE_TESTING: 1 OFFICIAL_RELEASE: 0 + PULP_HOST: ((pulp-host)) on_failure: put: RockNSM-Slack params: diff --git a/concourse/pipelines/nightly/pipeline.yml b/concourse/pipelines/nightly/pipeline.yml index 8c172cd..f420432 100644 --- a/concourse/pipelines/nightly/pipeline.yml +++ b/concourse/pipelines/nightly/pipeline.yml @@ -42,14 +42,19 @@ jobs: outputs: - name: centos-minimal-iso run: - path: rock-createiso-git/concourse/download_minimal_iso.sh + path: /bin/bash + args: + - '-c' + - 'rock-createiso-git/concourse/download_minimal_iso.sh "$MIRROR_HOST"' + params: + MIRROR_HOST: ((mirror-host)) on_failure: put: RockNSM-Slack params: text: "Concourse Nightly failed to build. Could not retrieve a copy of centos minimal iso." username: "Concourse-CI" # icon_url: URL - + - task: ROCK Create ISO config: platform: linux @@ -65,13 +70,14 @@ jobs: path: /bin/bash args: - '-c' - - 'rock-createiso-git/concourse/create_iso.sh "$GPG_KEY_NAME" "$GPG_KEY_PASS" "$GPG_KEY" "$ENABLE_TESTING" "$OFFICIAL_RELEASE"' + - 'rock-createiso-git/concourse/create_iso.sh "$GPG_KEY_NAME" "$GPG_KEY_PASS" "$GPG_KEY" "$ENABLE_TESTING" "$OFFICIAL_RELEASE" "$PULP_HOST"' params: GPG_KEY: ((gpg-key)) GPG_KEY_PASS: ((gpg-passphrase)) GPG_KEY_NAME: ((gpg-key-name)) ENABLE_TESTING: 1 OFFICIAL_RELEASE: 0 + PULP_HOST: ((pulp-host)) on_failure: put: RockNSM-Slack params: diff --git a/concourse/pipelines/prerelease/pipeline.yml b/concourse/pipelines/prerelease/pipeline.yml index d57b644..90f5693 100644 --- a/concourse/pipelines/prerelease/pipeline.yml +++ b/concourse/pipelines/prerelease/pipeline.yml @@ -34,7 +34,12 @@ jobs: outputs: - name: centos-minimal-iso run: - path: rock-createiso-git/concourse/download_minimal_iso.sh + path: /bin/bash + args: + - '-c' + - 'rock-createiso-git/concourse/download_minimal_iso.sh "$MIRROR_HOST"' + params: + MIRROR_HOST: ((mirror-host)) on_failure: put: RockNSM-Slack params: @@ -57,13 +62,14 @@ jobs: path: /bin/bash args: - '-c' - - 'rock-createiso-git/concourse/create_iso.sh "$GPG_KEY_NAME" "$GPG_KEY_PASS" "$GPG_KEY" "$ENABLE_TESTING" "OFFICIAL_RELEASE"' + - 'rock-createiso-git/concourse/create_iso.sh "$GPG_KEY_NAME" "$GPG_KEY_PASS" "$GPG_KEY" "$ENABLE_TESTING" "OFFICIAL_RELEASE" "$PULP_HOST"' params: GPG_KEY: ((gpg-key)) GPG_KEY_PASS: ((gpg-passphrase)) GPG_KEY_NAME: ((gpg-key-name)) ENABLE_TESTING: 0 OFFICIAL_RELEASE: 0 + PULP_HOST: ((pulp-host)) on_failure: put: RockNSM-Slack params: diff --git a/concourse/pipelines/release/pipeline.yml b/concourse/pipelines/release/pipeline.yml index 4fd7fc4..93a4e81 100644 --- a/concourse/pipelines/release/pipeline.yml +++ b/concourse/pipelines/release/pipeline.yml @@ -43,14 +43,19 @@ jobs: outputs: - name: centos-minimal-iso run: - path: rock-createiso-git/concourse/download_minimal_iso.sh + path: /bin/bash + args: + - '-c' + - 'rock-createiso-git/concourse/download_minimal_iso.sh "$MIRROR_HOST"' + params: + MIRROR_HOST: ((mirror-host)) on_failure: put: RockNSM-Slack params: text: "Concourse Official Release failed to build. Could not retrieve a copy of centos minimal iso." username: "Concourse-CI" # icon_url: URL - + - task: ROCK Create ISO config: platform: linux @@ -66,13 +71,14 @@ jobs: path: /bin/bash args: - '-c' - - 'rock-createiso-git/concourse/create_iso.sh "$GPG_KEY_NAME" "$GPG_KEY_PASS" "$GPG_KEY" "$ENABLE_TESTING" "$OFFICIAL_RELEASE"' + - 'rock-createiso-git/concourse/create_iso.sh "$GPG_KEY_NAME" "$GPG_KEY_PASS" "$GPG_KEY" "$ENABLE_TESTING" "$OFFICIAL_RELEASE" "$PULP_HOST"' params: GPG_KEY: ((gpg-key)) GPG_KEY_PASS: ((gpg-passphrase)) GPG_KEY_NAME: ((gpg-key-name)) ENABLE_TESTING: 0 OFFICIAL_RELEASE: 1 + PULP_HOST: ((pulp-host)) on_failure: put: RockNSM-Slack params: diff --git a/concourse/upload.sh b/concourse/upload.sh index 0bf5a50..c5160f8 100755 --- a/concourse/upload.sh +++ b/concourse/upload.sh @@ -18,4 +18,4 @@ chmod 0600 /root/.ssh/* # Upload to local mirror rsync -e "ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_ed25519" -rv rocknsm-iso/ $LOCAL_MIRROR_USER@$LOCAL_MIRROR_HOST:/var/www/mirror/public/isos/$LOCAL_MIRROR_REPO/ # Sync to public mirror -ssh -i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=no admin@mirror.cyberlab.lan 'rsync -rlvtP -e "ssh -i ~/.ssh/mirror_sync" /var/www/mirror/public/ mirror_sync@mirror.rocknsm.io:/var/www/mirror/ --delete' +ssh -i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=no admin@${LOCAL_MIRROR_HOST} 'rsync -rlvtP -e "ssh -i ~/.ssh/mirror_sync" /var/www/mirror/public/ mirror_sync@mirror.rocknsm.io:/var/www/mirror/ --delete'