-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
110 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Build Ansible Execution Environment Image | ||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- '**' | ||
jobs: | ||
ansible-ee-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
# Without this option, we don't get the tag information | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Initialise the build system | ||
run: | | ||
chmod u+x $GITHUB_WORKSPACE/build/bin/*.sh | ||
$GITHUB_WORKSPACE/build/bin/initbuild.sh | ||
source $GITHUB_WORKSPACE/build/bin/.functions.sh | ||
- name: Build the Ansible execution environment | ||
run: | | ||
$GITHUB_WORKSPACE/build/bin/build-execution-environment.sh | ||
- name: Push the container image | ||
id: docker-push | ||
run: | | ||
docker tag ibmmas/ansible-devops-ee quay.io/ibmmas/ansible-devops-ee:${{ env.DOCKER_TAG }} | ||
docker images | ||
docker login --username "${{ secrets.QUAYIO_USERNAME }}" --password "${{ secrets.QUAYIO_PASSWORD }}" quay.io | ||
docker push quay.io/ibmmas/ansible-devops-ee:${{ env.DOCKER_TAG }} | ||
- name: Push the container image (master) | ||
id: docker-push-master | ||
if: github.ref == 'refs/heads/master' | ||
run: | | ||
docker tag ibmmas/ansible-devops-ee quay.io/ibmmas/ansible-devops-ee:master | ||
docker images | ||
docker push quay.io/ibmmas/ansible-devops-ee:master | ||
- name: Push the container image (latest) | ||
id: docker-push-latest | ||
if: github.event_name == 'release' | ||
run: | | ||
docker tag ibmmas/ansible-devops-ee quay.io/ibmmas/ansible-devops-ee:latest | ||
docker images | ||
docker push quay.io/ibmmas/ansible-devops-ee:latest | ||
--enableRetired | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo_h1 "Ansible Execution Environment Build" | ||
|
||
if [ "$DEV_MODE" != "true" ]; then | ||
source ${GITHUB_WORKSPACE}/build/bin/.env.sh | ||
source ${GITHUB_WORKSPACE}/build/bin/.functions.sh | ||
install_yq_farah | ||
install_ansible_builder | ||
fi | ||
|
||
yq -i "(.collections.[] | select(.name == \"ibm.mas_devops\") | .version)=\"${VERSION}\"" $GITHUB_WORKSPACE/build/ee/requirements.yml | ||
yq -i "(.options.tags.[] |= sub(\"VERSION\"; env(VERSION)))" $GITHUB_WORKSPACE/build/ee/execution-environment.yml | ||
|
||
if [ "${GITHUB_REF_NAME}" == "master" ]; then | ||
yq '(.options.tags += ["ibmmas/ansible-devops-ee:master"])' | ||
fi | ||
|
||
if [ "${GITHUB_REF_TYPE}" == "tag" ]; then | ||
yq '(.options.tags += ["ibmmas/ansible-devops-ee:latest"])' | ||
fi | ||
|
||
echo_h2 "requirements.yml:" | ||
cat $GITHUB_WORKSPACE/build/ee/requirements.yml | ||
echo | ||
echo_h2 "execution-environment.yml:" | ||
cat $GITHUB_WORKSPACE/build/ee/execution-environment.yml | ||
|
||
ansible-build build --file build/ee/execution-environment.yml |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 9 additions & 18 deletions
27
execution-environment.yml → build/ee/execution-environment.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
collections: | ||
- name: ibm.mas_devops | ||
version: "100.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.