diff --git a/.github/workflows/random.yaml b/.github/workflows/random.yaml new file mode 100644 index 0000000..075385c --- /dev/null +++ b/.github/workflows/random.yaml @@ -0,0 +1,24 @@ +name: Manual Trigger Workflow + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Echo Message + run: echo "Workflow manually triggered." + + - name: Set branch name + run: | + echo "BRANCH_NAME=$(echo "${{ github.ref }}" | sed 's#refs/heads/##')" >> $GITHUB_ENV + + - name: Create file with content + run: | + mkdir -p test + cd test + echo "hello" > testing-file-touch-${{ env.BRANCH_NAME }}.txt + + diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..c23fe13 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,15 @@ +name: Manual Trigger Workflow run + +on: + workflow_run: + workflows: [Manual Trigger Workflow] + types: + - completed +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Echo Message copy fuile + run: | + cp touch testing-file-touch-${{ github.event.workflow_run.head_branch }}.txt new.txt diff --git a/.github/workflows/try.yaml b/.github/workflows/try.yaml new file mode 100644 index 0000000..85a4328 --- /dev/null +++ b/.github/workflows/try.yaml @@ -0,0 +1,12 @@ +name: Manual Trigger Workflow + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Echo Message + run: echo "Workflow manually triggered." diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 8f8691e..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,44 +0,0 @@ -pipeline { - agent { - label 'maven' - } - stages { - stage('Build JAR') { - steps { - sh "mvn -B -DskipTests clean package" - stash name:"jar", includes:"target/hello-0.0.1-SNAPSHOT.jar" - } - } - stage('Test') { - steps { - sh 'mvn test' - } - post { - always { - junit 'target/surefire-reports/*.xml' - } - } - } - stage('Build Image') { - steps { - unstash name:"jar" - script { - openshift.withCluster() { - openshift.startBuild("hello", "--from-file=target/hello-0.0.1-SNAPSHOT.jar", "--wait") - } - } - } - } - stage('Deploy') { - steps { - script { - openshift.withCluster() { - def dc = openshift.selector("dc", "hello") - dc.rollout().latest() - dc.rollout().status() - } - } - } - } - } -} diff --git a/deployment.yml b/deployment.yml deleted file mode 100644 index af93b0c..0000000 --- a/deployment.yml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: hello-spring-deployment - labels: - app: hello-spring -spec: - replicas: 3 - selector: - matchLabels: - app: hello-spring - template: - metadata: - labels: - app: hello-spring - spec: - containers: - - name: hello-spring - image: leonlevy/spring-hello:latest - ports: - - containerPort: 8080 ---- -apiVersion: v1 -kind: Service -metadata: - name: hello-spring-service -spec: - selector: - app: hello-spring - ports: - - protocol: TCP - port: 80 - targetPort: 8080 - type: LoadBalancer \ No newline at end of file diff --git a/pipeline/Jenkinsfile b/pipeline/Jenkinsfile deleted file mode 100644 index 8f8691e..0000000 --- a/pipeline/Jenkinsfile +++ /dev/null @@ -1,44 +0,0 @@ -pipeline { - agent { - label 'maven' - } - stages { - stage('Build JAR') { - steps { - sh "mvn -B -DskipTests clean package" - stash name:"jar", includes:"target/hello-0.0.1-SNAPSHOT.jar" - } - } - stage('Test') { - steps { - sh 'mvn test' - } - post { - always { - junit 'target/surefire-reports/*.xml' - } - } - } - stage('Build Image') { - steps { - unstash name:"jar" - script { - openshift.withCluster() { - openshift.startBuild("hello", "--from-file=target/hello-0.0.1-SNAPSHOT.jar", "--wait") - } - } - } - } - stage('Deploy') { - steps { - script { - openshift.withCluster() { - def dc = openshift.selector("dc", "hello") - dc.rollout().latest() - dc.rollout().status() - } - } - } - } - } -} diff --git a/testing-file-touch-testing-branch.txt b/testing-file-touch-testing-branch.txt new file mode 100644 index 0000000..7a30dec --- /dev/null +++ b/testing-file-touch-testing-branch.txt @@ -0,0 +1 @@ +testing-file-touch-testing-branch.txt hello