diff --git a/.github/workflows/stage.yml b/.github/workflows/stage.yml new file mode 100644 index 00000000..bbacd1ef --- /dev/null +++ b/.github/workflows/stage.yml @@ -0,0 +1,84 @@ +--- +name: Stage Release +on: + workflow_dispatch: + inputs: + version: + description: 'Version to stage' + required: true + default_awx_version: + description: 'Will be injected as the DEFAULT_AWX_VERSION build arg.' + required: true + confirm: + description: 'Are you sure? Set this to yes.' + required: true + default: 'no' + +jobs: + stage: + runs-on: ubuntu-latest + permissions: + packages: write + contents: write + steps: + - name: Verify inputs + run: | + set -e + + if [[ ${{ github.event.inputs.confirm }} != "yes" ]]; then + >&2 echo "Confirm must be 'yes'" + exit 1 + fi + + if [[ ${{ github.event.inputs.version }} == "" ]]; then + >&2 echo "Set version to continue." + exit 1 + fi + + exit 0 + + - name: Checkout awx + uses: actions/checkout@v2 + with: + repository: ${{ github.repository_owner }}/awx + path: awx + + - name: Checkout awx-operator + uses: actions/checkout@v2 + with: + repository: ${{ github.repository_owner }}/awx-operator + path: awx-operator + + - name: Install playbook dependencies + run: | + python3 -m pip install docker + + - name: Log in to GHCR + run: | + echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + + - name: Build and stage awx-operator + working-directory: awx-operator + run: | + BUILD_ARGS="--build-arg DEFAULT_AWX_VERSION=${{ github.event.inputs.default_awx_version }}" \ + IMAGE_TAG_BASE=ghcr.io/${{ github.repository_owner }}/awx-operator \ + VERSION=${{ github.event.inputs.version }} make docker-build docker-push + + - name: Run test deployment + working-directory: awx-operator + run: | + python3 -m pip install -r molecule/requirements.txt + ansible-galaxy collection install -r molecule/requirements.yml + sudo rm -f $(which kustomize) + make kustomize + KUSTOMIZE_PATH=$(readlink -f bin/kustomize) molecule test -s kind + env: + AWX_TEST_VERSION: ${{ github.event.inputs.default_awx_version }} + + - name: Create draft release + working-directory: awx + run: | + ansible-playbook tools/ansible/stage.yml \ + -e version=${{ github.event.inputs.version }} \ + -e repo=${{ github.repository_owner }}/awx-operator \ + -e github_token=${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 4b95133d..6cf9a2d9 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ awx-operator-controller-manager-66ccd8f997-rhd4z 2/2 Running 0 So we don't have to keep repeating `-n $NAMESPACE`, let's set the current namespace for `kubectl`: ``` -$ kubectl config set-context --current --namespace=$NAMESPACE +$ kubectl config set-context --current --namespace=$NAMESPACE ``` Next, create a file named `awx-demo.yml` with the suggested content below. The `metadata.name` you provide, will be the name of the resulting AWX deployment. @@ -856,46 +856,11 @@ Please visit [our contributing guidelines](https://github.com/ansible/awx-operat ## Release Process -### Update version and files +The first step is to create a draft release. Typically this will happen in the [Stage Release](https://github.com/ansible/awx/blob/devel/.github/workflows/stage.yml) workflow for AWX and you dont need to do it as a separate step. -Update the awx-operator version: +If you need to do an independent release of the operator, you can run the [Stage Release](https://github.com/ansible/awx-operator/blob/devel/.github/workflows/stage.yml) in the awx-operator repo. Both of these workflows will run smoke tests, so there is no need to do this manually. - - `Makefile` - -### Verify Functionality - -Run the following command inside this directory: - -``` -$ IMAGE_TAG_BASE=quay.io//awx-operator make docker-build docker-push -``` - -After it is built, test it on a local cluster: - -``` -$ minikube start --memory 6g --cpus 4 -$ minikube addons enable ingress -$ export NAMESPACE=example-awx -$ make deploy -$ ansible-playbook ansible/instantiate-awx-deployment.yml -e namespace=$NAMESPACE -e image=quay.io//awx -e service_type=nodeport -$ # Verify that the awx-task and awx-web containers are launched -$ # with the right version of the awx image -$ # Launch a job at `minikube service awx-demo-service --url -n $NAMESPACE` -$ minikube delete -``` - -### Update changelog - -Generate a list of commits between the versions and add it to the [changelog](./CHANGELOG.md). -``` -$ git log --no-merges --pretty="- %s (%an) - %h " .. -``` - -### Commit / Create Release - -If everything works, commit the updated version, then [publish a new release](https://github.com/ansible/awx-operator/releases/new) using the same version you used in `ansible/group_vars/all`. - -After creating the release, [this GitHub Workflow](https://github.com/ansible/awx-operator/blob/devel/.github/workflows/release.yaml) will run and publish the new image to quay.io. +After the draft release is created, publish it and the [Promote AWX Operator image](https://github.com/ansible/awx-operator/blob/devel/.github/workflows/promote.yaml) will run, publishing the image to Quay. ## Author