Coder Social home page Coder Social logo

awx-ee's Introduction

Building environment

apt-get install -y docker.io
apt-get install -y python3-pip
pip install ansible-builder
pip install "https://releases.ansible.com/ansible-tower/cli/ansible-tower-cli-latest.tar.gz"

Configure for building

export GIT_REPO_AWX_EE="https://github.com/Albe83/awx-ee.git"

export DOCKER_HUB_USERNAME="albe83"
export DOCKER_HUB_PASSWORD="xxxx"

export TOWER_HOST="http://127.0.0.1:30080"
export TOWER_USERNAME="admin"
export TOWER_PASSWORD="zzz"

export EE_IMAGE_NAME="custom-awx-ee"
export EE_IMAGE_VERSION_MAJOR="0"
export EE_IMAGE_VERSION_MINOR="0"
export EE_IMAGE_VERSION_PATCH="1"

Prepare for building

git clone "$GIT_REPO_AWX_EE"
cd awx-ee

Build image

export EE_IMAGE_NAME_MAJOR="$EE_IMAGE_NAME:v$EE_IMAGE_VERSION_MAJOR"
export EE_IMAGE_NAME_MINOR="$EE_IMAGE_NAME_MAJOR.$EE_IMAGE_VERSION_MINOR"
export EE_IMAGE_NAME_PATCH="$EE_IMAGE_NAME_MINOR.$EE_IMAGE_VERSION_PATCH"

export EE_IMAGE_FULLNAME="$DOCKER_HUB_USERNAME/$EE_IMAGE_NAME"
export EE_IMAGE_FULLNAME_MAJOR="$DOCKER_HUB_USERNAME/$EE_IMAGE_NAME_MAJOR"
export EE_IMAGE_FULLNAME_MINOR="$DOCKER_HUB_USERNAME/$EE_IMAGE_NAME_MINOR"
export EE_IMAGE_FULLNAME_PATCH="$DOCKER_HUB_USERNAME/$EE_IMAGE_NAME_PATCH"

ansible-builder build \
  --container-runtime docker \
  --prune-images \
  --tag "$EE_IMAGE_FULLNAME_MAJOR" \
  --tag "$EE_IMAGE_FULLNAME_MINOR" \
  --tag "$EE_IMAGE_FULLNAME_PATCH"

Publishing

docker login --username="$DOCKER_HUB_USERNAME" --password="$DOCKER_HUB_PASSWORD"
docker push --all-tags "$EE_IMAGE_FULLNAME"
docker logout

Cleaning up

cd ..
docker rmi "$EE_IMAGE_FULLNAME_MAJOR" "$EE_IMAGE_FULLNAME_MINOR" "$EE_IMAGE_FULLNAME_PATCH"
rm -fR awx-ee

Configure AWX

export AWX_LOGIN_TOKEN_DESC="AWX CLI - $(date "+%Y%m%d%H%M%S%N")"
$(awx login -f human --description "$AWX_LOGIN_TOKEN_DESC")

export AWX_EE_NAME="${EE_IMAGE_NAME^^}"
export AWX_EE_NAME_MAJOR="$AWX_EE_NAME (v$EE_IMAGE_VERSION_MAJOR)"
export AWX_EE_NAME_MINOR="$AWX_EE_NAME (v$EE_IMAGE_VERSION_MAJOR.$EE_IMAGE_VERSION_MINOR)"
export AWX_EE_NAME_PATCH="$AWX_EE_NAME (v$EE_IMAGE_VERSION_MAJOR.$EE_IMAGE_VERSION_MINOR.$EE_IMAGE_VERSION_PATCH)"

awx execution_environments delete "$AWX_EE_NAME_MAJOR"
awx execution_environments delete "$AWX_EE_NAME_MINOR"
awx execution_environments delete "$AWX_EE_NAME_PATCH"

awx execution_environments create --name "$AWX_EE_NAME_MAJOR" --image "$EE_IMAGE_FULLNAME_MAJOR" --pull "always"
awx execution_environments create --name "$AWX_EE_NAME_MINOR" --image "$EE_IMAGE_FULLNAME_MINOR" --pull "always"
awx execution_environments create --name "$AWX_EE_NAME_PATCH" --image "$EE_IMAGE_FULLNAME_PATCH" --pull "always"

awx-ee's People

Contributors

albe83 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.