From 1ee863dcd7b2c7e523a89ab5b1c6e471e7a53918 Mon Sep 17 00:00:00 2001 From: James Struga Date: Sun, 11 Jul 2021 23:36:50 -0400 Subject: [PATCH 1/7] Automate releasing app-server component --- .github/workflows/blank.yml | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/blank.yml diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml new file mode 100644 index 0000000..a4b55d0 --- /dev/null +++ b/.github/workflows/blank.yml @@ -0,0 +1,41 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the staging branch + push: + branches: [ staging ] + pull_request: + branches: [ staging ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: Run a one-line script + run: echo Hello, world! + + # Runs a set of commands using the runners shell + - name: Run a multi-line script + run: | + cd container + chmod +x *.sh + ./pull-zowe-install-artifacts.sh + ./download-zlux.sh + ./build.sh + echo Add other actions to build, + echo test, and deploy your project. From 5351b5736dc154c783580448e80fb1264468546d Mon Sep 17 00:00:00 2001 From: James Struga Date: Mon, 12 Jul 2021 14:43:01 -0400 Subject: [PATCH 2/7] missing credentials Signed-off-by: James Struga --- .github/workflows/{blank.yml => docker.yml} | 17 +++++++++++------ container/build.sh | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) rename .github/workflows/{blank.yml => docker.yml} (76%) diff --git a/.github/workflows/blank.yml b/.github/workflows/docker.yml similarity index 76% rename from .github/workflows/blank.yml rename to .github/workflows/docker.yml index a4b55d0..d7dc08c 100644 --- a/.github/workflows/blank.yml +++ b/.github/workflows/docker.yml @@ -19,15 +19,20 @@ jobs: build: # The type of runner that the job will run on runs-on: ubuntu-latest - + # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 + - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! + - name: Login Jfrog + uses: docker/login-action@v1 + with: + registry: zowe.jfrog.io + username: ${{ secrets.JFROG_USER_WRITER }} + password: ${{ secrets.JFROG_PASSWORD_WRITER }} + # Runs a set of commands using the runners shell - name: Run a multi-line script @@ -37,5 +42,5 @@ jobs: ./pull-zowe-install-artifacts.sh ./download-zlux.sh ./build.sh - echo Add other actions to build, - echo test, and deploy your project. + docker push zowe-docker-snapshot.jfrog.io/ompzowe/app-server:testing + \ No newline at end of file diff --git a/container/build.sh b/container/build.sh index a80efd3..32ef559 100644 --- a/container/build.sh +++ b/container/build.sh @@ -14,4 +14,4 @@ mkdir -p logs docker pull node:12 -docker build --pull -f Dockerfile.zlux --no-cache --progress=plain -t ompzowe/app-server:testing . 2>&1 | tee logs/docker-build.log \ No newline at end of file +docker build --pull -f Dockerfile.zlux --no-cache --progress=plain -t zowe-docker-snapshot.jfrog.io/ompzowe/app-server:testing . 2>&1 | tee logs/docker-build.log \ No newline at end of file From acc35439e81de261f6fb8dea6392b42fb38b118d Mon Sep 17 00:00:00 2001 From: James Struga Date: Mon, 12 Jul 2021 14:58:52 -0400 Subject: [PATCH 3/7] added credentials Signed-off-by: James Struga --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d7dc08c..d88f860 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -30,8 +30,8 @@ jobs: uses: docker/login-action@v1 with: registry: zowe.jfrog.io - username: ${{ secrets.JFROG_USER_WRITER }} - password: ${{ secrets.JFROG_PASSWORD_WRITER }} + username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} # Runs a set of commands using the runners shell From d271ae405eb71ed613f3c2a3f9c7f15cd3e146d7 Mon Sep 17 00:00:00 2001 From: James Struga Date: Mon, 12 Jul 2021 17:35:14 -0400 Subject: [PATCH 4/7] changed registry Signed-off-by: James Struga --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d88f860..57da1f6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -29,7 +29,7 @@ jobs: - name: Login Jfrog uses: docker/login-action@v1 with: - registry: zowe.jfrog.io + registry: zowe-docker-snapshot.jfrog.io username: ${{ secrets.ARTIFACTORY_USERNAME }} password: ${{ secrets.ARTIFACTORY_PASSWORD }} From a29189a61311678d07853dfed5be8a2a1398da8a Mon Sep 17 00:00:00 2001 From: James Struga Date: Tue, 13 Jul 2021 00:26:52 -0400 Subject: [PATCH 5/7] Update docker.yml --- .github/workflows/docker.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 57da1f6..310e15e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -34,13 +34,17 @@ jobs: password: ${{ secrets.ARTIFACTORY_PASSWORD }} - # Runs a set of commands using the runners shell - - name: Run a multi-line script + + - name: build and push image run: | cd container chmod +x *.sh ./pull-zowe-install-artifacts.sh - ./download-zlux.sh + ./download-zlux.sh + cd files + IMAGE_VERSION=$(grep -Po '"version": *\K"[^"]*"' manifest.json | head -n1) + cd .. ./build.sh - docker push zowe-docker-snapshot.jfrog.io/ompzowe/app-server:testing - \ No newline at end of file + docker tag zowe-docker-snapshot.jfrog.io/ompzowe/app-server:testing zowe-docker-snapshot.jfrog.io/ompzowe/app-server:$IMAGE_VERSION + docker push zowe-docker-snapshot.jfrog.io/ompzowe/app-server:$IMAGE_VERSION + From d6c1a65f727454a0b9054daebc2e2a35e7209fc5 Mon Sep 17 00:00:00 2001 From: James Struga Date: Tue, 13 Jul 2021 00:41:45 -0400 Subject: [PATCH 6/7] Update docker.yml --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 310e15e..f3ae402 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -43,6 +43,7 @@ jobs: ./download-zlux.sh cd files IMAGE_VERSION=$(grep -Po '"version": *\K"[^"]*"' manifest.json | head -n1) + IMAGE_VERSION=`echo $IMAGE_VERSION | sed 's/.\(.*\)/\1/' | sed 's/\(.*\)./\1/'` cd .. ./build.sh docker tag zowe-docker-snapshot.jfrog.io/ompzowe/app-server:testing zowe-docker-snapshot.jfrog.io/ompzowe/app-server:$IMAGE_VERSION From 35feea79a3c31ee0356c8e6f21f6f4c00cacc2eb Mon Sep 17 00:00:00 2001 From: James Struga Date: Tue, 13 Jul 2021 00:45:47 -0400 Subject: [PATCH 7/7] Updated to only build when merging to master --- .github/workflows/docker.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f3ae402..549728a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -6,9 +6,7 @@ name: CI on: # Triggers the workflow on push or pull request events but only for the staging branch push: - branches: [ staging ] - pull_request: - branches: [ staging ] + branches: [ master ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: